Skip to content

Better handling of completions that shadow in scope entities #18810

Open
@Veykril

Description

@Veykril

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions