pub struct LspClient {
pub handle: Handle,
/* private fields */
}
Expand description
The host for the language server, or known as the LSP client.
Fields§
§handle: Handle
The tokio handle.
Implementations§
Source§impl LspClient
impl LspClient
Sourcepub fn send_lsp_request_<R: Req>(
&self,
params: R::Params,
handler: impl FnOnce(&mut dyn Any, Response) + Send + Sync + 'static,
)
pub fn send_lsp_request_<R: Req>( &self, params: R::Params, handler: impl FnOnce(&mut dyn Any, Response) + Send + Sync + 'static, )
Sends a request to the client and registers a handler.
Sourcepub fn respond_lsp(&self, response: Response)
pub fn respond_lsp(&self, response: Response)
Completes an client2server request in the request queue.
Sourcepub fn send_notification<N: Notif>(&self, params: &N::Params)
pub fn send_notification<N: Notif>(&self, params: &N::Params)
Sends a typed notification to the client.
Sourcepub fn send_notification_(&self, notif: Notification)
pub fn send_notification_(&self, notif: Notification)
Sends an untyped notification to the client.
Source§impl LspClient
impl LspClient
Sourcepub fn to_typed<S: Any>(&self) -> TypedLspClient<S>
pub fn to_typed<S: Any>(&self) -> TypedLspClient<S>
converts the client to a typed client.
Sourcepub fn has_pending_requests(&self) -> bool
pub fn has_pending_requests(&self) -> bool
Checks if there are pending requests.
Sourcepub fn begin_panic(&self)
pub fn begin_panic(&self)
Prints states of the request queue and panics.
Sourcepub fn send_event<T: Any + Send + 'static>(&self, event: T)
pub fn send_event<T: Any + Send + 'static>(&self, event: T)
Sends a event to the server itself.
Sourcepub fn complete_lsp_request<S: Any>(&self, service: &mut S, response: Response)
pub fn complete_lsp_request<S: Any>(&self, service: &mut S, response: Response)
Completes an server2client request in the request queue.
Sourcepub fn complete_dap_request<S: Any>(&self, service: &mut S, response: Response)
pub fn complete_dap_request<S: Any>(&self, service: &mut S, response: Response)
Completes an server2client request in the request queue.
Sourcepub fn register_request(
&self,
method: &str,
id: &RequestId,
received_at: Instant,
)
pub fn register_request( &self, method: &str, id: &RequestId, received_at: Instant, )
Registers an client2server request in the request queue.
Sourcepub fn respond_result<T: Serialize>(&self, id: RequestId, result: LspResult<T>)
pub fn respond_result<T: Serialize>(&self, id: RequestId, result: LspResult<T>)
Responds a typed result to the client.
Source§impl LspClient
impl LspClient
Sourcepub fn schedule<T: Serialize + 'static>(
&self,
req_id: RequestId,
resp: SchedulableResponse<T>,
) -> ScheduledResult
pub fn schedule<T: Serialize + 'static>( &self, req_id: RequestId, resp: SchedulableResponse<T>, ) -> ScheduledResult
Schedules a request from the client.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LspClient
impl !RefUnwindSafe for LspClient
impl Send for LspClient
impl Sync for LspClient
impl Unpin for LspClient
impl !UnwindSafe for LspClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more