Skip to main content

LspConfig

Struct LspConfig 

Source
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: DiagnosticsConfig

Per-category diagnostic toggles.

§features: FeaturesConfig

Per-feature capability toggles.

§max_indexed_files: usize

Hard 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: bool

Whether 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: bool

Emit 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: u64

Debounce 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: bool

Background-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: bool

Extend 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: u64

How 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: ExternalToolsConfig

External static-analysis tool integration (PHPStan / PHPCS). Both default off; see ExternalToolsConfig.

Trait Implementations§

Source§

impl Clone for LspConfig

Source§

fn clone(&self) -> LspConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LspConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LspConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Lookup<T> for T

Source§

fn into_owned(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more