goto where trait method impl

This commit is contained in:
bitgaoshu 2022-06-15 23:13:15 +08:00 committed by Florian Diebold
parent 6fc5c3cd21
commit 1ef5e14c2c
5 changed files with 366 additions and 117 deletions

View file

@ -348,6 +348,9 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
self.imp.resolve_method_call(call).map(Function::from)
}
pub fn resolve_impl_method(&self, call: &ast::Expr) -> Option<Function> {
self.imp.resolve_impl_method(call).map(Function::from)
}
pub fn resolve_method_call_as_callable(&self, call: &ast::MethodCallExpr) -> Option<Callable> {
self.imp.resolve_method_call_as_callable(call)
}
@ -978,6 +981,10 @@ impl<'db> SemanticsImpl<'db> {
self.analyze(call.syntax())?.resolve_method_call(self.db, call).map(|(id, _)| id)
}
fn resolve_impl_method(&self, call: &ast::Expr) -> Option<FunctionId> {
self.analyze(call.syntax())?.resolve_impl_method(self.db, call)
}
fn resolve_method_call_as_callable(&self, call: &ast::MethodCallExpr) -> Option<Callable> {
let source_analyzer = self.analyze(call.syntax())?;
let (func, subst) = source_analyzer.resolve_method_call(self.db, call)?;