pub struct LspConfig {Show 15 fields
pub php_version: Option<String>,
pub exclude_paths: Vec<String>,
pub include_paths: Vec<String>,
pub stub_dirs: Vec<String>,
pub diagnostics: DiagnosticsConfig,
pub features: FeaturesConfig,
pub max_indexed_files: usize,
pub index_vendor: bool,
pub debug: bool,
pub debounce_ms: u64,
pub warm_analysis: bool,
pub warm_vendor_analysis: bool,
pub cache_path: Option<PathBuf>,
pub flush_interval_ms: u64,
pub external_tools: ExternalToolsConfig,
}Expand description
Configuration received from the client via initializationOptions.
Fields§
§php_version: Option<String>PHP version string, e.g. "8.1". Set explicitly via initializationOptions
or auto-detected from composer.json / the php binary at startup.
exclude_paths: Vec<String>Glob patterns for paths to exclude from workspace indexing.
include_paths: Vec<String>Glob patterns for paths that must be indexed even if they match an
excludePaths entry. Patterns are matched against path components
(same semantics as excludePaths). Example: ["vendor/yiisoft"].
stub_dirs: Vec<String>Directories of user-supplied PHP stub files to load in addition to the
bundled built-ins. Each entry is resolved relative to the workspace
root if not already absolute. Every .php file found (recursively) is
registered as a read-only, highest-precedence symbol source — useful
for extensions or frameworks the bundled stubs don’t cover.
diagnostics: DiagnosticsConfigPer-category diagnostic toggles.
features: FeaturesConfigPer-feature capability toggles.
max_indexed_files: usizeHard cap on the number of PHP files indexed during a workspace scan.
Defaults to MAX_INDEXED_FILES. Set lower via initializationOptions
to reduce memory on projects with very large vendor trees.
index_vendor: boolWhether to eagerly index vendor/ during the workspace scan.
Default true: vendor/ is walked and declaration-extracted
(name/namespace/signature, no type inference) alongside the rest of
the workspace, so bare-name completion, workspace symbols, and
find-implementations/type-hierarchy see vendor classes without extra
configuration (issues #240, #246). This scan is I/O-bound, not
CPU-bound, and cheap relative to the fear it usually gets: on real
fixtures the walk+read+parse+extract for ~5k files runs in ~200ms, and
unchanged files replay from the on-disk content-hash cache
(index/cache.rs) on subsequent starts. What eager vendor indexing
does NOT do is pull vendor into the background warm_analysis_sweep
(full type analysis for find-references/rename) — that sweep skips
vendor files unconditionally (see document_store::is_vendor_uri)
since sweeping the whole vendor tree buys nothing lasting (the
analysis-result cache is capped, see ANALYSIS_CACHE_CAP) and would
multiply background CPU cost by vendor’s file count. A vendor file
still gets fully analyzed on demand — when a request touches it
directly, or when it’s referenced by a currently-open file (which the
sweep prioritizes regardless of this flag).
Set false to skip vendor/ entirely on scan (old default): vendor
files then load only on demand via PSR-4 resolution (composer
autoload + per-file parse). Useful for very large vendor trees where
even the cheap declaration scan isn’t worth paying for.
debug: boolEmit extra diagnostic log messages on startup: cache hit/miss ratio,
workspace root paths, and PSR-4 namespace count.
Enable via initializationOptions.debug = true.
debounce_ms: u64Debounce delay in milliseconds between the last textDocument/didChange
and the parse + analysis run. Defaults to 100 ms. Set lower for
fast machines / Neovim users; set higher for slow machines or large
files to reduce thrashing.
warm_analysis: boolBackground-analyze the workspace after indexing (and re-warm after
edits settle) so find-references / rename answer from warm memos
instead of paying a cold per-file analysis at request time. Default
true; set warmAnalysis: false to trade slower references for a
smaller resident footprint.
warm_vendor_analysis: boolExtend the background warm-analysis sweep to vendor/ files (see the
index_vendor docs above for why the ambient sweep skips vendor by
default). Opt-in and throttled/idle-priority once implemented — ships
off by default since it’s new background CPU cost with no prior
production data on real vendor-tree sizes (ROADMAP 0c step 2,
~/.claude/plans/crispy-noodling-key.md). Not implemented yet:
setting this to true is currently a no-op.
cache_path: Option<PathBuf>Override the on-disk cache directory. When set, used verbatim (no
schema-version or workspace-hash subdirectories appended). Primarily
useful in tests and CI environments with non-standard cache locations.
When absent, falls back to the platform default ($XDG_CACHE_HOME /
$HOME/.cache on Unix, %LOCALAPPDATA% on Windows).
flush_interval_ms: u64How often the background loop persists staged analysis-cache postings
(reference postings from an in-progress warm sweep or an on-demand
query freshness pass) to disk. Bounds data loss on an unclean exit
(crash, kill — anything that skips shutdown) to roughly one
interval. Defaults to 20 s; lower mainly useful in tests.
external_tools: ExternalToolsConfigExternal static-analysis tool integration (PHPStan / PHPCS). Both
default off; see ExternalToolsConfig.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LspConfig
impl RefUnwindSafe for LspConfig
impl Send for LspConfig
impl Sync for LspConfig
impl Unpin for LspConfig
impl UnsafeUnpin for LspConfig
impl UnwindSafe for LspConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more