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: StringCommand 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: LspClientCapabilitiesClient capabilities to advertise
startup_timeout: DurationServer startup timeout
request_timeout: DurationRequest timeout
trace: TraceLevelWhether to enable tracing
settings: HashMap<String, Value>Custom server settings
max_restart_attempts: u32Maximum number of restart attempts
restart_delay: DurationRestart delay between attempts
Implementations§
Source§impl LspServerConfig
impl LspServerConfig
Sourcepub fn working_directory<P: AsRef<Path>>(self, path: P) -> Self
pub fn working_directory<P: AsRef<Path>>(self, path: P) -> Self
Set the working directory
Sourcepub fn workspace_folders<I, P>(self, folders: I) -> Self
pub fn workspace_folders<I, P>(self, folders: I) -> Self
Add workspace folders
Sourcepub fn workspace_folder<P: AsRef<Path>>(self, folder: P) -> Self
pub fn workspace_folder<P: AsRef<Path>>(self, folder: P) -> Self
Add a single workspace folder
Sourcepub fn initialization_options(self, options: Value) -> Self
pub fn initialization_options(self, options: Value) -> Self
Set initialization options
Sourcepub fn client_capabilities(self, capabilities: LspClientCapabilities) -> Self
pub fn client_capabilities(self, capabilities: LspClientCapabilities) -> Self
Set client capabilities
Sourcepub fn startup_timeout(self, timeout: Duration) -> Self
pub fn startup_timeout(self, timeout: Duration) -> Self
Set startup timeout
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Set request timeout
Sourcepub fn trace(self, level: TraceLevel) -> Self
pub fn trace(self, level: TraceLevel) -> Self
Set trace level
Sourcepub fn max_restart_attempts(self, attempts: u32) -> Self
pub fn max_restart_attempts(self, attempts: u32) -> Self
Set maximum restart attempts
Sourcepub fn restart_delay(self, delay: Duration) -> Self
pub fn restart_delay(self, delay: Duration) -> Self
Set restart delay
Trait Implementations§
Source§impl Clone for LspServerConfig
impl Clone for LspServerConfig
Source§fn clone(&self) -> LspServerConfig
fn clone(&self) -> LspServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LspServerConfig
impl Debug for LspServerConfig
Source§impl Default for LspServerConfig
impl Default for LspServerConfig
Source§impl<'de> Deserialize<'de> for LspServerConfig
impl<'de> Deserialize<'de> for LspServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LspServerConfig
impl RefUnwindSafe for LspServerConfig
impl Send for LspServerConfig
impl Sync for LspServerConfig
impl Unpin for LspServerConfig
impl UnwindSafe for LspServerConfig
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
Mutably borrows from an owned value. Read more