Skip to main content

CancelNotification

Type Alias CancelNotification 

Source
pub type CancelNotification = NotificationMessage<CancelParams>;
Expand description

The base protocol offers support for request cancellation. A request A request that got canceled still needs to return from the server and send a response back. It can not be left open / hanging. This is in line with the JSON-RPC protocol that requires that every request sends a response back. In addition it allows for returning partial results on cancel. If the request returns an error response on cancellation it is advised to set the error code to ErrorCodes.RequestCancelled. To cancel a request, a notification message with the following properties is sent:

§Notification

  • method: ‘$/cancelRequest’
  • params: CancelParams

Aliased Type§

pub struct CancelNotification {
    pub jsonrpc: String,
    pub method: String,
    pub params: Option<CancelParams>,
}

Fields§

§jsonrpc: String

jsonrpc version. LSP uses 2.0

§method: String

The method to be invoked.

§params: Option<CancelParams>

The notification’s params