-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Prefer to auto complete in scope word rather than import #18530
Comments
Hmm... I'm not sure it would be better. This is an exact match after all. |
I'd probably prefer a prefix match to rank above an exact match flyimport, because if it's wrong, it's only wrong once (assuming you actually import it). |
Exact match makes sense if from a pure text search perspective. But I would argue that DX and context matter here. The primary goal should be to do the least work possible first, then to provide a good match. Matches that take no action other than autocomplete should be ranked above matches that both autocomplete and import, regardless of the exactness of the match. Because if the match with imports happens to be wrong, the developer must go to the top of the file and undo what rust-analyzer did before continuing their work. This is very disruptive to workflow. |
I don't fully understand what you mean in the second half of this comment, but I think we're on the same page? |
I assume that developers rarely accept the wrong completion. Also if they do, it's a matter of Undo, no need to go to the top of the file. But the argument @lnicola provided is convincing. |
I see a lot of issues about the scope of one import vs another. But I'm experiencing a lot of frustration when using the auto complete feature for in scope variables competing with auto import.
Example
This seems completely unexpected. I would assume local vars should always be prefered over importing a new module in terms of auto complete.
The text was updated successfully, but these errors were encountered: