aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 632eaf0a0..845333e2a 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -4,7 +4,7 @@ use hir::{
4 Module, ModuleDef, ModuleSource, Semantics, 4 Module, ModuleDef, ModuleSource, Semantics,
5}; 5};
6use ide_db::{ 6use ide_db::{
7 defs::{classify_name, classify_name_ref, Definition}, 7 defs::{Definition, NameClass, NameRefClass},
8 RootDatabase, 8 RootDatabase,
9}; 9};
10use itertools::Itertools; 10use itertools::Itertools;
@@ -107,8 +107,8 @@ pub(crate) fn hover(
107 let node = token.parent(); 107 let node = token.parent();
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::Name(name) => NameClass::classify(&sema, &name).and_then(|d| d.defined(sema.db)),
111 ast::Name(name) => classify_name(&sema, &name).and_then(|d| d.into_definition(sema.db)), 111 ast::NameRef(name_ref) => NameRefClass::classify(&sema, &name_ref).map(|d| d.referenced(sema.db)),
112 _ => None, 112 _ => None,
113 } 113 }
114 }; 114 };