Expand description
§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 everyFileIndex, 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 thanFileIndex.Declaration(resolve::Declaration) — the AST node where a symbol is introduced. Shared by both thegoto_definitionandgoto_declarationLSP requests (which stay distinct — seenavigation/).Docblock— a PHPDoc/** … */comment and the data parsed from it.
§Naming conventions
- verb
index→ingest: ingesting a file into the store isingest*; the nounindex(FileIndex, thefile_indexquery) is always a data structure, never an action. docas a value/variable means aParsedDoc. Docblock-derived data uses theDoctype prefix (DocMethod,DocProperty) or a field nameddocblock. Never name a docblock fielddoc.- 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 wordReference/refsis reserved for a symbol usage in code (seenavigation/references.rs,walk.rs). svis the established local idiom for a borrowedSourceView.
Re-exports§
pub use analysis::semantic_diagnostics;pub use editing::rename;pub use navigation::call_hierarchy;pub use navigation::definition;pub use navigation::implementation;pub use navigation::references;pub use navigation::symbols;
Modules§
- actions
- analysis
- ast
- Core AST infrastructure: arena-backed
ParsedDoc, span utilities, and TypeHint formatting. - backend
- completion
- config
- db
- Salsa-based incremental computation layer.
- document_
store - editing
- file_
index - hover
- navigation
- symbol_
map - Per-file memoized symbol table.
- type_
map
Macros§
- impl_
arc_ update - Implement the
salsa::Updatetrait for Arc-wrapped types using pointer equality. This reduces boilerplate for types that wrap a single Arc field and should only invalidate when the pointer changes (not the contents).