pub struct Client { /* private fields */ }
Expand description

Handle for communicating with the language client.

This type provides a very cheap implementation of Clone so API consumers can cheaply clone and pass it around as needed.

Implementations

Notifies the client to log a particular message.

This corresponds to the window/logMessage notification.

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

This corresponds to the window/showMessage notification.

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

Unlike the show_message notification, this request can also pass a list of actions and wait for an answer from the client.

This corresponds to the window/showMessageRequest request.

Notifies the client to log a telemetry event.

This corresponds to the telemetry/event notification.

Registers a new capability with the client.

This corresponds to the client/registerCapability request.

Initialization

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

Unregisters a capability with the client.

This corresponds to the client/unregisterCapability request.

Initialization

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

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 the 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.

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 the 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.

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 the client before the server has been initialized, this will immediately return Err with JSON-RPC error code -32002 (read more).

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.

Asks the client to refresh the code lenses currently shown in editors. As a result, the client should ask the server to recompute the code lenses for these editors.

This is useful if a server detects a configuration change which requires a re-calculation of all code lenses.

Note that the client still has the freedom to delay the re-calculation of the code lenses if for example an editor is currently not visible.

This corresponds to the workspace/codeLens/refresh request.

Initialization

If the request is sent to the 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.16.0.

Asks the client to refresh the editors for which this server provides semantic tokens. As a result, the client should ask the server to recompute the semantic tokens for these editors.

This is useful if a server detects a project-wide configuration change which requires a re-calculation of all semantic tokens.

Note that the client still has the freedom to delay the re-calculation of the semantic tokens if for example an editor is currently not visible.

This corresponds to the workspace/semanticTokens/refresh request.

Initialization

If the request is sent to the 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.16.0.

Sends a custom notification to the client.

Initialization

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

Sends a custom request to the client.

Initialization

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.