aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-23 17:44:15 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-23 17:44:15 +0100
commit3e086528efd950e3051654daf9e62f339ef4a55c (patch)
tree3b555fbdb1cf4d8c9c2a67e34b29ec8ebc31b2cb /crates/ra_hir/src
parent5f3ff157e3efe9f4fe2461bca1a0caaa5d2c72e5 (diff)
parent8e49bb664a03c29e25055a5a2ec03aa055462423 (diff)
Merge #1582
1582: Show local variable types in completion r=matklad a=viorina Co-authored-by: Ekaterina Babshukova <[email protected]>
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)