Skip to main content

Editor

Trait Editor 

Source
pub trait Editor<L: Lsp> {
    // Required methods
    fn show_message(
        &mut self,
        message_type: MessageType,
        message: String,
    ) -> Fallible<()>;
    fn publish_diagnostics(
        &mut self,
        params: PublishDiagnosticsParams,
    ) -> Fallible<()>;
    fn spawn(
        &mut self,
        task: Box<dyn FnOnce(&L::Fork, &mut dyn Editor<L>) -> Fallible<()> + Send>,
    );
}
Expand description

Allows your LSP server to make requests of the “editor”.

The “editor” here includes the actual editor but also our dispatch loop, which to you are not distinguishable.

Required Methods§

Source

fn show_message( &mut self, message_type: MessageType, message: String, ) -> Fallible<()>

Display a message to the user.

Source

fn publish_diagnostics( &mut self, params: PublishDiagnosticsParams, ) -> Fallible<()>

Source

fn spawn( &mut self, task: Box<dyn FnOnce(&L::Fork, &mut dyn Editor<L>) -> Fallible<()> + Send>, )

Enqueue a task to execute in parallel. The task may not start executing immediately. The task will be given a fork of the lsp along with an editor of its own.

Implementors§

Source§

impl<L: Lsp> Editor<L> for LspDispatchEditor<'_, L>