pub trait Lsp: Sized {
type Fork: LspFork;
// Required methods
fn new(params: InitializeParams) -> Fallible<Self>;
fn server_capabilities(&mut self) -> Fallible<ServerCapabilities>;
fn server_info(&mut self) -> Fallible<Option<ServerInfo>>;
fn fork(&mut self) -> Self::Fork;
fn did_open(
&mut self,
editor: &mut dyn Editor<Self>,
item: DidOpenTextDocumentParams,
) -> Fallible<()>;
fn did_change(
&mut self,
editor: &mut dyn Editor<Self>,
item: DidChangeTextDocumentParams,
) -> Fallible<()>;
fn hover(
&mut self,
editor: &mut dyn Editor<Self>,
params: HoverParams,
) -> Fallible<Option<Hover>>;
// Provided method
fn run() -> Fallible<()> { ... }
}Expand description
LSP server handlers.
Required Associated Types§
Required Methods§
fn new(params: InitializeParams) -> Fallible<Self>
Sourcefn server_capabilities(&mut self) -> Fallible<ServerCapabilities>
fn server_capabilities(&mut self) -> Fallible<ServerCapabilities>
Capabilities to report to the editor.
Sourcefn server_info(&mut self) -> Fallible<Option<ServerInfo>>
fn server_info(&mut self) -> Fallible<Option<ServerInfo>>
Server info to report to the editor.
Sourcefn fork(&mut self) -> Self::Fork
fn fork(&mut self) -> Self::Fork
Create a “fork” of the LSP server that can be used from another thread.
Sourcefn did_open(
&mut self,
editor: &mut dyn Editor<Self>,
item: DidOpenTextDocumentParams,
) -> Fallible<()>
fn did_open( &mut self, editor: &mut dyn Editor<Self>, item: DidOpenTextDocumentParams, ) -> Fallible<()>
Open reported for the given URI.
Sourcefn did_change(
&mut self,
editor: &mut dyn Editor<Self>,
item: DidChangeTextDocumentParams,
) -> Fallible<()>
fn did_change( &mut self, editor: &mut dyn Editor<Self>, item: DidChangeTextDocumentParams, ) -> Fallible<()>
Modification reported to the given URI.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.