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: prioritise explicit upper case matches in completion results #64224

Open
alecthomas opened this issue Nov 17, 2023 · 2 comments
Open
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

@alecthomas
Copy link

alecthomas commented Nov 17, 2023

In the general case I can see why case-insensitive completion makes sense, but if I've explicitly provided an upper case letter I would expect it to prioritise exact matches.

image

What's even stranger is that without entering any text at all, Name is the first option:

image
@findleyr
Copy link
Contributor

Thanks for the report. I think you're right: we should update our fuzzy matcher to prefer exact case match.

This is a gopls issue, so transferring to the gopls issue tracker.

@findleyr findleyr changed the title Completion doesn't seem to prioritise explicit upper case matches x/tools/gopls: prioritise explicit upper case matches in completion results Nov 17, 2023
@findleyr findleyr transferred this issue from golang/vscode-go Nov 17, 2023
@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 Nov 17, 2023
@gopherbot gopherbot added this to the Unreleased milestone Nov 17, 2023
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.16.0 Nov 17, 2023
@muirdm
Copy link

muirdm commented Nov 20, 2023

There is a bonus for case sensitive match already here. I think the problem is we use the same bonus for matching the first letter of a segment, so the match bonus doesn't differentiate the case in this issue. It might work to just split those apart into separate bonuses.

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

4 participants