pub struct ServerInitConfig {
pub server_config: LspServerConfig,
pub workspace_roots: Vec<PathBuf>,
pub initialization_options: Option<Value>,
pub position_encodings: Vec<String>,
pub notification_tx: Option<Sender<LspNotification>>,
}Expand description
Configuration for LSP server initialization.
Fields§
§server_config: LspServerConfigLSP server configuration.
workspace_roots: Vec<PathBuf>Workspace root paths.
initialization_options: Option<Value>Initialization options (server-specific JSON).
position_encodings: Vec<String>Position encoding preference order from
crate::config::WorkspaceConfig::position_encodings.
Sent as capabilities.general.positionEncodings during LspServer::spawn’s
initialize handshake, in the configured order. Values that don’t parse
as a valid PositionEncodingKind are skipped with a warning rather than
failing the handshake: serve/serve_with validate the top-level
ServerConfig via crate::config::ServerConfig::validate before this
is ever built, but LspServer::spawn/spawn_batch are pub and
reachable directly by a library embedder bypassing that validation
entirely (same reasoning as the initialize timeout clamp below), so
this can’t assume the value was already checked. If nothing parses,
falls back to config::default_position_encodings()’s default.
notification_tx: Option<Sender<LspNotification>>Optional channel for forwarding LSP notifications to the notification cache.
When Some, the spawned LSP client sends every notification it receives
(publishDiagnostics, logMessage, showMessage, …) through this sender.
The caller is responsible for draining the corresponding receiver and
storing entries in crate::bridge::NotificationCache.
Trait Implementations§
Source§impl Clone for ServerInitConfig
impl Clone for ServerInitConfig
Source§fn clone(&self) -> ServerInitConfig
fn clone(&self) -> ServerInitConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more