diff options
author | Aleksey Kladov <[email protected]> | 2020-02-29 17:35:45 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-29 17:35:45 +0000 |
commit | 7f09083c6ff3cb3499b140ffe85f83a06f685aed (patch) | |
tree | c6ee7fbbfca890fbbd8e26e1f98e11b6d49492e6 /crates/ra_hir/src/semantics | |
parent | 14ea21617ab510daa4f88b0f7c93fdfd2d36e42d (diff) |
Handle tuple fields as well
Diffstat (limited to 'crates/ra_hir/src/semantics')
-rw-r--r-- | crates/ra_hir/src/semantics/source_to_def.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 303610dc4..884b535b2 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs | |||
@@ -94,13 +94,18 @@ impl<DB: HirDatabase> SourceToDefCtx<'_, &'_ DB> { | |||
94 | ) -> Option<TypeAliasId> { | 94 | ) -> Option<TypeAliasId> { |
95 | self.to_def(src, keys::TYPE_ALIAS) | 95 | self.to_def(src, keys::TYPE_ALIAS) |
96 | } | 96 | } |
97 | //TODO: tuple field | ||
98 | pub(super) fn record_field_to_def( | 97 | pub(super) fn record_field_to_def( |
99 | &mut self, | 98 | &mut self, |
100 | src: InFile<ast::RecordFieldDef>, | 99 | src: InFile<ast::RecordFieldDef>, |
101 | ) -> Option<StructFieldId> { | 100 | ) -> Option<StructFieldId> { |
102 | self.to_def(src, keys::RECORD_FIELD) | 101 | self.to_def(src, keys::RECORD_FIELD) |
103 | } | 102 | } |
103 | pub(super) fn tuple_field_to_def( | ||
104 | &mut self, | ||
105 | src: InFile<ast::TupleFieldDef>, | ||
106 | ) -> Option<StructFieldId> { | ||
107 | self.to_def(src, keys::TUPLE_FIELD) | ||
108 | } | ||
104 | pub(super) fn enum_variant_to_def( | 109 | pub(super) fn enum_variant_to_def( |
105 | &mut self, | 110 | &mut self, |
106 | src: InFile<ast::EnumVariant>, | 111 | src: InFile<ast::EnumVariant>, |