aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/display
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-06-11 14:49:56 +0100
committerAleksey Kladov <[email protected]>2019-06-11 16:28:51 +0100
commit4f94af3c4aaa57ebb4cb01f7e4edfb3a0821b09b (patch)
treeb7bbb49966711e4b771d93561d1635607c300369 /crates/ra_ide_api/src/display
parent36865adcb946d5567fb61d3547b78fc71df58b20 (diff)
use Source for Function
Diffstat (limited to 'crates/ra_ide_api/src/display')
-rw-r--r--crates/ra_ide_api/src/display/function_signature.rs2
-rw-r--r--crates/ra_ide_api/src/display/navigation_target.rs8
2 files changed, 2 insertions, 8 deletions
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 {