pub struct LspConfig {
pub php_version: Option<String>,
pub exclude_paths: Vec<String>,
pub include_paths: 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 cache_path: Option<PathBuf>,
pub flush_interval_ms: u64,
}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"].
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 false: vendor/ is skipped on scan; vendor files load on
demand via PSR-4 resolution (composer autoload + per-file parse). This
keeps $/php-lsp/indexReady fast on real-world projects where vendor
dwarfs the workspace.
Set true for full workspace-symbol coverage of vendor and find-
implementations / type-hierarchy against vendor types — at the cost of
a slower initial scan.
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.
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.
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