-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: menu sort strategy for fuzzy match score sorting in completion … #3215
Conversation
This would fix #2508 |
I don't think this fixes #2508. I tried it against the reproduction case there and the results are the same. |
Are you sure ? I just tried the reproduction case in #2508 and this seems to solve the issue for me. |
Whoops I was on the wrong branch 😅 Yep, looks like this does fix #2508 👍 |
Just rebased this on master, could someone review this pretty please ? It would unblock some PRs, including the LSP preselect feature that I implemented a couple months ago. As a reminder: the diff may seem big because of the rustmft formatting that changed the indentation of a whole closure, but the only changes are:
|
Do we need the two strategies though? Why not just change the behaviour to sort based on the score? |
Some pickers such as code actions do not use a score AFAIK, so it makes sense for them to be sorted alphabetically (which they are on master). |
Looks like this is blocking #3084 (comment) |
To review I've used I still think this could be a method on the
#4134 does change the strategy to sort by score too. So maybe #4134 is enough, then #2705 can be implemented on top of 63a54ee |
Superseeded by #4134 . |
This adds a sorting strategy to the menu.
As of now, all completions are sorted alphabetically after passing the fuzzy match filter. With this PR they are sorted by their fuzzy match score after passing the filter.
Code actions menu's behavior remains the same.
This comes from #2705, where it is needed for LSP preselect.
The diff may seem big because of the rustmft formatting that changed the indentation of a whole closure, but the only changes are:
Menu
constructorscore()
method