From 0f0c5081c0702543cd52c94cd43e08e40910354b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Jul 2020 11:46:31 +0200 Subject: 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 - crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt | 1 - crates/rust-analyzer/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(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index b1b222deb..1b1e670c1 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 8ce6e1c71..d39dceae0 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 ba8a0231f..a3e12c046 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 263f58a00..f6dff1684 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 81f180a86..92aea088b 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 d5d78fd80..80cf0d8a5 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 2a7505c59..afe3cb6d8 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 6eca3ae2f..7814d3543 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( -- cgit v1.2.3