Skip to content
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

Better handling of completions that shadow in scope entities #18810

Open
Veykril opened this issue Jan 1, 2025 · 0 comments
Open

Better handling of completions that shadow in scope entities #18810

Veykril opened this issue Jan 1, 2025 · 0 comments
Labels
A-completion autocompletion C-enhancement Category: enhancement

Comments

@Veykril
Copy link
Member

Veykril commented Jan 1, 2025

So to clarify, I would see the following possible action items:

  • detect when a trait autoimport would shadow an inherent method and downrank those completions

  • detect when a trait autoimport would shadow an inherent method and instead complete a fully qualified method call (e.g. foo.borrow_<|> -> std::borrow::BorrowMut::borrow_mut(foo))

  • detect when there's an inherent method currently shadowed by a trait method, and complete the fully qualified method call instead (e.g. when there's use std::borrow::BorrowMut; already, provide RefCell::borrow_mut(foo) as a completion)

  • when using the UFCS -> method call assist, detect if the method call would be shadowed and remove e.g. the BorrowMut import automatically (maybe only if it's unused)

Originally posted by flodiebold in #13786

@Veykril Veykril added A-completion autocompletion C-enhancement Category: enhancement labels Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion C-enhancement Category: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant