From 8e49bb664a03c29e25055a5a2ec03aa055462423 Mon Sep 17 00:00:00 2001 From: Ekaterina Babshukova Date: Tue, 23 Jul 2019 19:24:54 +0300 Subject: show local variable types in completion --- crates/ra_hir/src/source_binder.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index fc9bc33d2..c2c6921cb 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs @@ -256,6 +256,14 @@ impl SourceAnalyzer { Some(self.infer.as_ref()?[pat_id].clone()) } + pub fn type_of_pat_by_id( + &self, + _db: &impl HirDatabase, + pat_id: expr::PatId, + ) -> Option { + Some(self.infer.as_ref()?[pat_id].clone()) + } + pub fn resolve_method_call(&self, call: &ast::MethodCallExpr) -> Option { let expr_id = self.body_source_map.as_ref()?.node_expr(&call.clone().into())?; self.infer.as_ref()?.method_resolution(expr_id) -- cgit v1.2.3