aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/completion/presentation.rs2
-rw-r--r--crates/ra_ide_api/src/display/function_signature.rs2
-rw-r--r--crates/ra_ide_api/src/display/navigation_target.rs8
-rw-r--r--crates/ra_ide_api/src/hover.rs12
4 files changed, 9 insertions, 15 deletions
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs
index d405161d6..e9ae20225 100644
--- a/crates/ra_ide_api/src/completion/presentation.rs
+++ b/crates/ra_ide_api/src/completion/presentation.rs
@@ -100,7 +100,7 @@ impl Completions {
100 ) { 100 ) {
101 let sig = func.signature(ctx.db); 101 let sig = func.signature(ctx.db);
102 let name = name.unwrap_or_else(|| sig.name().to_string()); 102 let name = name.unwrap_or_else(|| sig.name().to_string());
103 let (_, ast_node) = func.source(ctx.db); 103 let ast_node = func.source(ctx.db).ast;
104 let detail = function_label(&ast_node); 104 let detail = function_label(&ast_node);
105 105
106 let mut builder = CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name) 106 let mut builder = CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name)
diff --git a/crates/ra_ide_api/src/display/function_signature.rs b/crates/ra_ide_api/src/display/function_signature.rs
index d09950bce..d0c155de7 100644
--- a/crates/ra_ide_api/src/display/function_signature.rs
+++ b/crates/ra_ide_api/src/display/function_signature.rs
@@ -33,7 +33,7 @@ impl FunctionSignature {
33 33
34 pub(crate) fn from_hir(db: &db::RootDatabase, function: hir::Function) -> Self { 34 pub(crate) fn from_hir(db: &db::RootDatabase, function: hir::Function) -> Self {
35 let doc = function.docs(db); 35 let doc = function.docs(db);
36 let (_, ast_node) = function.source(db); 36 let ast_node = function.source(db).ast;
37 FunctionSignature::from(&*ast_node).with_doc_opt(doc) 37 FunctionSignature::from(&*ast_node).with_doc_opt(doc)
38 } 38 }
39} 39}
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs
index bef5f0980..3333771ab 100644
--- a/crates/ra_ide_api/src/display/navigation_target.rs
+++ b/crates/ra_ide_api/src/display/navigation_target.rs
@@ -164,13 +164,7 @@ impl NavigationTarget {
164 } 164 }
165 165
166 pub(crate) fn from_function(db: &RootDatabase, func: hir::Function) -> NavigationTarget { 166 pub(crate) fn from_function(db: &RootDatabase, func: hir::Function) -> NavigationTarget {
167 let (file_id, fn_def) = func.source(db); 167 NavigationTarget::from_def_source(db, func)
168 NavigationTarget::from_named(
169 file_id.original_file(db),
170 &*fn_def,
171 fn_def.doc_comment_text(),
172 fn_def.short_label(),
173 )
174 } 168 }
175 169
176 pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget { 170 pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget {
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index ee0f2dde8..4dd3c1b9f 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -96,8 +96,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
96 96
97 match classify_name_ref(db, &analyzer, name_ref) { 97 match classify_name_ref(db, &analyzer, name_ref) {
98 Some(Method(it)) => { 98 Some(Method(it)) => {
99 let it = it.source(db).1; 99 let src = it.source(db);
100 res.extend(hover_text(it.doc_comment_text(), it.short_label())); 100 res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()));
101 } 101 }
102 Some(Macro(it)) => { 102 Some(Macro(it)) => {
103 let it = it.source(db).1; 103 let it = it.source(db).1;
@@ -111,8 +111,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
111 } 111 }
112 Some(AssocItem(it)) => match it { 112 Some(AssocItem(it)) => match it {
113 hir::ImplItem::Method(it) => { 113 hir::ImplItem::Method(it) => {
114 let it = it.source(db).1; 114 let src = it.source(db);
115 res.extend(hover_text(it.doc_comment_text(), it.short_label())) 115 res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
116 } 116 }
117 hir::ImplItem::Const(it) => { 117 hir::ImplItem::Const(it) => {
118 let it = it.source(db).1; 118 let it = it.source(db).1;
@@ -132,8 +132,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
132 } 132 }
133 } 133 }
134 hir::ModuleDef::Function(it) => { 134 hir::ModuleDef::Function(it) => {
135 let it = it.source(db).1; 135 let src = it.source(db);
136 res.extend(hover_text(it.doc_comment_text(), it.short_label())) 136 res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
137 } 137 }
138 hir::ModuleDef::Struct(it) => { 138 hir::ModuleDef::Struct(it) => {
139 let src = it.source(db); 139 let src = it.source(db);