Skip to content

Commit 9ac80de

Browse files
Do not error for actions with no data to resolve
Same as the other resolve code handlers in the same file. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#version_3_17_0 does not forbid resolving with no data, so instead of erroring, just consider such items resolved already.
1 parent 220d913 commit 9ac80de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ pub(crate) fn handle_code_action_resolve(
14801480
) -> anyhow::Result<lsp_ext::CodeAction> {
14811481
let _p = tracing::info_span!("handle_code_action_resolve").entered();
14821482
let Some(params) = code_action.data.take() else {
1483-
return Err(invalid_params_error("code action without data".to_owned()).into());
1483+
return Ok(code_action);
14841484
};
14851485

14861486
let file_id = from_proto::file_id(&snap, &params.code_action_params.text_document.uri)?

0 commit comments

Comments
 (0)