pub trait LspClient {
// Provided methods
fn did_open(&mut self, _document: &LspDocument, _text: &str) { ... }
fn did_change(
&mut self,
_document: &LspDocument,
_changes: &[LspTextChange],
) { ... }
fn did_save(&mut self, _document: &LspDocument, _text: &str) { ... }
fn did_close(&mut self, _document: &LspDocument) { ... }
fn request_hover(&mut self, _document: &LspDocument, _position: LspPosition) { ... }
fn request_completion(
&mut self,
_document: &LspDocument,
_position: LspPosition,
) { ... }
fn request_definition(
&mut self,
_document: &LspDocument,
_position: LspPosition,
) { ... }
}Expand description
LSP integration types and traits for editor clients. LSP client hooks invoked by the editor.
Provided Methods§
Sourcefn did_open(&mut self, _document: &LspDocument, _text: &str)
fn did_open(&mut self, _document: &LspDocument, _text: &str)
Notifies the client that a document was opened.
Sourcefn did_change(&mut self, _document: &LspDocument, _changes: &[LspTextChange])
fn did_change(&mut self, _document: &LspDocument, _changes: &[LspTextChange])
Notifies the client that the document changed.
Sourcefn did_save(&mut self, _document: &LspDocument, _text: &str)
fn did_save(&mut self, _document: &LspDocument, _text: &str)
Notifies the client that the document was saved.
Sourcefn did_close(&mut self, _document: &LspDocument)
fn did_close(&mut self, _document: &LspDocument)
Notifies the client that the document was closed.
Sourcefn request_hover(&mut self, _document: &LspDocument, _position: LspPosition)
fn request_hover(&mut self, _document: &LspDocument, _position: LspPosition)
Requests hover information at the given position.
Sourcefn request_completion(
&mut self,
_document: &LspDocument,
_position: LspPosition,
)
fn request_completion( &mut self, _document: &LspDocument, _position: LspPosition, )
Requests completion items at the given position.
Sourcefn request_definition(
&mut self,
_document: &LspDocument,
_position: LspPosition,
)
fn request_definition( &mut self, _document: &LspDocument, _position: LspPosition, )
Requests the definition location(s) for the symbol at the given position.
This method is called when the user triggers a “Go to Definition” action
(e.g., via Ctrl+Click or a context menu). The client implementation should
send a textDocument/definition request to the LSP server.