aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-15 23:12:59 +0000
committerGitHub <[email protected]>2019-11-15 23:12:59 +0000
commitd9d99369b2765eaef7f49cd519990769191c3381 (patch)
tree5685e9db16e4a35c7ff3158d5c09becf9a45b31d /crates/ra_ide_api/src/hover.rs
parent69f3b01dc5dd70d9bdf6de4d859ad593a689395d (diff)
parentd898ecb8f2c19eb041bcb27c7ce9edd9d891f2c2 (diff)
Merge #2271
2271: Force passing Source when creating a SourceAnalyzer 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.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 07d511fb3..92b4b1f79 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -230,7 +230,8 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
230 .ancestors() 230 .ancestors()
231 .take_while(|it| it.text_range() == leaf_node.text_range()) 231 .take_while(|it| it.text_range() == leaf_node.text_range())
232 .find(|it| ast::Expr::cast(it.clone()).is_some() || ast::Pat::cast(it.clone()).is_some())?; 232 .find(|it| ast::Expr::cast(it.clone()).is_some() || ast::Pat::cast(it.clone()).is_some())?;
233 let analyzer = hir::SourceAnalyzer::new(db, frange.file_id, &node, None); 233 let analyzer =
234 hir::SourceAnalyzer::new(db, hir::Source::new(frange.file_id.into(), &node), None);
234 let ty = if let Some(ty) = ast::Expr::cast(node.clone()).and_then(|e| analyzer.type_of(db, &e)) 235 let ty = if let Some(ty) = ast::Expr::cast(node.clone()).and_then(|e| analyzer.type_of(db, &e))
235 { 236 {
236 ty 237 ty