[][src]Struct tower_lsp::Client

pub struct Client { /* fields omitted */ }

Handle for communicating with the language client.

Implementations

impl Client[src]

pub fn log_message<M: Display>(&self, typ: MessageType, message: M)[src]

Notifies the client to log a particular message.

This corresponds to the window/logMessage notification.

pub fn show_message<M: Display>(&self, typ: MessageType, message: M)[src]

Notifies the client to display a particular message in the user interface.

This corresponds to the window/showMessage notification.

pub async fn show_message_request<M: Display, '_>(
    &'_ self,
    typ: MessageType,
    message: M,
    actions: Option<Vec<MessageActionItem>>
) -> Result<Option<MessageActionItem>>
[src]

Asks the client to display a particular message in the user interface.

In addition to the show_message notification, the request allows to pass actions and to wait for an answer from the client.

This corresponds to the window/showMessageRequest request.

Initialization

If the request is sent to client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

pub fn telemetry_event<S: Serialize>(&self, data: S)[src]

Notifies the client to log a telemetry event.

This corresponds to the telemetry/event notification.

pub async fn register_capability<'_>(
    &'_ self,
    registrations: Vec<Registration>
) -> Result<()>
[src]

Registers a new capability with the client.

This corresponds to the client/registerCapability request.

Initialization

If the request is sent to client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

pub async fn unregister_capability<'_>(
    &'_ self,
    unregisterations: Vec<Unregistration>
) -> Result<()>
[src]

Unregisters a capability with the client.

This corresponds to the client/unregisterCapability request.

Initialization

If the request is sent to client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

pub async fn workspace_folders<'_>(
    &'_ self
) -> Result<Option<Vec<WorkspaceFolder>>>
[src]

Fetches the current open list of workspace folders.

Returns None if only a single file is open in the tool. Returns an empty Vec if a workspace is open but no folders are configured.

This corresponds to the workspace/workspaceFolders request.

Initialization

If the request is sent to client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

Compatibility

This request was introduced in specification version 3.6.0.

pub async fn configuration<'_>(
    &'_ self,
    items: Vec<ConfigurationItem>
) -> Result<Vec<Value>>
[src]

Fetches configuration settings from the client.

The request can fetch several configuration settings in one roundtrip. The order of the returned configuration settings correspond to the order of the passed ConfigurationItems (e.g. the first item in the response is the result for the first configuration item in the params).

This corresponds to the workspace/configuration request.

Initialization

If the request is sent to client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

Compatibility

This request was introduced in specification version 3.6.0.

pub async fn apply_edit<'_>(
    &'_ self,
    edit: WorkspaceEdit
) -> Result<ApplyWorkspaceEditResponse>
[src]

Requests a workspace resource be edited on the client side and returns whether the edit was applied.

This corresponds to the workspace/applyEdit request.

Initialization

If the request is sent to client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

pub fn publish_diagnostics(
    &self,
    uri: Url,
    diags: Vec<Diagnostic>,
    version: Option<i64>
)
[src]

Submits validation diagnostics for an open file with the given URI.

This corresponds to the textDocument/publishDiagnostics notification.

Initialization

This notification will only be sent if the server is initialized.

pub fn send_custom_notification<N>(&self, params: N::Params) where
    N: Notification
[src]

Sends a custom notification to the client.

Initialization

This notification will only be sent if the server is initialized.

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.