aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 787b714b3..e8a340ba4 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -101,11 +101,11 @@ fn hover_text_from_name_kind(
101 return match name_kind { 101 return match name_kind {
102 Macro(it) => { 102 Macro(it) => {
103 let src = it.source(db); 103 let src = it.source(db);
104 hover_text(src.ast.doc_comment_text(), Some(macro_label(&src.ast))) 104 hover_text(src.value.doc_comment_text(), Some(macro_label(&src.value)))
105 } 105 }
106 Field(it) => { 106 Field(it) => {
107 let src = it.source(db); 107 let src = it.source(db);
108 match src.ast { 108 match src.value {
109 hir::FieldSource::Named(it) => hover_text(it.doc_comment_text(), it.short_label()), 109 hir::FieldSource::Named(it) => hover_text(it.doc_comment_text(), it.short_label()),
110 _ => None, 110 _ => None,
111 } 111 }
@@ -116,7 +116,7 @@ fn hover_text_from_name_kind(
116 hir::AssocItem::TypeAlias(it) => from_def_source(db, it), 116 hir::AssocItem::TypeAlias(it) => from_def_source(db, it),
117 }, 117 },
118 Def(it) => match it { 118 Def(it) => match it {
119 hir::ModuleDef::Module(it) => match it.definition_source(db).ast { 119 hir::ModuleDef::Module(it) => match it.definition_source(db).value {
120 hir::ModuleSource::Module(it) => { 120 hir::ModuleSource::Module(it) => {
121 hover_text(it.doc_comment_text(), it.short_label()) 121 hover_text(it.doc_comment_text(), it.short_label())
122 } 122 }
@@ -158,7 +158,7 @@ fn hover_text_from_name_kind(
158 A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel, 158 A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel,
159 { 159 {
160 let src = def.source(db); 160 let src = def.source(db);
161 hover_text(src.ast.doc_comment_text(), src.ast.short_label()) 161 hover_text(src.value.doc_comment_text(), src.value.short_label())
162 } 162 }
163} 163}
164 164
@@ -170,7 +170,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
170 let mut res = HoverResult::new(); 170 let mut res = HoverResult::new();
171 171
172 let mut range = match_ast! { 172 let mut range = match_ast! {
173 match (token.ast.parent()) { 173 match (token.value.parent()) {
174 ast::NameRef(name_ref) => { 174 ast::NameRef(name_ref) => {
175 let mut no_fallback = false; 175 let mut no_fallback = false;
176 if let Some(name_kind) = 176 if let Some(name_kind) =
@@ -211,7 +211,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
211 }; 211 };
212 212
213 if range.is_none() { 213 if range.is_none() {
214 let node = token.ast.ancestors().find(|n| { 214 let node = token.value.ancestors().find(|n| {
215 ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some() 215 ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some()
216 })?; 216 })?;
217 let frange = FileRange { file_id: position.file_id, range: node.text_range() }; 217 let frange = FileRange { file_id: position.file_id, range: node.text_range() };