aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/goto_type_definition.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-15 21:56:51 +0000
committerAleksey Kladov <[email protected]>2019-11-15 23:12:35 +0000
commitd898ecb8f2c19eb041bcb27c7ce9edd9d891f2c2 (patch)
treea04aceb743365d7c246e5eb73e56be0a4e905c76 /crates/ra_ide_api/src/goto_type_definition.rs
parent1c819fc8f66def9661c7640051a40e5e820acd71 (diff)
Force passing Source when creating a SourceAnalyzer
Diffstat (limited to 'crates/ra_ide_api/src/goto_type_definition.rs')
-rw-r--r--crates/ra_ide_api/src/goto_type_definition.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/goto_type_definition.rs b/crates/ra_ide_api/src/goto_type_definition.rs
index 71146591d..2327cb1e7 100644
--- a/crates/ra_ide_api/src/goto_type_definition.rs
+++ b/crates/ra_ide_api/src/goto_type_definition.rs
@@ -18,7 +18,8 @@ pub(crate) fn goto_type_definition(
18 .find(|n| ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some()) 18 .find(|n| ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some())
19 })?; 19 })?;
20 20
21 let analyzer = hir::SourceAnalyzer::new(db, position.file_id, &node, None); 21 let analyzer =
22 hir::SourceAnalyzer::new(db, hir::Source::new(position.file_id.into(), &node), None);
22 23
23 let ty: hir::Ty = if let Some(ty) = 24 let ty: hir::Ty = if let Some(ty) =
24 ast::Expr::cast(node.clone()).and_then(|e| analyzer.type_of(db, &e)) 25 ast::Expr::cast(node.clone()).and_then(|e| analyzer.type_of(db, &e))