diff options
Diffstat (limited to 'crates/ra_ide_api/src/display')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index 1edb64e3d..20a8d418e 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -93,8 +93,8 @@ impl NavigationTarget { | |||
93 | file_id: FileId, | 93 | file_id: FileId, |
94 | pat: AstPtr<ast::Pat>, | 94 | pat: AstPtr<ast::Pat>, |
95 | ) -> NavigationTarget { | 95 | ) -> NavigationTarget { |
96 | let file = db.parse(file_id).tree; | 96 | let parse = db.parse(file_id); |
97 | let (name, full_range) = match pat.to_node(file.syntax()).kind() { | 97 | let (name, full_range) = match pat.to_node(parse.tree().syntax()).kind() { |
98 | ast::PatKind::BindPat(pat) => return NavigationTarget::from_bind_pat(file_id, &pat), | 98 | ast::PatKind::BindPat(pat) => return NavigationTarget::from_bind_pat(file_id, &pat), |
99 | _ => ("_".into(), pat.syntax_node_ptr().range()), | 99 | _ => ("_".into(), pat.syntax_node_ptr().range()), |
100 | }; | 100 | }; |
@@ -315,8 +315,8 @@ impl NavigationTarget { | |||
315 | } | 315 | } |
316 | 316 | ||
317 | pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> { | 317 | pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> { |
318 | let file = db.parse(symbol.file_id).tree; | 318 | let parse = db.parse(symbol.file_id); |
319 | let node = symbol.ptr.to_node(file.syntax()).to_owned(); | 319 | let node = symbol.ptr.to_node(parse.tree().syntax()).to_owned(); |
320 | 320 | ||
321 | fn doc_comments<N: ast::DocCommentsOwner>(node: &N) -> Option<String> { | 321 | fn doc_comments<N: ast::DocCommentsOwner>(node: &N) -> Option<String> { |
322 | node.doc_comment_text() | 322 | node.doc_comment_text() |
@@ -341,8 +341,8 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option | |||
341 | /// | 341 | /// |
342 | /// e.g. `struct Name`, `enum Name`, `fn Name` | 342 | /// e.g. `struct Name`, `enum Name`, `fn Name` |
343 | pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> { | 343 | pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> { |
344 | let file = db.parse(symbol.file_id).tree; | 344 | let parse = db.parse(symbol.file_id); |
345 | let node = symbol.ptr.to_node(file.syntax()).to_owned(); | 345 | let node = symbol.ptr.to_node(parse.tree().syntax()).to_owned(); |
346 | 346 | ||
347 | visitor() | 347 | visitor() |
348 | .visit(|node: &ast::FnDef| node.short_label()) | 348 | .visit(|node: &ast::FnDef| node.short_label()) |