diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-23 15:01:06 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-23 15:01:06 +0100 |
commit | a832a2f7dd22c93bc69a7be5d24799bb042b8129 (patch) | |
tree | 15f55b3eab48c3d0bbb1975fbd4db7cbb56d3e3e /crates/ra_ide_api/src/name_ref_kind.rs | |
parent | c12dce0073c1766f7d2b10a69f8526a8093e70dc (diff) | |
parent | 5b18a4eef9e69260ce2f105b33553c929cb7d827 (diff) |
Merge #1731
1731: rename pos_field -> tuple_field r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/name_ref_kind.rs')
-rw-r--r-- | crates/ra_ide_api/src/name_ref_kind.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/name_ref_kind.rs b/crates/ra_ide_api/src/name_ref_kind.rs index f7db6c826..34a8bcc36 100644 --- a/crates/ra_ide_api/src/name_ref_kind.rs +++ b/crates/ra_ide_api/src/name_ref_kind.rs | |||
@@ -54,12 +54,12 @@ pub(crate) fn classify_name_ref( | |||
54 | } | 54 | } |
55 | 55 | ||
56 | // It could also be a named field | 56 | // It could also be a named field |
57 | if let Some(field_expr) = name_ref.syntax().parent().and_then(ast::NamedField::cast) { | 57 | if let Some(field_expr) = name_ref.syntax().parent().and_then(ast::RecordField::cast) { |
58 | tested_by!(goto_definition_works_for_named_fields); | 58 | tested_by!(goto_definition_works_for_record_fields); |
59 | 59 | ||
60 | let struct_lit = field_expr.syntax().ancestors().find_map(ast::StructLit::cast); | 60 | let record_lit = field_expr.syntax().ancestors().find_map(ast::RecordLit::cast); |
61 | 61 | ||
62 | if let Some(ty) = struct_lit.and_then(|lit| analyzer.type_of(db, &lit.into())) { | 62 | if let Some(ty) = record_lit.and_then(|lit| analyzer.type_of(db, &lit.into())) { |
63 | if let Some((hir::AdtDef::Struct(s), _)) = ty.as_adt() { | 63 | if let Some((hir::AdtDef::Struct(s), _)) = ty.as_adt() { |
64 | let hir_path = hir::Path::from_name_ref(name_ref); | 64 | let hir_path = hir::Path::from_name_ref(name_ref); |
65 | let hir_name = hir_path.as_ident().unwrap(); | 65 | let hir_name = hir_path.as_ident().unwrap(); |