Skip to main content

Module symbol_map

Module symbol_map 

Source
Expand description

Per-file memoized symbol table.

SymbolMap is a pre-computed HashMap<name, Vec<SymbolEntry>> built from a parsed PHP file in one AST pass. Each entry stores the precise LSP Range of the identifier, the declaration kind, whether it is abstract, a pre-rendered hover signature, and a pre-extracted docblock (as markdown).

Because building the map is O(AST_size) but lookup is O(1), the payoff is on the cross-file / other_docs path: a stable file (one that hasn’t changed since the last keystroke) has its map served from the salsa cache rather than re-walking its AST on every request. See crate::db::symbol_map for the salsa query that drives this.

Structs§

SymbolEntry
A single resolved declaration stored in the pre-computed symbol map.
SymbolMap
Pre-computed symbol table for a single PHP file.

Enums§

SymbolEntryKind
Which kind of PHP declaration this entry represents. Mirrors the variants of [Declaration] so callers can reconstruct any accept predicate without an AST walk.

Functions§

is_abstract_entry
goto_declaration pass 1: abstract/interface declarations.
is_any_entry
goto_declaration pass 2: any declaration except promoted params.
is_definition_entry
goto_definition: skip enum constants (matching original walker).
is_hoverable_kind
Reconstruct the is_hoverable predicate from a stored SymbolEntryKind.