Refactor primary IDE API

This introduces the new type -- Semantics.
Semantics maps SyntaxNodes to various semantic info, such as type,
name resolution or macro expansions.

To do so, Semantics maintains a HashMap which maps every node it saw
to the file from which the node originated. This is enough to get all
the necessary hir bits just from syntax.
This commit is contained in:
Aleksey Kladov 2020-02-18 18:35:10 +01:00
parent 04deae3dba
commit c3a4c4429d
49 changed files with 1026 additions and 978 deletions

View file

@ -26,6 +26,7 @@ macro_rules! impl_froms {
}
}
mod semantics;
pub mod db;
pub mod source_analyzer;
pub mod source_binder;
@ -45,8 +46,8 @@ pub use crate::{
StructField, Trait, Type, TypeAlias, TypeParam, Union, VariantDef,
},
has_source::HasSource,
source_analyzer::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer},
source_binder::SourceBinder,
semantics::{original_range, Semantics, SemanticsScope},
source_analyzer::{PathResolution, ScopeEntryWithSyntax},
};
pub use hir_def::{