diff options
author | Aleksey Kladov <[email protected]> | 2019-04-12 22:44:47 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-04-12 22:44:47 +0100 |
commit | 0fd93bc14a2d0ce2edd682d26c18979c13f181c5 (patch) | |
tree | e800dc46abe63bad2eaffaf7f3c0f4d8358d0c9a /crates/ra_ide_api/src/hover.rs | |
parent | 20013de2abb95bc024f55163b1a5044cfb52a873 (diff) |
use really correct resolver for expressions
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 0cba5a665..397b56786 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -132,7 +132,7 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> { | |||
132 | .ancestors() | 132 | .ancestors() |
133 | .take_while(|it| it.range() == leaf_node.range()) | 133 | .take_while(|it| it.range() == leaf_node.range()) |
134 | .find(|&it| ast::Expr::cast(it).is_some() || ast::Pat::cast(it).is_some())?; | 134 | .find(|&it| ast::Expr::cast(it).is_some() || ast::Pat::cast(it).is_some())?; |
135 | let analyzer = hir::SourceAnalyzer::new(db, frange.file_id, node); | 135 | let analyzer = hir::SourceAnalyzer::new(db, frange.file_id, node, None); |
136 | let ty = if let Some(ty) = ast::Expr::cast(node).and_then(|e| analyzer.type_of(db, e)) { | 136 | let ty = if let Some(ty) = ast::Expr::cast(node).and_then(|e| analyzer.type_of(db, e)) { |
137 | ty | 137 | ty |
138 | } else if let Some(ty) = ast::Pat::cast(node).and_then(|p| analyzer.type_of_pat(db, p)) { | 138 | } else if let Some(ty) = ast::Pat::cast(node).and_then(|p| analyzer.type_of_pat(db, p)) { |