From 3bec5066bc1575a4ca0964439bb3874a037e65bc Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 15 Mar 2025 21:27:18 +0200 Subject: [PATCH] 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. --- .../rust-analyzer/crates/rust-analyzer/src/handlers/request.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs index 170481ea7016..5f27567c31ed 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs @@ -1480,7 +1480,7 @@ pub(crate) fn handle_code_action_resolve( ) -> anyhow::Result { let _p = tracing::info_span!("handle_code_action_resolve").entered(); let Some(params) = code_action.data.take() else { - return Err(invalid_params_error("code action without data".to_owned()).into()); + return Ok(code_action); }; let file_id = from_proto::file_id(&snap, ¶ms.code_action_params.text_document.uri)?