diff options
Diffstat (limited to 'crates/ra_ide_api/src/goto_definition.rs')
-rw-r--r-- | crates/ra_ide_api/src/goto_definition.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 6fa430754..9957a5393 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs | |||
@@ -54,7 +54,7 @@ pub(crate) fn reference_definition( | |||
54 | if let Some(method_call) = name_ref.syntax().parent().and_then(ast::MethodCallExpr::cast) { | 54 | if let Some(method_call) = name_ref.syntax().parent().and_then(ast::MethodCallExpr::cast) { |
55 | tested_by!(goto_definition_works_for_methods); | 55 | tested_by!(goto_definition_works_for_methods); |
56 | let infer_result = function.infer(db); | 56 | let infer_result = function.infer(db); |
57 | let syntax_mapping = function.body_syntax_mapping(db); | 57 | let syntax_mapping = function.body_source_map(db); |
58 | let expr = ast::Expr::cast(method_call.syntax()).unwrap(); | 58 | let expr = ast::Expr::cast(method_call.syntax()).unwrap(); |
59 | if let Some(func) = | 59 | if let Some(func) = |
60 | syntax_mapping.node_expr(expr).and_then(|it| infer_result.method_resolution(it)) | 60 | syntax_mapping.node_expr(expr).and_then(|it| infer_result.method_resolution(it)) |
@@ -66,7 +66,7 @@ pub(crate) fn reference_definition( | |||
66 | if let Some(field_expr) = name_ref.syntax().parent().and_then(ast::FieldExpr::cast) { | 66 | if let Some(field_expr) = name_ref.syntax().parent().and_then(ast::FieldExpr::cast) { |
67 | tested_by!(goto_definition_works_for_fields); | 67 | tested_by!(goto_definition_works_for_fields); |
68 | let infer_result = function.infer(db); | 68 | let infer_result = function.infer(db); |
69 | let syntax_mapping = function.body_syntax_mapping(db); | 69 | let syntax_mapping = function.body_source_map(db); |
70 | let expr = ast::Expr::cast(field_expr.syntax()).unwrap(); | 70 | let expr = ast::Expr::cast(field_expr.syntax()).unwrap(); |
71 | if let Some(field) = | 71 | if let Some(field) = |
72 | syntax_mapping.node_expr(expr).and_then(|it| infer_result.field_resolution(it)) | 72 | syntax_mapping.node_expr(expr).and_then(|it| infer_result.field_resolution(it)) |
@@ -80,7 +80,7 @@ pub(crate) fn reference_definition( | |||
80 | tested_by!(goto_definition_works_for_named_fields); | 80 | tested_by!(goto_definition_works_for_named_fields); |
81 | 81 | ||
82 | let infer_result = function.infer(db); | 82 | let infer_result = function.infer(db); |
83 | let syntax_mapping = function.body_syntax_mapping(db); | 83 | let syntax_mapping = function.body_source_map(db); |
84 | 84 | ||
85 | let struct_lit = field_expr.syntax().ancestors().find_map(ast::StructLit::cast); | 85 | let struct_lit = field_expr.syntax().ancestors().find_map(ast::StructLit::cast); |
86 | 86 | ||