Skip to content

Commit

Permalink
Implement codeAction/resolve request
Browse files Browse the repository at this point in the history
  • Loading branch information
ebkalderon committed May 20, 2021
1 parent 55a7653 commit 1d29cac
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ pub trait LanguageServer: Send + Sync + 'static {
///
/// # Compatibility
///
/// Since version 3.8.0: support for `CodeAction` literals to enable the following scenarios:
/// Since version 3.8.0: support for [`CodeAction`] literals to enable the following scenarios:
///
/// * The ability to directly return a workspace edit from the code action request.
/// This avoids having another server roundtrip to execute an actual code action.
Expand All @@ -643,6 +643,25 @@ pub trait LanguageServer: Send + Sync + 'static {
Err(Error::method_not_found())
}

/// The [`codeAction/resolve`] request is sent from the client to the server to resolve
/// additional information for a given code action.
///
/// [`codeAction/resolve`]: https://microsoft.github.io/language-server-protocol/specification#codeAction_resolve
///
/// This is usually used to compute the edit property of a [`CodeAction`] to avoid its
/// unnecessary computation during the [`textDocument/codeAction`](#method.code_action)
/// request.
///
/// # Compatibility
///
/// This request was introduced in specification version 3.16.0.
#[rpc(name = "codeAction/resolve")]
async fn code_action_resolve(&self, params: CodeAction) -> Result<CodeAction> {
let _ = params;
error!("Got a codeAction/resolve request, but it is not implemented");
Err(Error::method_not_found())
}

/// The [`textDocument/codeLens`] request is sent from the client to the server to compute code
/// lenses for a given text document.
///
Expand Down

0 comments on commit 1d29cac

Please sign in to comment.