aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr
diff options
context:
space:
mode:
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 fe5e836f2..afba66069 100644
--- a/crates/ra_hir/src/expr/scope.rs
+++ b/crates/ra_hir/src/expr/scope.rs
@@ -166,6 +166,7 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope
166 166
167#[cfg(test)] 167#[cfg(test)]
168mod tests { 168mod tests {
169 use hir_expand::Source;
169 use ra_db::{fixture::WithFixture, SourceDatabase}; 170 use ra_db::{fixture::WithFixture, SourceDatabase};
170 use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; 171 use ra_syntax::{algo::find_node_at_offset, ast, AstNode};
171 use test_utils::{assert_eq_text, extract_offset}; 172 use test_utils::{assert_eq_text, extract_offset};
@@ -189,7 +190,10 @@ mod tests {
189 let analyzer = SourceAnalyzer::new(&db, file_id, marker.syntax(), None); 190 let analyzer = SourceAnalyzer::new(&db, file_id, marker.syntax(), None);
190 191
191 let scopes = analyzer.scopes(); 192 let scopes = analyzer.scopes();
192 let expr_id = analyzer.body_source_map().node_expr(&marker.into()).unwrap(); 193 let expr_id = analyzer
194 .body_source_map()
195 .node_expr(Source { file_id: file_id.into(), ast: &marker.into() })
196 .unwrap();
193 let scope = scopes.scope_for(expr_id); 197 let scope = scopes.scope_for(expr_id);
194 198
195 let actual = scopes 199 let actual = scopes