aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorEkaterina Babshukova <[email protected]>2019-07-23 17:24:54 +0100
committerEkaterina Babshukova <[email protected]>2019-07-23 17:26:27 +0100
commit8e49bb664a03c29e25055a5a2ec03aa055462423 (patch)
tree3b555fbdb1cf4d8c9c2a67e34b29ec8ebc31b2cb /crates/ra_hir/src
parent5f3ff157e3efe9f4fe2461bca1a0caaa5d2c72e5 (diff)
show local variable types in completion
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/source_binder.rs8
1 files changed, 8 insertions, 0 deletions
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 {
256 Some(self.infer.as_ref()?[pat_id].clone()) 256 Some(self.infer.as_ref()?[pat_id].clone())
257 } 257 }
258 258
259 pub fn type_of_pat_by_id(
260 &self,
261 _db: &impl HirDatabase,
262 pat_id: expr::PatId,
263 ) -> Option<crate::Ty> {
264 Some(self.infer.as_ref()?[pat_id].clone())
265 }
266
259 pub fn resolve_method_call(&self, call: &ast::MethodCallExpr) -> Option<Function> { 267 pub fn resolve_method_call(&self, call: &ast::MethodCallExpr) -> Option<Function> {
260 let expr_id = self.body_source_map.as_ref()?.node_expr(&call.clone().into())?; 268 let expr_id = self.body_source_map.as_ref()?.node_expr(&call.clone().into())?;
261 self.infer.as_ref()?.method_resolution(expr_id) 269 self.infer.as_ref()?.method_resolution(expr_id)