[−][src]Struct tower_lsp::Client
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]
&'_ self,
typ: MessageType,
message: M,
actions: Option<Vec<MessageActionItem>>
) -> Result<Option<MessageActionItem>>
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]
&'_ 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]
&'_ self
) -> Result<Option<Vec<WorkspaceFolder>>>
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
ConfigurationItem
s (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]
&'_ self,
edit: WorkspaceEdit
) -> 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 fn publish_diagnostics(
&self,
uri: Url,
diags: Vec<Diagnostic>,
version: Option<i64>
)
[src]
&self,
uri: Url,
diags: Vec<Diagnostic>,
version: Option<i64>
)
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]
N: Notification,
Sends a custom notification to the client.
Initialization
This notification 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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,