pub struct LspServer { /* private fields */ }Expand description
LSP Server
Implementations§
Source§impl LspServer
impl LspServer
Sourcepub fn with_completion_config(completion_config: CompletionConfig) -> Self
pub fn with_completion_config(completion_config: CompletionConfig) -> Self
Create a new LSP server with custom completion config
Sourcepub fn register_completion_engine(&mut self, engine: Arc<dyn CompletionEngine>)
pub fn register_completion_engine(&mut self, engine: Arc<dyn CompletionEngine>)
Register a completion engine
Sourcepub fn completion_config(&self) -> &CompletionConfig
pub fn completion_config(&self) -> &CompletionConfig
Get completion configuration
Sourcepub fn set_completion_config(&mut self, config: CompletionConfig)
pub fn set_completion_config(&mut self, config: CompletionConfig)
Set completion configuration
Sourcepub fn is_completion_enabled(&self) -> bool
pub fn is_completion_enabled(&self) -> bool
Check if completion is enabled
Sourcepub fn refactoring_handler(&self) -> &RefactoringHandler
pub fn refactoring_handler(&self) -> &RefactoringHandler
Get the refactoring handler
Sourcepub fn refactoring_handler_mut(&mut self) -> &mut RefactoringHandler
pub fn refactoring_handler_mut(&mut self) -> &mut RefactoringHandler
Get mutable refactoring handler
Sourcepub fn set_refactoring_enabled(&mut self, enabled: bool)
pub fn set_refactoring_enabled(&mut self, enabled: bool)
Enable or disable refactoring
Sourcepub fn is_refactoring_enabled(&self) -> bool
pub fn is_refactoring_enabled(&self) -> bool
Check if refactoring is enabled
Sourcepub fn state(&self) -> ServerState
pub fn state(&self) -> ServerState
Get the current server state
Sourcepub fn set_state(&mut self, state: ServerState)
pub fn set_state(&mut self, state: ServerState)
Set the server state (for testing)
Sourcepub fn capabilities(&self) -> &ServerCapabilities
pub fn capabilities(&self) -> &ServerCapabilities
Get server capabilities
Sourcepub fn client_capabilities(&self) -> Option<&ClientCapabilities>
pub fn client_capabilities(&self) -> Option<&ClientCapabilities>
Get client capabilities
Sourcepub fn get_document(&self, uri: &str) -> Option<&str>
pub fn get_document(&self, uri: &str) -> Option<&str>
Get a document by URI
Sourcepub fn set_document(&mut self, uri: String, content: String)
pub fn set_document(&mut self, uri: String, content: String)
Set a document
Sourcepub fn remove_document(&mut self, uri: &str)
pub fn remove_document(&mut self, uri: &str)
Remove a document
Sourcepub async fn handle_initialize(&mut self, params: Value) -> LspResult<Value>
pub async fn handle_initialize(&mut self, params: Value) -> LspResult<Value>
Handle initialize request
Sourcepub async fn handle_initialized(&mut self) -> LspResult<()>
pub async fn handle_initialized(&mut self) -> LspResult<()>
Handle initialized notification
Sourcepub async fn handle_shutdown(&mut self) -> LspResult<Value>
pub async fn handle_shutdown(&mut self) -> LspResult<Value>
Handle shutdown request
Sourcepub async fn handle_exit(&mut self) -> LspResult<()>
pub async fn handle_exit(&mut self) -> LspResult<()>
Handle exit notification
Sourcepub async fn handle_did_open(&mut self, params: Value) -> LspResult<()>
pub async fn handle_did_open(&mut self, params: Value) -> LspResult<()>
Handle did_open notification
Sourcepub async fn handle_did_change(&mut self, params: Value) -> LspResult<()>
pub async fn handle_did_change(&mut self, params: Value) -> LspResult<()>
Handle did_change notification
Sourcepub async fn handle_did_close(&mut self, params: Value) -> LspResult<()>
pub async fn handle_did_close(&mut self, params: Value) -> LspResult<()>
Handle did_close notification
Sourcepub async fn handle_hover(&self, params: Value) -> LspResult<Value>
pub async fn handle_hover(&self, params: Value) -> LspResult<Value>
Handle hover request
Sourcepub async fn handle_diagnostics(&self, params: Value) -> LspResult<Value>
pub async fn handle_diagnostics(&self, params: Value) -> LspResult<Value>
Handle diagnostics request
Sourcepub async fn handle_completion(&self, params: Value) -> LspResult<Value>
pub async fn handle_completion(&self, params: Value) -> LspResult<Value>
Handle completion request
Sourcepub async fn handle_completion_resolve(&self, params: Value) -> LspResult<Value>
pub async fn handle_completion_resolve(&self, params: Value) -> LspResult<Value>
Handle completionItem/resolve request
Sourcepub async fn handle_code_action(&self, params: Value) -> LspResult<Value>
pub async fn handle_code_action(&self, params: Value) -> LspResult<Value>
Handle code action request