diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-11 15:35:41 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-11 15:35:41 +0000 |
commit | aad1bf877e4ba5ce9e28e8bde14f790ef8d1551b (patch) | |
tree | 9d3ea7f166adcd09fb77cfdb7fc1bad03efc95cd /crates/ra_ide_api/src/hover.rs | |
parent | 0b83bde6e2f3782ea6acd907fa0a634912cebb3d (diff) | |
parent | f23a13bfa7bae7e34070bfd14d22b70a82315022 (diff) |
Merge #496
496: Include two element ranges into the nav. r=matklad a=matklad
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.rs | 4 |
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 41309e756..f544ffa6d 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -88,11 +88,11 @@ fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Cancelable<Option<S | |||
88 | 88 | ||
89 | impl NavigationTarget { | 89 | impl NavigationTarget { |
90 | fn node(&self, db: &RootDatabase) -> Option<TreePtr<SyntaxNode>> { | 90 | fn node(&self, db: &RootDatabase) -> Option<TreePtr<SyntaxNode>> { |
91 | let source_file = db.source_file(self.file_id); | 91 | let source_file = db.source_file(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() |
95 | .find(|node| node.kind() == self.kind && node.range() == self.range)? | 95 | .find(|node| node.kind() == self.kind() && node.range() == self.full_range())? |
96 | .to_owned(); | 96 | .to_owned(); |
97 | Some(node) | 97 | Some(node) |
98 | } | 98 | } |