pub trait LspService: Service<AnyRequest> {
// Required methods
fn notify(&mut self, notif: AnyNotification) -> ControlFlow<Result<()>>;
fn emit(&mut self, event: AnyEvent) -> ControlFlow<Result<()>>;
}
Expand description
The core service abstraction, representing either a Language Server or Language Client.
Required Methods§
Sourcefn notify(&mut self, notif: AnyNotification) -> ControlFlow<Result<()>>
fn notify(&mut self, notif: AnyNotification) -> ControlFlow<Result<()>>
The handler of LSP notifications.
Notifications are delivered in order and synchronously. This is mandatory since they can change the interpretation of later notifications or requests.
§Return
The return value decides the action to either break or continue the main loop.
Sourcefn emit(&mut self, event: AnyEvent) -> ControlFlow<Result<()>>
fn emit(&mut self, event: AnyEvent) -> ControlFlow<Result<()>>
The handler of an arbitrary AnyEvent
.
Events are emitted by users or middlewares via ClientSocket::emit
or
ServerSocket::emit
, for user-defined purposes. Events are delivered in order and
synchronously.
§Return
The return value decides the action to either break or continue the main loop.
Implementors§
impl LspService for ClientSocket
Available on crate feature
forward
only.impl LspService for ServerSocket
Available on crate feature
forward
only.impl<S: LspService> LspService for ClientProcessMonitor<S>
Available on crate feature
client-monitor
only.impl<S: LspService> LspService for Concurrency<S>
impl<S: LspService> LspService for CatchUnwind<S>
impl<S: LspService> LspService for Lifecycle<S>
impl<S: LspService> LspService for Tracing<S>
Available on crate feature
tracing
only.