Skip to main content

LspClient

Trait LspClient 

Source
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§

Source

fn did_open(&mut self, _document: &LspDocument, _text: &str)

Notifies the client that a document was opened.

Source

fn did_change(&mut self, _document: &LspDocument, _changes: &[LspTextChange])

Notifies the client that the document changed.

Source

fn did_save(&mut self, _document: &LspDocument, _text: &str)

Notifies the client that the document was saved.

Source

fn did_close(&mut self, _document: &LspDocument)

Notifies the client that the document was closed.

Source

fn request_hover(&mut self, _document: &LspDocument, _position: LspPosition)

Requests hover information at the given position.

Source

fn request_completion( &mut self, _document: &LspDocument, _position: LspPosition, )

Requests completion items at the given position.

Source

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.

Implementors§