-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: bad completion candidate for variadic call where method returns slice #42691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is because the non-snippet insert text doesn't get the invocation It would be easy to fix the insert text to yield func foo() []int {
return nil
}
var _ []int = f<> // would complete to "foo()" instead of "foo" Do non-snippet users want the invocation parens when the function takes no arguments? |
Thanks.
Would another option be to not add the |
Yes, that is definitely an option too. |
I'm trying to fix this issue, and I would like to know if the behavior of ignoring |
You want to suppress "..." if it is a function call and snippets are disabled. If snippets are enabled then there is no problem with the "...". |
Add variadic completion in functions only if placeHolders is enabled. Fixes golang/go#42691
Change https://golang.org/cl/295950 mentions this issue: |
Add variadic completion in functions only if placeHolders is enabled. Fixes golang/go#42691
Add variadic completion in functions only if snippets is enabled. Fixes golang/go#42691
Add variadic completion in functions only if snippets is enabled. Fixes golang/go#42691
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Consider:
with the cursor at the
_
position. Attempt completion and you get the following candidates:Note that the new text for the
Vals
candidate is wrong: it applies the...
without the parentheses required to first call the method.What did you expect to see?
The candidate
Vals()...
What did you see instead?
As above.
cc @stamblerre @muirdm
FYI @leitzler
The text was updated successfully, but these errors were encountered: