diff options
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r-- | crates/ra_hir/src/expr/scope.rs | 6 |
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)) |