x/tools/gopls: completion fails for incomplete function literal parameter types #36479
Labels
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
The version of gopls is fairly recent, as of this writing:
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using an editor that inserts balanced delimiters—such as a closing parenthesis character after typing an opening parenthesis character—try to complete the function literal parameter type
config
at the cursor position, denoted by<>
here:What did you expect to see?
gopls would respond to the editor's request for completion there, and supply the identifier
config
as a good option.What did you see instead?
gopls stalls for a long while, but never produces any suggestions for completion.
If I delete the closing parenthesis after the
co
above, like this, gopls does offer completion suggestions:Similarly, if I round out more of the function literal, and move the cursor back after "co," gopls will offer completion suggestions:
I can see that in various states of being incomplete, this is not yet valid code. However, given the propensity for editors to help us with balanced delimiter insertion, it would be nice to accommodate completion in this situation.
The text was updated successfully, but these errors were encountered: