aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-10-15 15:15:01 +0100
committerAleksey Kladov <[email protected]>2020-10-15 16:37:36 +0100
commitfa3c449d8f5a67865cab8d4717b3e32dca5b672a (patch)
tree8143b3ee53bbd2b36768fbe085b4ddc6b7b70514 /crates/ide
parent7fadc78ebb43b0eb9b6ccf314e29bdd23717542f (diff)
Clarify NameClass names a bit
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/doc_links.rs2
-rw-r--r--crates/ide/src/goto_definition.rs2
-rw-r--r--crates/ide/src/hover.rs2
-rw-r--r--crates/ide/src/references.rs2
4 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs
index db3f911c8..71382f13e 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -233,7 +233,7 @@ pub(crate) fn external_docs(
233 let definition = match_ast! { 233 let definition = match_ast! {
234 match node { 234 match node {
235 ast::NameRef(name_ref) => classify_name_ref(&sema, &name_ref).map(|d| d.definition(sema.db)), 235 ast::NameRef(name_ref) => classify_name_ref(&sema, &name_ref).map(|d| d.definition(sema.db)),
236 ast::Name(name) => classify_name(&sema, &name).map(|d| d.definition(sema.db)), 236 ast::Name(name) => classify_name(&sema, &name).map(|d| d.definition_or_reference(sema.db)),
237 _ => None, 237 _ => None,
238 } 238 }
239 }; 239 };
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index 582bf4837..79fdb75ed 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -40,7 +40,7 @@ pub(crate) fn goto_definition(
40 reference_definition(&sema, &name_ref).to_vec() 40 reference_definition(&sema, &name_ref).to_vec()
41 }, 41 },
42 ast::Name(name) => { 42 ast::Name(name) => {
43 let def = classify_name(&sema, &name)?.definition(sema.db); 43 let def = classify_name(&sema, &name)?.definition_or_reference(sema.db);
44 let nav = def.try_to_nav(sema.db)?; 44 let nav = def.try_to_nav(sema.db)?;
45 vec![nav] 45 vec![nav]
46 }, 46 },
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 632eaf0a0..51f03c718 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -108,7 +108,7 @@ pub(crate) fn hover(
108 let definition = match_ast! { 108 let definition = match_ast! {
109 match node { 109 match node {
110 ast::NameRef(name_ref) => classify_name_ref(&sema, &name_ref).map(|d| d.definition(sema.db)), 110 ast::NameRef(name_ref) => classify_name_ref(&sema, &name_ref).map(|d| d.definition(sema.db)),
111 ast::Name(name) => classify_name(&sema, &name).and_then(|d| d.into_definition(sema.db)), 111 ast::Name(name) => classify_name(&sema, &name).and_then(|d| d.definition(sema.db)),
112 _ => None, 112 _ => None,
113 } 113 }
114 }; 114 };
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index 88e2f2db3..ec64207d2 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -132,7 +132,7 @@ fn find_name(
132 opt_name: Option<ast::Name>, 132 opt_name: Option<ast::Name>,
133) -> Option<RangeInfo<Definition>> { 133) -> Option<RangeInfo<Definition>> {
134 if let Some(name) = opt_name { 134 if let Some(name) = opt_name {
135 let def = classify_name(sema, &name)?.definition(sema.db); 135 let def = classify_name(sema, &name)?.definition_or_reference(sema.db);
136 let range = name.syntax().text_range(); 136 let range = name.syntax().text_range();
137 return Some(RangeInfo::new(range, def)); 137 return Some(RangeInfo::new(range, def));
138 } 138 }