LspServerConfig

Struct LspServerConfig 

Source
pub struct LspServerConfig {
Show 14 fields pub command: String, pub args: Vec<String>, pub working_directory: Option<PathBuf>, pub environment: HashMap<String, String>, pub root_path: Option<PathBuf>, pub workspace_folders: Vec<PathBuf>, pub initialization_options: Option<Value>, pub client_capabilities: LspClientCapabilities, pub startup_timeout: Duration, pub request_timeout: Duration, pub trace: TraceLevel, pub settings: HashMap<String, Value>, pub max_restart_attempts: u32, pub restart_delay: Duration,
}
Expand description

Configuration for an LSP server instance.

Fields§

§command: String

Command to execute the LSP server

§args: Vec<String>

Arguments to pass to the server command

§working_directory: Option<PathBuf>

Working directory for the server process

§environment: HashMap<String, String>

Environment variables for the server process

§root_path: Option<PathBuf>

Root path/URI for the workspace

§workspace_folders: Vec<PathBuf>

Workspace folders

§initialization_options: Option<Value>

Initialization options to send to the server

§client_capabilities: LspClientCapabilities

Client capabilities to advertise

§startup_timeout: Duration

Server startup timeout

§request_timeout: Duration

Request timeout

§trace: TraceLevel

Whether to enable tracing

§settings: HashMap<String, Value>

Custom server settings

§max_restart_attempts: u32

Maximum number of restart attempts

§restart_delay: Duration

Restart delay between attempts

Implementations§

Source§

impl LspServerConfig

Source

pub fn new() -> Self

Create a new server configuration

Source

pub fn command<S: Into<String>>(self, command: S) -> Self

Set the server command

Source

pub fn args<I, S>(self, args: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Add arguments to the server command

Source

pub fn arg<S: Into<String>>(self, arg: S) -> Self

Add a single argument to the server command

Source

pub fn working_directory<P: AsRef<Path>>(self, path: P) -> Self

Set the working directory

Source

pub fn env<K, V>(self, key: K, value: V) -> Self
where K: Into<String>, V: Into<String>,

Add an environment variable

Source

pub fn envs<I, K, V>(self, vars: I) -> Self
where I: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Set multiple environment variables

Source

pub fn root_path<P: AsRef<Path>>(self, path: P) -> Self

Set the root path

Source

pub fn workspace_folders<I, P>(self, folders: I) -> Self
where I: IntoIterator<Item = P>, P: AsRef<Path>,

Add workspace folders

Source

pub fn workspace_folder<P: AsRef<Path>>(self, folder: P) -> Self

Add a single workspace folder

Source

pub fn initialization_options(self, options: Value) -> Self

Set initialization options

Source

pub fn client_capabilities(self, capabilities: LspClientCapabilities) -> Self

Set client capabilities

Source

pub fn startup_timeout(self, timeout: Duration) -> Self

Set startup timeout

Source

pub fn request_timeout(self, timeout: Duration) -> Self

Set request timeout

Source

pub fn trace(self, level: TraceLevel) -> Self

Set trace level

Source

pub fn setting<K, V>(self, key: K, value: V) -> Self
where K: Into<String>, V: Serialize,

Add a server setting

Source

pub fn max_restart_attempts(self, attempts: u32) -> Self

Set maximum restart attempts

Source

pub fn restart_delay(self, delay: Duration) -> Self

Set restart delay

Source

pub fn validate(&self) -> Result<()>

Validate the configuration

Trait Implementations§

Source§

impl Clone for LspServerConfig

Source§

fn clone(&self) -> LspServerConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for LspServerConfig

Source§

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

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

impl Default for LspServerConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for LspServerConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for LspServerConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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<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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,