diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/has_source.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/semantics/source_to_def.rs | 16 |
3 files changed, 17 insertions, 17 deletions
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 88399f724..9581552e5 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs | |||
@@ -75,8 +75,8 @@ impl HasSource for Enum { | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | impl HasSource for EnumVariant { | 77 | impl HasSource for EnumVariant { |
78 | type Ast = ast::EnumVariant; | 78 | type Ast = ast::Variant; |
79 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::EnumVariant> { | 79 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::Variant> { |
80 | self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone()) | 80 | self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone()) |
81 | } | 81 | } |
82 | } | 82 | } |
@@ -87,14 +87,14 @@ impl HasSource for Function { | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | impl HasSource for Const { | 89 | impl HasSource for Const { |
90 | type Ast = ast::ConstDef; | 90 | type Ast = ast::Const; |
91 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::ConstDef> { | 91 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::Const> { |
92 | self.id.lookup(db.upcast()).source(db.upcast()) | 92 | self.id.lookup(db.upcast()).source(db.upcast()) |
93 | } | 93 | } |
94 | } | 94 | } |
95 | impl HasSource for Static { | 95 | impl HasSource for Static { |
96 | type Ast = ast::StaticDef; | 96 | type Ast = ast::Static; |
97 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::StaticDef> { | 97 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::Static> { |
98 | self.id.lookup(db.upcast()).source(db.upcast()) | 98 | self.id.lookup(db.upcast()).source(db.upcast()) |
99 | } | 99 | } |
100 | } | 100 | } |
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index f8e70fe27..32a60b789 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -586,12 +586,12 @@ to_def_impls![ | |||
586 | (crate::Trait, ast::TraitDef, trait_to_def), | 586 | (crate::Trait, ast::TraitDef, trait_to_def), |
587 | (crate::ImplDef, ast::ImplDef, impl_to_def), | 587 | (crate::ImplDef, ast::ImplDef, impl_to_def), |
588 | (crate::TypeAlias, ast::TypeAlias, type_alias_to_def), | 588 | (crate::TypeAlias, ast::TypeAlias, type_alias_to_def), |
589 | (crate::Const, ast::ConstDef, const_to_def), | 589 | (crate::Const, ast::Const, const_to_def), |
590 | (crate::Static, ast::StaticDef, static_to_def), | 590 | (crate::Static, ast::Static, static_to_def), |
591 | (crate::Function, ast::Fn, fn_to_def), | 591 | (crate::Function, ast::Fn, fn_to_def), |
592 | (crate::Field, ast::RecordField, record_field_to_def), | 592 | (crate::Field, ast::RecordField, record_field_to_def), |
593 | (crate::Field, ast::TupleField, tuple_field_to_def), | 593 | (crate::Field, ast::TupleField, tuple_field_to_def), |
594 | (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def), | 594 | (crate::EnumVariant, ast::Variant, enum_variant_to_def), |
595 | (crate::TypeParam, ast::TypeParam, type_param_to_def), | 595 | (crate::TypeParam, ast::TypeParam, type_param_to_def), |
596 | (crate::MacroDef, ast::MacroCall, macro_call_to_def), // this one is dubious, not all calls are macros | 596 | (crate::MacroDef, ast::MacroCall, macro_call_to_def), // this one is dubious, not all calls are macros |
597 | (crate::Local, ast::BindPat, bind_pat_to_def), | 597 | (crate::Local, ast::BindPat, bind_pat_to_def), |
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 9f81b952f..782a03f9e 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs | |||
@@ -83,10 +83,10 @@ impl SourceToDefCtx<'_, '_> { | |||
83 | pub(super) fn union_to_def(&mut self, src: InFile<ast::Union>) -> Option<UnionId> { | 83 | pub(super) fn union_to_def(&mut self, src: InFile<ast::Union>) -> Option<UnionId> { |
84 | self.to_def(src, keys::UNION) | 84 | self.to_def(src, keys::UNION) |
85 | } | 85 | } |
86 | pub(super) fn static_to_def(&mut self, src: InFile<ast::StaticDef>) -> Option<StaticId> { | 86 | pub(super) fn static_to_def(&mut self, src: InFile<ast::Static>) -> Option<StaticId> { |
87 | self.to_def(src, keys::STATIC) | 87 | self.to_def(src, keys::STATIC) |
88 | } | 88 | } |
89 | pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> { | 89 | pub(super) fn const_to_def(&mut self, src: InFile<ast::Const>) -> Option<ConstId> { |
90 | self.to_def(src, keys::CONST) | 90 | self.to_def(src, keys::CONST) |
91 | } | 91 | } |
92 | pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> { | 92 | pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> { |
@@ -100,9 +100,9 @@ impl SourceToDefCtx<'_, '_> { | |||
100 | } | 100 | } |
101 | pub(super) fn enum_variant_to_def( | 101 | pub(super) fn enum_variant_to_def( |
102 | &mut self, | 102 | &mut self, |
103 | src: InFile<ast::EnumVariant>, | 103 | src: InFile<ast::Variant>, |
104 | ) -> Option<EnumVariantId> { | 104 | ) -> Option<EnumVariantId> { |
105 | self.to_def(src, keys::ENUM_VARIANT) | 105 | self.to_def(src, keys::VARIANT) |
106 | } | 106 | } |
107 | pub(super) fn bind_pat_to_def( | 107 | pub(super) fn bind_pat_to_def( |
108 | &mut self, | 108 | &mut self, |
@@ -178,11 +178,11 @@ impl SourceToDefCtx<'_, '_> { | |||
178 | let def = self.union_to_def(container.with_value(it))?; | 178 | let def = self.union_to_def(container.with_value(it))?; |
179 | VariantId::from(def).into() | 179 | VariantId::from(def).into() |
180 | }, | 180 | }, |
181 | ast::StaticDef(it) => { | 181 | ast::Static(it) => { |
182 | let def = self.static_to_def(container.with_value(it))?; | 182 | let def = self.static_to_def(container.with_value(it))?; |
183 | DefWithBodyId::from(def).into() | 183 | DefWithBodyId::from(def).into() |
184 | }, | 184 | }, |
185 | ast::ConstDef(it) => { | 185 | ast::Const(it) => { |
186 | let def = self.const_to_def(container.with_value(it))?; | 186 | let def = self.const_to_def(container.with_value(it))?; |
187 | DefWithBodyId::from(def).into() | 187 | DefWithBodyId::from(def).into() |
188 | }, | 188 | }, |
@@ -222,8 +222,8 @@ impl SourceToDefCtx<'_, '_> { | |||
222 | for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { | 222 | for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { |
223 | let res: DefWithBodyId = match_ast! { | 223 | let res: DefWithBodyId = match_ast! { |
224 | match (container.value) { | 224 | match (container.value) { |
225 | ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), | 225 | ast::Const(it) => self.const_to_def(container.with_value(it))?.into(), |
226 | ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), | 226 | ast::Static(it) => self.static_to_def(container.with_value(it))?.into(), |
227 | ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), | 227 | ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), |
228 | _ => continue, | 228 | _ => continue, |
229 | } | 229 | } |