From 3e9bf7ebabdaa8e9a2972af2dd8e8089a3a0341e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 19 May 2020 20:27:14 +0200 Subject: Update test data --- crates/rust-analyzer/src/lsp_ext.rs | 2 + crates/rust-analyzer/tests/heavy_tests/main.rs | 52 +++++++------------------- 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs index c7a3a6911..f75a26eb7 100644 --- a/crates/rust-analyzer/src/lsp_ext.rs +++ b/crates/rust-analyzer/src/lsp_ext.rs @@ -206,7 +206,9 @@ pub struct CodeAction { #[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SnippetWorkspaceEdit { + #[serde(skip_serializing_if = "Option::is_none")] pub changes: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] pub document_changes: Option>, } diff --git a/crates/rust-analyzer/tests/heavy_tests/main.rs b/crates/rust-analyzer/tests/heavy_tests/main.rs index 5011cc273..74676b3ee 100644 --- a/crates/rust-analyzer/tests/heavy_tests/main.rs +++ b/crates/rust-analyzer/tests/heavy_tests/main.rs @@ -333,29 +333,17 @@ fn main() {} partial_result_params: PartialResultParams::default(), work_done_progress_params: WorkDoneProgressParams::default(), }, - json!([ - { - "command": { - "arguments": [ + json!([{ + "edit": { + "documentChanges": [ { - "cursorPosition": null, - "label": "Create module", - "workspaceEdit": { - "documentChanges": [ - { - "kind": "create", - "uri": "file:///[..]/src/bar.rs" - } - ] - } + "kind": "create", + "uri": "file:///[..]/src/bar.rs" } - ], - "command": "rust-analyzer.applySourceChange", - "title": "Create module" + ] }, "title": "Create module" - } - ]), + }]), ); server.request::( @@ -416,29 +404,17 @@ fn main() {{}} partial_result_params: PartialResultParams::default(), work_done_progress_params: WorkDoneProgressParams::default(), }, - json!([ - { - "command": { - "arguments": [ + json!([{ + "edit": { + "documentChanges": [ { - "cursorPosition": null, - "label": "Create module", - "workspaceEdit": { - "documentChanges": [ - { - "kind": "create", - "uri": "file:///[..]/src/bar.rs" - } - ] - } + "kind": "create", + "uri": "file://[..]/src/bar.rs" } - ], - "command": "rust-analyzer.applySourceChange", - "title": "Create module" + ] }, "title": "Create module" - } - ]), + }]), ); server.request::( -- cgit v1.2.3