-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
x/tools/gopls: TestXxx()
completions not working when location followed by newline, due to parser error recovery
#61371
Labels
gopls/completion
Issues related to auto-completion in gopls.
gopls/parsing
Issues related to parsing / poor parser recovery.
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Comments
This is yet another case of poor parser error recovery. The parser parses the input above to
which pretty-prints to:
In other words, the first func decl swallowed the second. See also:
gopls/parsing
|
Thanks for investigating. With forward compatibility in particular, I think we should fix this upstream (in go/parser). That will take longer. Moving this to the next milestone. |
TestXxx()
completions not working when location followed by newlineTestXxx()
completions not working when location followed by newline, due to parser error recovery
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
gopls/completion
Issues related to auto-completion in gopls.
gopls/parsing
Issues related to parsing / poor parser recovery.
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls version
Affects versions >=0.12.0, including current master.
go env
What did you do?
When triggering completions in test files, such as:
What did you expect to see?
TestXxx
as one of the completions.What did you see instead?
TestMain
andTest
Editor and settings
n/a
Logs
Debugging journey
My debugging indicates that this started happening since https://go-review.googlesource.com/c/tools/+/459559.
It seems that
t.Closing != t.Opening
unless the completion is triggered at the end of the file.To replicate with existing tests:
The text was updated successfully, but these errors were encountered: