Skip to content
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: unimported completion is case sensitive #60545

Closed
limitcool opened this issue Jun 1, 2023 · 3 comments
Closed

x/tools/gopls: unimported completion is case sensitive #60545

limitcool opened this issue Jun 1, 2023 · 3 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@limitcool
Copy link

gopls version

golang.org/x/tools/gopls v0.12.0
go: go1.20.4

What did you do?

I updated gopls to v0.12.0, but code completion does not work when using lowercase letters. When I roll back to v0.11.0, it works fine. I noticed that when using v0.12.0 for the first time and typing fmt.p, code completion works normally. However, after saving the code and using fmt.p for the second time, code completion does not work.

W(1$TA_L YVIT7ZV(I}AMFR

Build info


golang.org/x/tools/gopls v0.12.0
golang.org/x/tools/gopls@v0.12.0 h1:O8KGdGuvu3YmAwim3KYmV2l20Cce5VMS74LayO2cDw8=
github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
golang.org/x/mod@v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/sync@v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys@v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/text@v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/tools@v0.9.2-0.20230524171317-188b785caf35 h1:B5e02cBXQWRAs5SloauCQ9RXMKeqz96eIBJ3W9Ofy+U=
golang.org/x/vuln@v0.0.0-20230110180137-6ad3e3d07815 h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU=
honnef.co/go/tools@v0.4.2 h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc=
mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.4

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jun 1, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jun 1, 2023
@limitcool limitcool changed the title x/tools/gopls: x/tools/gopls: code completion does not work Jun 1, 2023
@findleyr findleyr changed the title x/tools/gopls: code completion does not work x/tools/gopls: unimported completion is case sensitive Jun 1, 2023
@findleyr
Copy link
Contributor

findleyr commented Jun 1, 2023

Thanks for the report.

After testing it out a bit, I think the problem is simply that unimported completion (the completion gopls provides for packages that aren't yet imported) is case-sensitive, whereas normal completion is not.

@limitcool is that consistent with what you observe?

Fix incoming.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.12.1 Jun 1, 2023
@gopherbot
Copy link

Change https://go.dev/cl/499795 mentions this issue: gopls: unimported completion should use the completion matcher

@findleyr findleyr self-assigned this Jun 1, 2023
@limitcool
Copy link
Author

Thanks for the report.

After testing it out a bit, I think the problem is simply that unimported completion (the completion gopls provides for packages that aren't yet imported) is case-sensitive, whereas normal completion is not.

@limitcool is that consistent with what you observe?

Fix incoming.

When I first opened VS Code, I noticed that fmt code completion worked in lowercase even without importing fmt. However, once I saved the file, if fmt was not imported, lowercase code completion would stop working. If I manually imported fmt, lowercase code completion would continue to work.
I also noticed some other issues. For example, if I used fmt in a package, after importing that package, fmt.p code completion would stop working immediately, even when first opening VS Code, and I would be unable to get code completion. If I manually imported fmt, code completion would resume.
94bc173db8a6b604abd3f784e69ead3

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants