Skip to main content

LspConfig

Struct LspConfig 

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

§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.

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