diff options
Diffstat (limited to 'crates/hir/src/source_analyzer.rs')
-rw-r--r-- | crates/hir/src/source_analyzer.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index bf0c959fe..bddc49c05 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs | |||
@@ -28,8 +28,8 @@ use syntax::{ | |||
28 | }; | 28 | }; |
29 | 29 | ||
30 | use crate::{ | 30 | use crate::{ |
31 | db::HirDatabase, semantics::PathResolution, Adt, Const, EnumVariant, Field, Function, Local, | 31 | db::HirDatabase, semantics::PathResolution, Adt, Const, Field, Function, Local, MacroDef, |
32 | MacroDef, ModuleDef, Static, Struct, Trait, Type, TypeAlias, TypeParam, | 32 | ModuleDef, Static, Struct, Trait, Type, TypeAlias, TypeParam, Variant, |
33 | }; | 33 | }; |
34 | use base_db::CrateId; | 34 | use base_db::CrateId; |
35 | 35 | ||
@@ -230,7 +230,7 @@ impl SourceAnalyzer { | |||
230 | if let Some(VariantId::EnumVariantId(variant)) = | 230 | if let Some(VariantId::EnumVariantId(variant)) = |
231 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) | 231 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) |
232 | { | 232 | { |
233 | return Some(PathResolution::Def(ModuleDef::EnumVariant(variant.into()))); | 233 | return Some(PathResolution::Def(ModuleDef::Variant(variant.into()))); |
234 | } | 234 | } |
235 | } | 235 | } |
236 | 236 | ||
@@ -242,7 +242,7 @@ impl SourceAnalyzer { | |||
242 | if let Some(VariantId::EnumVariantId(variant)) = | 242 | if let Some(VariantId::EnumVariantId(variant)) = |
243 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) | 243 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) |
244 | { | 244 | { |
245 | return Some(PathResolution::Def(ModuleDef::EnumVariant(variant.into()))); | 245 | return Some(PathResolution::Def(ModuleDef::Variant(variant.into()))); |
246 | } | 246 | } |
247 | } | 247 | } |
248 | 248 | ||
@@ -251,7 +251,7 @@ impl SourceAnalyzer { | |||
251 | if let Some(VariantId::EnumVariantId(variant)) = | 251 | if let Some(VariantId::EnumVariantId(variant)) = |
252 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) | 252 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) |
253 | { | 253 | { |
254 | return Some(PathResolution::Def(ModuleDef::EnumVariant(variant.into()))); | 254 | return Some(PathResolution::Def(ModuleDef::Variant(variant.into()))); |
255 | } | 255 | } |
256 | } | 256 | } |
257 | 257 | ||
@@ -260,7 +260,7 @@ impl SourceAnalyzer { | |||
260 | if let Some(VariantId::EnumVariantId(variant)) = | 260 | if let Some(VariantId::EnumVariantId(variant)) = |
261 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) | 261 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) |
262 | { | 262 | { |
263 | return Some(PathResolution::Def(ModuleDef::EnumVariant(variant.into()))); | 263 | return Some(PathResolution::Def(ModuleDef::Variant(variant.into()))); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
@@ -459,7 +459,7 @@ pub(crate) fn resolve_hir_path( | |||
459 | TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => { | 459 | TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => { |
460 | PathResolution::Def(Adt::from(it).into()) | 460 | PathResolution::Def(Adt::from(it).into()) |
461 | } | 461 | } |
462 | TypeNs::EnumVariantId(it) => PathResolution::Def(EnumVariant::from(it).into()), | 462 | TypeNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()), |
463 | TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), | 463 | TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), |
464 | TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), | 464 | TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), |
465 | TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), | 465 | TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), |
@@ -477,7 +477,7 @@ pub(crate) fn resolve_hir_path( | |||
477 | ValueNs::ConstId(it) => PathResolution::Def(Const::from(it).into()), | 477 | ValueNs::ConstId(it) => PathResolution::Def(Const::from(it).into()), |
478 | ValueNs::StaticId(it) => PathResolution::Def(Static::from(it).into()), | 478 | ValueNs::StaticId(it) => PathResolution::Def(Static::from(it).into()), |
479 | ValueNs::StructId(it) => PathResolution::Def(Struct::from(it).into()), | 479 | ValueNs::StructId(it) => PathResolution::Def(Struct::from(it).into()), |
480 | ValueNs::EnumVariantId(it) => PathResolution::Def(EnumVariant::from(it).into()), | 480 | ValueNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()), |
481 | ValueNs::ImplSelf(impl_id) => PathResolution::SelfType(impl_id.into()), | 481 | ValueNs::ImplSelf(impl_id) => PathResolution::SelfType(impl_id.into()), |
482 | }; | 482 | }; |
483 | Some(res) | 483 | Some(res) |
@@ -526,7 +526,7 @@ fn resolve_hir_path_qualifier( | |||
526 | TypeNs::SelfType(it) => PathResolution::SelfType(it.into()), | 526 | TypeNs::SelfType(it) => PathResolution::SelfType(it.into()), |
527 | TypeNs::GenericParam(id) => PathResolution::TypeParam(TypeParam { id }), | 527 | TypeNs::GenericParam(id) => PathResolution::TypeParam(TypeParam { id }), |
528 | TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => PathResolution::Def(Adt::from(it).into()), | 528 | TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => PathResolution::Def(Adt::from(it).into()), |
529 | TypeNs::EnumVariantId(it) => PathResolution::Def(EnumVariant::from(it).into()), | 529 | TypeNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()), |
530 | TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), | 530 | TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), |
531 | TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), | 531 | TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), |
532 | TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), | 532 | TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), |