diff options
author | Aleksey Kladov <[email protected]> | 2019-01-11 11:00:54 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-11 13:01:57 +0000 |
commit | f9ed8d4d23cd210f24ca303c72b436bfbe84741f (patch) | |
tree | 0fc1e57980421ff42e68f5ee8dc699a38dc0fbb4 /crates/ra_ide_api/src/hover.rs | |
parent | 1d3d05d5d70943d8b1356a7e2c8d8b63a1ec470d (diff) |
envapsulate navigation target better
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..9b06a0e58 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.range())? |
96 | .to_owned(); | 96 | .to_owned(); |
97 | Some(node) | 97 | Some(node) |
98 | } | 98 | } |