Struct lspower::Client [−][src]
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
impl Client[src]
pub async 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 async 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]
&self,
typ: MessageType,
message: M,
actions: Option<Vec<MessageActionItem>>
) -> Result<Option<MessageActionItem>>
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.
pub async 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]
&self,
registrations: Vec<Registration>
) -> Result<()>
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]
&self,
unregisterations: Vec<Unregistration>
) -> Result<()>
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]
&self,
items: Vec<ConfigurationItem>
) -> Result<Vec<Value>>
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,
label: Option<String>
) -> Result<ApplyWorkspaceEditResponse>[src]
&self,
edit: WorkspaceEdit,
label: Option<String>
) -> Result<ApplyWorkspaceEditResponse>
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 async fn publish_diagnostics(
&self,
uri: Url,
diags: Vec<Diagnostic>,
version: Option<i32>
)[src]
&self,
uri: Url,
diags: Vec<Diagnostic>,
version: Option<i32>
)
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 async fn send_custom_notification<N>(&self, params: N::Params) where
N: Notification, [src]
N: Notification,
Sends a custom notification to the client.
Initialization
This notification will only be sent if the server is initialized.
pub async fn send_custom_request<R>(
&self,
params: R::Params,
token: Option<CancellationToken>
) -> Result<R::Result> where
R: Request, [src]
&self,
params: R::Params,
token: Option<CancellationToken>
) -> Result<R::Result> where
R: Request,
Sends a custom request to the client.
Initialization
This request will only be sent if the server is initialized.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,