pub struct LspServerConfig {
pub language_id: String,
pub command: String,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub file_patterns: Vec<String>,
pub initialization_options: Option<Value>,
pub timeout_seconds: u64,
pub heuristics: Option<ServerHeuristics>,
pub name: Option<String>,
pub handles: Option<Vec<ToolKind>>,
}Expand description
Configuration for a single LSP server.
Fields§
§language_id: StringLanguage identifier (e.g., “rust”, “python”, “typescript”).
command: StringCommand to start the LSP server.
args: Vec<String>Arguments to pass to the LSP server command.
env: HashMap<String, String>Environment variables for the LSP server process.
file_patterns: Vec<String>File patterns this server handles (glob patterns).
initialization_options: Option<Value>LSP initialization options (server-specific).
timeout_seconds: u64Request timeout in seconds.
heuristics: Option<ServerHeuristics>Heuristics for determining if this server should be spawned. If not specified, the server will always attempt to spawn.
name: Option<String>Human-readable server identity used as the routing key.
Defaults to language_id when omitted (see Self::id). Must be
unique across all applicable servers in a workspace, regardless of
language: this is what lets two servers share one language_id
(e.g. pyright and pylsp both for python) without one silently
overwriting the other in the maps keyed by ServerId.
handles: Option<Vec<ToolKind>>Tools this server handles.
None means this server is a catch-all: it serves every tool not
explicitly claimed by another server for the same language.
Some(list) restricts the server to exactly those tools.
Implementations§
Source§impl LspServerConfig
impl LspServerConfig
Sourcepub fn should_spawn(
&self,
workspace_root: &Path,
max_depth: Option<usize>,
) -> bool
pub fn should_spawn( &self, workspace_root: &Path, max_depth: Option<usize>, ) -> bool
Check if this server should be spawned for the given workspace.
Uses recursive marker search to detect nested projects.
§Arguments
workspace_root- Root directory of the workspacemax_depth- Maximum depth for recursive search (default: 10)
Sourcepub fn id(&self) -> ServerId
pub fn id(&self) -> ServerId
The routing identity of this server: name if set, otherwise language_id.
This is the key used across Translator’s client/server maps, so two
servers for the same language must set distinct names or they
collide (see ToolRouter::from_configs for the enforcement).
Sourcepub fn rust_analyzer() -> Self
pub fn rust_analyzer() -> Self
Create a default configuration for rust-analyzer.
Sourcepub fn typescript() -> Self
pub fn typescript() -> Self
Create a default configuration for TypeScript language server.
Trait Implementations§
Source§impl Clone for LspServerConfig
impl Clone for LspServerConfig
Source§fn clone(&self) -> LspServerConfig
fn clone(&self) -> LspServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more