Add public function for resolving ast::Expr
to hir::Callable
This commit is contained in:
parent
0ac05c0527
commit
ed3497883c
@ -1120,6 +1120,10 @@ pub fn binding_mode_of_pat(&self, pat: &ast::IdentPat) -> Option<BindingMode> {
|
||||
self.analyze(pat.syntax())?.binding_mode_of_pat(self.db, pat)
|
||||
}
|
||||
|
||||
pub fn resolve_expr_as_callable(&self, call: &ast::Expr) -> Option<Callable> {
|
||||
self.analyze(call.syntax())?.resolve_expr_as_callable(self.db, call)
|
||||
}
|
||||
|
||||
pub fn resolve_method_call(&self, call: &ast::MethodCallExpr) -> Option<Function> {
|
||||
self.analyze(call.syntax())?.resolve_method_call(self.db, call)
|
||||
}
|
||||
|
@ -303,6 +303,14 @@ pub(crate) fn resolve_method_call_fallback(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn resolve_expr_as_callable(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
call: &ast::Expr,
|
||||
) -> Option<Callable> {
|
||||
self.type_of_expr(db, &call.clone())?.0.as_callable(db)
|
||||
}
|
||||
|
||||
pub(crate) fn resolve_field(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
|
Loading…
Reference in New Issue
Block a user