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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! # php-lsp — domain vocabulary
//!
//! The terms below have one canonical meaning across the crate. Use them
//! consistently; do not introduce synonyms.
//!
//! ## Core nouns
//! - **`ParsedDoc`** — a fully parsed source file: AST program + source text +
//! line table, backed by a bumpalo arena. The unit a user has open.
//! - **`FileIndex`** — the compact (~2 KB) serializable per-file *declaration
//! summary* used for background-indexed (unopened) files.
//! - **`WorkspaceIndex`** (`WorkspaceIndexData`) — the aggregated cross-file
//! index over every `FileIndex`, with name→location reverse maps.
//! - **`Workspace`** — the salsa input representing the project root / file set.
//! (There is intentionally no "Codebase" type — it would be a synonym.)
//! - **`SymbolMap` / `SymbolEntry`** — per-file precomputed name→declarations
//! table for *open* files; richer than `FileIndex`.
//! - **`Declaration`** (`resolve::Declaration`) — the AST node where a symbol is
//! *introduced*. Shared by both the `goto_definition` and `goto_declaration`
//! LSP requests (which stay distinct — see `navigation/`).
//! - **`Docblock`** — a PHPDoc `/** … */` comment and the data parsed from it.
//!
//! ## Naming conventions
//! - **verb `index` → `ingest`**: ingesting a file into the store is `ingest*`;
//! the noun `index` (`FileIndex`, the `file_index` query) is always a data
//! structure, never an action.
//! - **`doc`** as a value/variable means a `ParsedDoc`. Docblock-derived data
//! uses the **`Doc`** type prefix (`DocMethod`, `DocProperty`) or a field
//! named `docblock`. Never name a docblock field `doc`.
//! - **Type suffixes**: `-Def` = an owned declaration record stored in an index
//! (`FunctionDef`, `ClassDef`); `-Entry` = a row returned from a name-keyed
//! map (`SymbolEntry`); `-Ref` = an internal back-pointer/handle into an index
//! (`ClassRef`, `DeclRef`) — **not** an LSP reference. The spelled-out word
//! `Reference`/`refs` is reserved for a symbol *usage* in code (see
//! `navigation/references.rs`, `walk.rs`).
//! - **`sv`** is the established local idiom for a borrowed `SourceView`.
// Private items in the modules below are only reachable through main.rs/backend.rs,
// not through this lib entry point, so rustc would flag them as dead. Pub items in
// a lib crate are never subject to dead_code, so only genuinely-internal items are
// suppressed — real dead code within public API surfaces will still be caught.
// ── Core concern modules ────────────────────────────────────────────────────
// document lifecycle: parsed AST, salsa store, open-file state
// workspace indexing: compact FileIndex, background scan, cache
// PHP-language model: config, autoload, phpstorm_meta, docblock, php_names
// generic text mechanics: offset, word, fuzzy, range
// type resolution & symbol lookup: type_map, type_query, resolve, symbol_map, stub_members
// ── LSP feature capabilities ─────────────────────────────────────────────────
// ── Salsa query layer ────────────────────────────────────────────────────────
// ── Server entry point & cross-cutting infrastructure ────────────────────────
// Re-exports for benchmark crates that use the flat `php_lsp::X` paths.
pub use semantic_diagnostics;
pub use ast;
pub use document_store;
pub use rename;
pub use file_index;
pub use config;
pub use call_hierarchy;
pub use definition;
pub use implementation;
pub use references;
pub use symbols;
pub use symbol_map;
pub use type_map;