-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Should completions be sorted by name? #1792
Comments
imo they should be by 1) Leven distance from the test text or 2) source order of fields. |
I agree that Levenshtein distance and order of fields could both be interesting metrics to try sorting by. On editor handling ordering: Editors do handle sorting for you as the spec says:
We override the sort text so we order certain types of completions above others. This gives us more control but means we have to implement more ourselves vs the editor implementing it for us. |
If the import statement is unused then why not remove it so it doesn't appear in the completions? I do agree that This is a far more complex (but better) mechanism than what this issue is about so created a separate issue in #1845. |
Yes |
a bit irrelevant but i think declarations should appear before keywords. the main reason is because currently |
This could still be improved but should still be better over the current behaviour. Related #1792
This could still be improved but should still be better over the current behaviour. Related #1792
This could still be improved but should still be better over the current behaviour. Related #1792
Completions are sorted by the label since 1805837. Grouping them based on what kind (keyword, function, variable, ...) they are seems reasonable but sorted them alphabetically? You often group/order declarations in a way to make them easier to understand which gets undone by the sorting.
relevant code:
zls/src/features/completions.zig
Lines 957 to 966 in 8cca7a1
The text was updated successfully, but these errors were encountered: