Expand description
Salsa-based incremental computation layer.
After the mir-analyzer 0.22 migration, semantic analysis (Pass 2, class
issues, references) is owned by AnalysisSession in DocumentStore.
Salsa here is now responsible for the LSP-side compact representations
only: parsed AST cache (parse), per-file declaration index (index),
workspace aggregation (workspace_index). These power cross-file LSP
features (workspace symbols, document symbols, find-implementations, hover
from index) that don’t require the analyzer’s full type system.
Modules§
- index
file_indexsalsa query — derives a compactFileIndexfrom a parsed document. Depends onparsed_doc, so editing a file reparses once and the index re-extracts from the new AST.- mir_
queries - php-lsp salsa queries on mir’s shared database: keyed on mir’s
SourceFileinput and run over&dyn MirDatabase, so they live in the single converged db. The Arc-wrapper types they return (ParsedArc,IndexArc,SymbolMapArc) live inparse.rs/index.rs/symbol_map.rs. - parse
- The
parsed_docsalsa query: parses aSourceFileinto anArc<ParsedDoc>under salsa memoization. Downstream queries (file_index, symbol_map, semantic diagnostics) depend on this one, so each file is parsed at most once per revision. - symbol_
map symbol_mapsalsa query — derives aSymbolMapfrom a parsed document.- workspace_
index workspace_indexsalsa query — aggregates every file’sFileIndexinto a single structure with pre-built reverse maps.