diff options
Diffstat (limited to 'crates/ra_hir/src/semantics.rs')
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 7ce785791..965d185a4 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -20,10 +20,23 @@ use crate::{ | |||
20 | db::HirDatabase, | 20 | db::HirDatabase, |
21 | semantics::source_to_def::{ChildContainer, SourceToDefCache, SourceToDefCtx}, | 21 | semantics::source_to_def::{ChildContainer, SourceToDefCache, SourceToDefCtx}, |
22 | source_analyzer::{resolve_hir_path, SourceAnalyzer}, | 22 | source_analyzer::{resolve_hir_path, SourceAnalyzer}, |
23 | Function, HirFileId, InFile, Local, MacroDef, Module, ModuleDef, Name, Origin, Path, | 23 | AssocItem, Function, HirFileId, ImplDef, InFile, Local, MacroDef, Module, ModuleDef, Name, |
24 | PathResolution, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef, | 24 | Origin, Path, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #[derive(Debug, Clone, PartialEq, Eq)] | ||
28 | pub enum PathResolution { | ||
29 | /// An item | ||
30 | Def(ModuleDef), | ||
31 | /// A local binding (only value namespace) | ||
32 | Local(Local), | ||
33 | /// A generic parameter | ||
34 | TypeParam(TypeParam), | ||
35 | SelfType(ImplDef), | ||
36 | Macro(MacroDef), | ||
37 | AssocItem(AssocItem), | ||
38 | } | ||
39 | |||
27 | /// Primary API to get semantic information, like types, from syntax trees. | 40 | /// Primary API to get semantic information, like types, from syntax trees. |
28 | pub struct Semantics<'db, DB> { | 41 | pub struct Semantics<'db, DB> { |
29 | pub db: &'db DB, | 42 | pub db: &'db DB, |