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

@ -35,7 +35,6 @@ mod typing;
mod matching_brace;
mod display;
mod inlay_hints;
mod expand;
mod expand_macro;
mod ssr;
@ -319,9 +318,7 @@ impl Analysis {
file_id: FileId,
max_inlay_hint_length: Option<usize>,
) -> Cancelable<Vec<InlayHint>> {
self.with_db(|db| {
inlay_hints::inlay_hints(db, file_id, &db.parse(file_id).tree(), max_inlay_hint_length)
})
self.with_db(|db| inlay_hints::inlay_hints(db, file_id, max_inlay_hint_length))
}
/// Returns the set of folding ranges.