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
Improve autocompletion order #5013
Comments
A fix for this will go out with the next release. Thanks so much for the feedback! 🙏 |
Just to record this here: Theo also mentioned this in his video |
This is an attempt to fix #5013 by doing two things: 1. Rank "obvious" matches in completions higher (see the code comment) 2. When tied: rank keywords higher than variables Co-authored-by: Antonio <antonio@zed.dev> Co-authored-by: bennetbo <bennetbo@gmx.de>
@DannyJJK that last one, that's a different issue: we rank recent items higher. There's a very thin line after the first 2 results. Admittedly, it's really hard to spot and we should probably improve that UI. In #7727 we just made some improvements that should help with the bug that Theo reported and some of the others reported in here ( |
This is an attempt to fix #5013 by doing two things: 1. Rank "obvious" matches in completions higher (see the code comment) 2. When tied: rank keywords higher than variables Release Notes: - Improved sorting of completion results to prefer literal matches. ([#5013](#5013)). ### Before ![screenshot-2024-02-13-13 08 13@2x](https://github.com/zed-industries/zed/assets/1185253/77decb0b-5b47-45de-ab69-f7b333072b45) ![screenshot-2024-02-13-13 10 42@2x](https://github.com/zed-industries/zed/assets/1185253/ae33d0fe-06f5-4fc1-84f8-ddf6dbe80ba5) ### After ![screenshot-2024-02-13-13 06 22@2x](https://github.com/zed-industries/zed/assets/1185253/3c526bab-6392-4eeb-a2f2-dd73ccf228e8) ![screenshot-2024-02-13-13 06 50@2x](https://github.com/zed-industries/zed/assets/1185253/b5b9d513-766d-4a53-94de-b46271f5978c) Co-authored-by: Antonio <antonio@zed.dev> Co-authored-by: bennetbo <bennetbo@gmx.de>
We just merged #7727 and it attempts to fix the order. If problems like this pop up again, I think it would be best to have separate issues with clear descriptions on how to reproduce the problem and what the expected/actual behavior are, since there's a lot of nuance in how these completions are sorted and we don't want to make something worse by loosely making something else better :) |
Same problem happens with C++ too. |
Can you provide more information? i.e. what did you type, what did you expect to see, what did you see instead, etc.? |
I can't see that screenshot, but that does sound like an issue. Like I wrote above:
Can you create a new ticket for this? |
@bernardinorafael can you create a ticket with a minimal reproducible example, what you expect to see, what you get instead? |
Check for existing issues
Describe the feature
In VSCode rust-ananlyzer puts
Vec
type beforevec!
macro when autocompleting something likeIn Zed autocomplete order also definitely should respect at least the case of item being autocompleted, and if possible also try rearanging completions arrording to some heuristic or maybe even some pretrained neural network, which would assign weight to completions
Also, using macros for types is quite rare, so they can be moved down
If applicable, add mockups / screenshots to help present your vision of the feature
The text was updated successfully, but these errors were encountered: