php_lsp/db/symbol_map.rs
1//! `symbol_map` salsa query — derives a [`SymbolMap`] from a parsed document.
2//!
3//! Depends on `parsed_doc`, so editing a file reparses once and then the symbol
4//! map rebuilds. Between edits all lookups are served from the cache in O(1).
5
6use std::sync::Arc;
7
8use crate::types::symbol_map::SymbolMap;
9
10/// Arc wrapper for [`SymbolMap`]. `symbol_map` is `#[salsa::tracked(no_eq)]`:
11/// every `build` call produces a new `Arc`, so a changed parse always propagates.
12#[derive(Clone)]
13pub struct SymbolMapArc(pub Arc<SymbolMap>);
14
15impl SymbolMapArc {
16 pub fn get(&self) -> &SymbolMap {
17 &self.0
18 }
19}