diff options
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/defs.rs | 4 | ||||
-rw-r--r-- | crates/ide_db/src/imports_locator.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index f8c7aa491..a243dcd15 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs | |||
@@ -90,7 +90,7 @@ pub enum NameClass { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | impl NameClass { | 92 | impl NameClass { |
93 | pub fn into_definition(self, db: &dyn HirDatabase) -> Option<Definition> { | 93 | pub fn definition(self, db: &dyn HirDatabase) -> Option<Definition> { |
94 | Some(match self { | 94 | Some(match self { |
95 | NameClass::ExternCrate(krate) => Definition::ModuleDef(krate.root_module(db).into()), | 95 | NameClass::ExternCrate(krate) => Definition::ModuleDef(krate.root_module(db).into()), |
96 | NameClass::Definition(it) => it, | 96 | NameClass::Definition(it) => it, |
@@ -99,7 +99,7 @@ impl NameClass { | |||
99 | }) | 99 | }) |
100 | } | 100 | } |
101 | 101 | ||
102 | pub fn definition(self, db: &dyn HirDatabase) -> Definition { | 102 | pub fn definition_or_reference(self, db: &dyn HirDatabase) -> Definition { |
103 | match self { | 103 | match self { |
104 | NameClass::ExternCrate(krate) => Definition::ModuleDef(krate.root_module(db).into()), | 104 | NameClass::ExternCrate(krate) => Definition::ModuleDef(krate.root_module(db).into()), |
105 | NameClass::Definition(it) | NameClass::ConstReference(it) => it, | 105 | NameClass::Definition(it) | NameClass::ConstReference(it) => it, |
diff --git a/crates/ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs index ed67e3553..e0d3e7293 100644 --- a/crates/ide_db/src/imports_locator.rs +++ b/crates/ide_db/src/imports_locator.rs | |||
@@ -60,5 +60,5 @@ fn get_name_definition<'a>( | |||
60 | candidate_node | 60 | candidate_node |
61 | }; | 61 | }; |
62 | let name = ast::Name::cast(candidate_name_node)?; | 62 | let name = ast::Name::cast(candidate_name_node)?; |
63 | classify_name(sema, &name)?.into_definition(sema.db) | 63 | classify_name(sema, &name)?.definition(sema.db) |
64 | } | 64 | } |