1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Salsa inputs.
use Arc;
use PhpVersion;
use StubSlice;
/// Opaque file identifier used as a stable key for a source file across edits.
/// Backend will map `Url` <-> `FileId`; salsa queries key on `SourceFile` which
/// wraps this id plus the current text.
;
/// Per-file salsa input. A new revision is observed whenever `text` is set.
///
/// `uri` is the LSP document URI as a string (e.g. `file:///path/Foo.php`).
/// It lives on the input so that tracked queries like `file_refs` can emit
/// per-symbol location records keyed by URI without needing a separate
/// FileId→URI map outside salsa.
///
/// `cached_slice` (Phase K2): when `Some`, holds a pre-computed `StubSlice`
/// loaded from the on-disk cache. `file_definitions` checks this field
/// first and returns the cached slice instead of parsing + running
/// `DefinitionCollector`. Cleared back to `None` on any text edit — see
/// `DocumentStore::mirror_text` — so a stale cached slice cannot mask a
/// real change. Seeded by workspace scan via
/// `DocumentStore::seed_cached_slice` before the first `file_definitions`
/// call for that file.
/// Workspace-level input: the set of files that participate in whole-program
/// analyses (codebase, references). Updated by the backend when files are
/// discovered (workspace scan, did_open on previously-unseen file) or removed
/// (watched-files delete).
///
/// Uses `durability = HIGH` conceptually — the file list changes rarely
/// (workspace scan, deletions), not on every edit. Salsa's default durability
/// is LOW; backend can opt into HIGH via `set_files` if churn becomes an issue.