From 0f0c5081c0702543cd52c94cd43e08e40910354b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Jul 2020 11:46:31 +0200 Subject: [PATCH] Make sure there are no commands in code actions --- crates/rust-analyzer/src/diagnostics/to_proto.rs | 1 - crates/rust-analyzer/src/handlers.rs | 1 - crates/rust-analyzer/src/lsp_ext.rs | 5 +++-- crates/rust-analyzer/src/to_proto.rs | 1 - crates/rust-analyzer/test_data/rustc_unused_variable.txt | 1 - .../test_data/rustc_unused_variable_as_hint.txt | 1 - .../test_data/rustc_unused_variable_as_info.txt | 1 - crates/rust-analyzer/test_data/snap_multi_line_fix.txt | 1 - 8 files changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index b1b222deb8..1b1e670c1b 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs @@ -118,7 +118,6 @@ fn map_rust_child_diagnostic( changes: Some(edit_map), document_changes: None, }), - command: None, }) } } diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 8ce6e1c711..d39dceae04 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -762,7 +762,6 @@ fn handle_fixes( group: None, kind: Some(lsp_types::code_action_kind::QUICKFIX.into()), edit: Some(edit), - command: None, }; res.push(action); } diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs index ba8a0231fa..a3e12c046b 100644 --- a/crates/rust-analyzer/src/lsp_ext.rs +++ b/crates/rust-analyzer/src/lsp_ext.rs @@ -249,8 +249,9 @@ pub struct CodeAction { pub group: Option, #[serde(skip_serializing_if = "Option::is_none")] pub kind: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub command: Option, + // We don't handle commands on the client-side + // #[serde(skip_serializing_if = "Option::is_none")] + // pub command: Option, #[serde(skip_serializing_if = "Option::is_none")] pub edit: Option, } diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 263f58a00e..f6dff16844 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -651,7 +651,6 @@ pub(crate) fn unresolved_code_action( group: assist.group.filter(|_| snap.config.client_caps.code_action_group).map(|gr| gr.0), kind: Some(code_action_kind(assist.id.1)), edit: None, - command: None, }; Ok(res) } diff --git a/crates/rust-analyzer/test_data/rustc_unused_variable.txt b/crates/rust-analyzer/test_data/rustc_unused_variable.txt index 81f180a861..92aea088b9 100644 --- a/crates/rust-analyzer/test_data/rustc_unused_variable.txt +++ b/crates/rust-analyzer/test_data/rustc_unused_variable.txt @@ -39,7 +39,6 @@ kind: Some( "quickfix", ), - command: None, edit: Some( SnippetWorkspaceEdit { changes: Some( diff --git a/crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt b/crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt index d5d78fd800..80cf0d8a54 100644 --- a/crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt +++ b/crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt @@ -39,7 +39,6 @@ kind: Some( "quickfix", ), - command: None, edit: Some( SnippetWorkspaceEdit { changes: Some( diff --git a/crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt b/crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt index 2a7505c59f..afe3cb6d8a 100644 --- a/crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt +++ b/crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt @@ -39,7 +39,6 @@ kind: Some( "quickfix", ), - command: None, edit: Some( SnippetWorkspaceEdit { changes: Some( diff --git a/crates/rust-analyzer/test_data/snap_multi_line_fix.txt b/crates/rust-analyzer/test_data/snap_multi_line_fix.txt index 6eca3ae2f2..7814d35435 100644 --- a/crates/rust-analyzer/test_data/snap_multi_line_fix.txt +++ b/crates/rust-analyzer/test_data/snap_multi_line_fix.txt @@ -54,7 +54,6 @@ kind: Some( "quickfix", ), - command: None, edit: Some( SnippetWorkspaceEdit { changes: Some(