aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-29 07:40:39 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-29 07:40:39 +0100
commit7a1cae59acf72f821343b2ba10ef69fb92a5b952 (patch)
tree26e606ccd132a24e9bc89cf174e4adadf60c5992 /crates/ra_ide_api/src/hover.rs
parentb0d84cb8faefedde7ace4ff152a2a13408e79e5d (diff)
parent80a17251473bd6213a4c8a51ea7f732394d173c5 (diff)
Merge #1337
1337: Move syntax errors our of syntax tree r=matklad a=matklad I am not really sure if it's a good idea, but `SyntaxError` do not really belong to a `SyntaxTree`. So let's just store them on the side? Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 6545a2581..a390dab65 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -68,7 +68,7 @@ impl HoverResult {
68} 68}
69 69
70pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<HoverResult>> { 70pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<HoverResult>> {
71 let file = db.parse(position.file_id); 71 let file = db.parse(position.file_id).tree;
72 let mut res = HoverResult::new(); 72 let mut res = HoverResult::new();
73 73
74 let mut range = None; 74 let mut range = None;
@@ -120,7 +120,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
120} 120}
121 121
122pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> { 122pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
123 let file = db.parse(frange.file_id); 123 let file = db.parse(frange.file_id).tree;
124 let syntax = file.syntax(); 124 let syntax = file.syntax();
125 let leaf_node = find_covering_element(syntax, frange.range); 125 let leaf_node = find_covering_element(syntax, frange.range);
126 // if we picked identifier, expand to pattern/expression 126 // if we picked identifier, expand to pattern/expression