Trait LspService

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

Source

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.

Source

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§

Source§

impl LspService for ClientSocket

Available on crate feature forward only.
Source§

impl LspService for ServerSocket

Available on crate feature forward only.
Source§

impl<S: LspService> LspService for ClientProcessMonitor<S>

Available on crate feature client-monitor only.
Source§

impl<S: LspService> LspService for Concurrency<S>

Source§

impl<S: LspService> LspService for CatchUnwind<S>

Source§

impl<S: LspService> LspService for Lifecycle<S>

Source§

impl<S: LspService> LspService for Tracing<S>

Available on crate feature tracing only.
Source§

impl<St> LspService for Router<St>