From afce8e442639fa9ed954b3659a2d1eccb7d80113 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 29 Jan 2019 20:49:31 +0100 Subject: Use the new Resolver API for goto def --- crates/ra_hir/src/expr/scope.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/expr/scope.rs') diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs index 23f1c5e7f..9202e3671 100644 --- a/crates/ra_hir/src/expr/scope.rs +++ b/crates/ra_hir/src/expr/scope.rs @@ -58,6 +58,10 @@ impl ExprScopes { scopes } + pub fn body(&self) -> Arc { + self.body.clone() + } + pub fn entries(&self, scope: ScopeId) -> &[ScopeEntry] { &self.scopes[scope].entries } @@ -220,7 +224,7 @@ impl ScopesWithSyntaxMapping { .collect() } - fn scope_for(&self, node: &SyntaxNode) -> Option { + pub fn scope_for(&self, node: &SyntaxNode) -> Option { node.ancestors() .map(SyntaxNodePtr::new) .filter_map(|ptr| self.syntax_mapping.syntax_expr(ptr)) -- cgit v1.2.3