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.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index b6d727399..ff9ae2d9c 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -7,7 +7,7 @@ use ra_syntax::{
7use crate::{db::RootDatabase, RangeInfo, FilePosition, FileRange, NavigationTarget}; 7use crate::{db::RootDatabase, RangeInfo, FilePosition, FileRange, NavigationTarget};
8 8
9pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<String>> { 9pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<String>> {
10 let file = db.source_file(position.file_id); 10 let file = db.parse(position.file_id);
11 let mut res = Vec::new(); 11 let mut res = Vec::new();
12 12
13 let mut range = None; 13 let mut range = None;
@@ -53,7 +53,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
53} 53}
54 54
55pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> { 55pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
56 let file = db.source_file(frange.file_id); 56 let file = db.parse(frange.file_id);
57 let syntax = file.syntax(); 57 let syntax = file.syntax();
58 let leaf_node = find_covering_node(syntax, frange.range); 58 let leaf_node = find_covering_node(syntax, frange.range);
59 // if we picked identifier, expand to pattern/expression 59 // if we picked identifier, expand to pattern/expression
@@ -88,7 +88,7 @@ fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Option<String> {
88 88
89impl NavigationTarget { 89impl NavigationTarget {
90 fn node(&self, db: &RootDatabase) -> Option<TreeArc<SyntaxNode>> { 90 fn node(&self, db: &RootDatabase) -> Option<TreeArc<SyntaxNode>> {
91 let source_file = db.source_file(self.file_id()); 91 let source_file = db.parse(self.file_id());
92 let source_file = source_file.syntax(); 92 let source_file = source_file.syntax();
93 let node = source_file 93 let node = source_file
94 .descendants() 94 .descendants()