aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
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)