pub struct LspClient { /* private fields */ }
Expand description
A client for the Language Server Protocol.
Implementations§
Source§impl LspClient
impl LspClient
pub fn new<S, R>(sender: S, receiver: R) -> Self
Sourcepub async fn initialize(
&self,
params: InitializeParams,
) -> Result<InitializeResult, LspError>
pub async fn initialize( &self, params: InitializeParams, ) -> Result<InitializeResult, LspError>
Request the server to initialize the client.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize
Sourcepub async fn initialized(&self) -> Result<(), LspError>
pub async fn initialized(&self) -> Result<(), LspError>
Notify the server that the client received the result of the initialize
request.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialized
Sourcepub async fn shutdown(&self) -> Result<(), LspError>
pub async fn shutdown(&self) -> Result<(), LspError>
Request the server to shutdown the client.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#shutdown
Sourcepub async fn exit(&self) -> Result<(), LspError>
pub async fn exit(&self) -> Result<(), LspError>
Notify the server to exit the process.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#exit
Sourcepub async fn send_request<R>(
&self,
params: R::Params,
) -> Result<R::Result, LspError>where
R: Request,
pub async fn send_request<R>(
&self,
params: R::Params,
) -> Result<R::Result, LspError>where
R: Request,
Send an LSP request to the server.
Sourcepub async fn send_notification<N>(
&self,
params: N::Params,
) -> Result<(), LspError>where
N: Notification,
pub async fn send_notification<N>(
&self,
params: N::Params,
) -> Result<(), LspError>where
N: Notification,
Send an LSP notification to the server.
Sourcepub async fn subscribe_to_method<N>(
&self,
) -> Result<Subscription<N::Params>, LspError>where
N: Notification,
pub async fn subscribe_to_method<N>(
&self,
) -> Result<Subscription<N::Params>, LspError>where
N: Notification,
Create a subscription to an LSP notification.