aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-01-29 19:49:31 +0000
committerFlorian Diebold <[email protected]>2019-02-01 21:45:43 +0000
commitafce8e442639fa9ed954b3659a2d1eccb7d80113 (patch)
tree38015aa82986dc69f5b60cfb21fe6062a37d8006 /crates/ra_hir/src/expr
parent33ff7b56ff353410e7bcb7aed27004d4f0a57d8e (diff)
Use the new Resolver API for goto def
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r--crates/ra_hir/src/expr/scope.rs6
1 files changed, 5 insertions, 1 deletions
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 {
58 scopes 58 scopes
59 } 59 }
60 60
61 pub fn body(&self) -> Arc<Body> {
62 self.body.clone()
63 }
64
61 pub fn entries(&self, scope: ScopeId) -> &[ScopeEntry] { 65 pub fn entries(&self, scope: ScopeId) -> &[ScopeEntry] {
62 &self.scopes[scope].entries 66 &self.scopes[scope].entries
63 } 67 }
@@ -220,7 +224,7 @@ impl ScopesWithSyntaxMapping {
220 .collect() 224 .collect()
221 } 225 }
222 226
223 fn scope_for(&self, node: &SyntaxNode) -> Option<ScopeId> { 227 pub fn scope_for(&self, node: &SyntaxNode) -> Option<ScopeId> {
224 node.ancestors() 228 node.ancestors()
225 .map(SyntaxNodePtr::new) 229 .map(SyntaxNodePtr::new)
226 .filter_map(|ptr| self.syntax_mapping.syntax_expr(ptr)) 230 .filter_map(|ptr| self.syntax_mapping.syntax_expr(ptr))