-
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
fix: avoid hint items shadow local item from completions #18517
base: master
Are you sure you want to change the base?
fix: avoid hint items shadow local item from completions #18517
Conversation
This makes the search N*M, I'd be much happier with a hash set. |
finish. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should be the responsibility of the caller (doing the filtering), also this needs to be aware of namespaces, we do want to show importing completions for imports that bring a name into scope into a namespace that is currently "empty". (think of importing the Deserialize
trait while the derive is already in scope)
@@ -251,7 +251,6 @@ impl ImportAssets { | |||
*to_import = NameToImport::Exact(name, case_sensitive); | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this
☔ The latest upstream changes (presumably #18699) made this pull request unmergeable. Please resolve the merge conflicts. |
Apologies for the late reply. I've realized that the current approach is a bit too simplistic and rough. The specific rules and details still need further discussion. In light of that, I’ve decided to mark this PR as a draft so we can continue to discuss and refine the approach further. |
Relevant Issues
#18398 Don't auto import items when one is already in scope
#17164 Block specific items from being auto-imported
Fixed Problem
Now completions will not hint item that could shadow local item.
Problems that May Arise
Unexpected behavior
Maybe we can auto rename or use long path to disambiguation, and add a option to control the behavior.