diff options
author | Aleksey Kladov <[email protected]> | 2019-03-02 12:14:37 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-03-02 12:40:40 +0000 |
commit | eaf1df26e9903772d40df30dd70c75c38d8cb887 (patch) | |
tree | 4e7a6f4bb15caf4e134305ab1c4ba749e9e1d5b0 /crates/ra_hir/src/ty/tests.rs | |
parent | 592b906604d60a86af74c5dbb3bf40b2ddcf8061 (diff) |
rename syntax-mapping -> source-map
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 8de46a29e..2fdfb54f4 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -1045,11 +1045,11 @@ fn test() { | |||
1045 | 1045 | ||
1046 | fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { | 1046 | fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { |
1047 | let func = source_binder::function_from_position(db, pos).unwrap(); | 1047 | let func = source_binder::function_from_position(db, pos).unwrap(); |
1048 | let body_syntax_mapping = func.body_syntax_mapping(db); | 1048 | let body_source_map = func.body_source_map(db); |
1049 | let inference_result = func.infer(db); | 1049 | let inference_result = func.infer(db); |
1050 | let (_, syntax) = func.source(db); | 1050 | let (_, syntax) = func.source(db); |
1051 | let node = algo::find_node_at_offset::<ast::Expr>(syntax.syntax(), pos.offset).unwrap(); | 1051 | let node = algo::find_node_at_offset::<ast::Expr>(syntax.syntax(), pos.offset).unwrap(); |
1052 | let expr = body_syntax_mapping.node_expr(node).unwrap(); | 1052 | let expr = body_source_map.node_expr(node).unwrap(); |
1053 | let ty = &inference_result[expr]; | 1053 | let ty = &inference_result[expr]; |
1054 | ty.to_string() | 1054 | ty.to_string() |
1055 | } | 1055 | } |
@@ -1061,17 +1061,17 @@ fn infer(content: &str) -> String { | |||
1061 | for fn_def in source_file.syntax().descendants().filter_map(ast::FnDef::cast) { | 1061 | for fn_def in source_file.syntax().descendants().filter_map(ast::FnDef::cast) { |
1062 | let func = source_binder::function_from_source(&db, file_id, fn_def).unwrap(); | 1062 | let func = source_binder::function_from_source(&db, file_id, fn_def).unwrap(); |
1063 | let inference_result = func.infer(&db); | 1063 | let inference_result = func.infer(&db); |
1064 | let body_syntax_mapping = func.body_syntax_mapping(&db); | 1064 | let body_source_map = func.body_source_map(&db); |
1065 | let mut types = Vec::new(); | 1065 | let mut types = Vec::new(); |
1066 | for (pat, ty) in inference_result.type_of_pat.iter() { | 1066 | for (pat, ty) in inference_result.type_of_pat.iter() { |
1067 | let syntax_ptr = match body_syntax_mapping.pat_syntax(pat) { | 1067 | let syntax_ptr = match body_source_map.pat_syntax(pat) { |
1068 | Some(sp) => sp, | 1068 | Some(sp) => sp, |
1069 | None => continue, | 1069 | None => continue, |
1070 | }; | 1070 | }; |
1071 | types.push((syntax_ptr, ty)); | 1071 | types.push((syntax_ptr, ty)); |
1072 | } | 1072 | } |
1073 | for (expr, ty) in inference_result.type_of_expr.iter() { | 1073 | for (expr, ty) in inference_result.type_of_expr.iter() { |
1074 | let syntax_ptr = match body_syntax_mapping.expr_syntax(expr) { | 1074 | let syntax_ptr = match body_source_map.expr_syntax(expr) { |
1075 | Some(sp) => sp, | 1075 | Some(sp) => sp, |
1076 | None => continue, | 1076 | None => continue, |
1077 | }; | 1077 | }; |