mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
feat: Deprioritize ops methods in completion
This commit is contained in:
parent
41a0e95d61
commit
ca0633c808
6 changed files with 106 additions and 30 deletions
|
@ -1610,6 +1610,12 @@ pub struct Trait {
|
|||
}
|
||||
|
||||
impl Trait {
|
||||
pub fn lang(db: &dyn HirDatabase, krate: Crate, name: &Name) -> Option<Trait> {
|
||||
db.lang_item(krate.into(), name.to_smol_str())
|
||||
.and_then(LangItemTarget::as_trait)
|
||||
.map(Into::into)
|
||||
}
|
||||
|
||||
pub fn module(self, db: &dyn HirDatabase) -> Module {
|
||||
Module { id: self.id.lookup(db.upcast()).container }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue