aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/goto_definition.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-12 17:42:06 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-12 17:42:06 +0100
commit8bb81d7418dbc4c295d31d261441b67dba4c0f76 (patch)
treeaf552549d828905294f4f3c109cdc339c12020ad /crates/ra_ide_api/src/goto_definition.rs
parent2e466bb365813620de15afd5e04736a92fffdca9 (diff)
parentdeab4caa7b1ba81c1b7e6561bc270bbde6467f13 (diff)
Merge #1524
1524: make Parse fields private r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/goto_definition.rs')
-rw-r--r--crates/ra_ide_api/src/goto_definition.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index 08feed7dc..1066bf155 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -19,8 +19,8 @@ pub(crate) fn goto_definition(
19 db: &RootDatabase, 19 db: &RootDatabase,
20 position: FilePosition, 20 position: FilePosition,
21) -> Option<RangeInfo<Vec<NavigationTarget>>> { 21) -> Option<RangeInfo<Vec<NavigationTarget>>> {
22 let file = db.parse(position.file_id).tree; 22 let parse = db.parse(position.file_id);
23 let syntax = file.syntax(); 23 let syntax = parse.tree().syntax();
24 if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(syntax, position.offset) { 24 if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(syntax, position.offset) {
25 let navs = reference_definition(db, position.file_id, name_ref).to_vec(); 25 let navs = reference_definition(db, position.file_id, name_ref).to_vec();
26 return Some(RangeInfo::new(name_ref.syntax().range(), navs.to_vec())); 26 return Some(RangeInfo::new(name_ref.syntax().range(), navs.to_vec()));