fix hir for new block syntax

This commit is contained in:
Aleksey Kladov 2019-09-02 21:23:19 +03:00
parent dcf8e89503
commit 5e3f291195
14 changed files with 72 additions and 57 deletions

View file

@ -172,7 +172,7 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope
#[cfg(test)]
mod tests {
use ra_db::SourceDatabase;
use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNodePtr};
use ra_syntax::{algo::find_node_at_offset, ast, AstNode};
use test_utils::{assert_eq_text, extract_offset};
use crate::{mock::MockDatabase, source_binder::SourceAnalyzer};
@ -194,8 +194,7 @@ mod tests {
let analyzer = SourceAnalyzer::new(&db, file_id, marker.syntax(), None);
let scopes = analyzer.scopes();
let expr_id =
analyzer.body_source_map().syntax_expr(SyntaxNodePtr::new(marker.syntax())).unwrap();
let expr_id = analyzer.body_source_map().node_expr(&marker.into()).unwrap();
let scope = scopes.scope_for(expr_id);
let actual = scopes