From fa2818551efcfe9f5269b2649a5f269749259509 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 4 Dec 2021 21:26:07 -0800 Subject: [PATCH] Update expected test results --- .../test_data/clippy_pass_by_ref.txt | 114 +++++++------ .../test_data/handles_macro_location.txt | 2 +- .../test_data/macro_compiler_error.txt | 6 +- .../rustc_incompatible_type_for_trait.txt | 2 +- .../test_data/rustc_mismatched_type.txt | 2 +- .../test_data/rustc_unused_variable.txt | 112 +++++++------ .../rustc_unused_variable_as_hint.txt | 112 +++++++------ .../rustc_unused_variable_as_info.txt | 112 +++++++------ .../rustc_wrong_number_of_parameters.txt | 4 +- .../test_data/snap_multi_line_fix.txt | 150 ++++++++++-------- 10 files changed, 348 insertions(+), 268 deletions(-) diff --git a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt index fd04163de98..4610984acb9 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt @@ -114,7 +114,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -205,7 +205,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -296,55 +296,69 @@ tags: None, data: None, }, - fixes: [ - CodeAction { - title: "consider passing by value instead: `self`", - group: None, - kind: Some( - CodeActionKind( - "quickfix", - ), - ), - edit: Some( - SnippetWorkspaceEdit { - changes: Some( - { - Url { - scheme: "file", - cannot_be_a_base: false, - username: "", - password: None, - host: None, - port: None, - path: "/test/compiler/mir/tagset.rs", - query: None, - fragment: None, - }: [ - TextEdit { - range: Range { - start: Position { - line: 41, - character: 23, - }, - end: Position { - line: 41, - character: 28, - }, - }, - new_text: "self", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 41, + character: 23, + }, + end: Position { + line: 41, + character: 28, + }, }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + action: CodeAction { + title: "consider passing by value instead: `self`", + group: None, + kind: Some( + CodeActionKind( + "quickfix", + ), + ), + edit: Some( + SnippetWorkspaceEdit { + changes: Some( + { + Url { + scheme: "file", + cannot_be_a_base: false, + username: "", + password: None, + host: None, + port: None, + path: "/test/compiler/mir/tagset.rs", + query: None, + fragment: None, + }: [ + TextEdit { + range: Range { + start: Position { + line: 41, + character: 23, + }, + end: Position { + line: 41, + character: 28, + }, + }, + new_text: "self", + }, + ], + }, + ), + document_changes: None, + change_annotations: None, + }, + ), + is_preferred: Some( + true, + ), + data: None, + }, }, - ], + ), }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt index a7f936a703e..989e5cf66d8 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt @@ -59,6 +59,6 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt index 8bee4cfe10a..fe5cf9b3bea 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt @@ -64,7 +64,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -131,7 +131,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -224,6 +224,6 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt index afc562a0e2b..dc36aa761c0 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt @@ -59,6 +59,6 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt index 05074a914b5..d557196c2bd 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt @@ -59,6 +59,6 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt index 3ded70411d3..46d44192c5c 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt @@ -72,7 +72,7 @@ ), data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -143,55 +143,69 @@ tags: None, data: None, }, - fixes: [ - CodeAction { - title: "consider prefixing with an underscore: `_foo`", - group: None, - kind: Some( - CodeActionKind( - "quickfix", - ), - ), - edit: Some( - SnippetWorkspaceEdit { - changes: Some( - { - Url { - scheme: "file", - cannot_be_a_base: false, - username: "", - password: None, - host: None, - port: None, - path: "/test/driver/subcommand/repl.rs", - query: None, - fragment: None, - }: [ - TextEdit { - range: Range { - start: Position { - line: 290, - character: 8, - }, - end: Position { - line: 290, - character: 11, - }, - }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + action: CodeAction { + title: "consider prefixing with an underscore: `_foo`", + group: None, + kind: Some( + CodeActionKind( + "quickfix", + ), + ), + edit: Some( + SnippetWorkspaceEdit { + changes: Some( + { + Url { + scheme: "file", + cannot_be_a_base: false, + username: "", + password: None, + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }: [ + TextEdit { + range: Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + new_text: "_foo", + }, + ], + }, + ), + document_changes: None, + change_annotations: None, + }, + ), + is_preferred: Some( + true, + ), + data: None, + }, }, - ], + ), }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt index 0993aa1af14..b595487e8f3 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt @@ -72,7 +72,7 @@ ), data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -143,55 +143,69 @@ tags: None, data: None, }, - fixes: [ - CodeAction { - title: "consider prefixing with an underscore: `_foo`", - group: None, - kind: Some( - CodeActionKind( - "quickfix", - ), - ), - edit: Some( - SnippetWorkspaceEdit { - changes: Some( - { - Url { - scheme: "file", - cannot_be_a_base: false, - username: "", - password: None, - host: None, - port: None, - path: "/test/driver/subcommand/repl.rs", - query: None, - fragment: None, - }: [ - TextEdit { - range: Range { - start: Position { - line: 290, - character: 8, - }, - end: Position { - line: 290, - character: 11, - }, - }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + action: CodeAction { + title: "consider prefixing with an underscore: `_foo`", + group: None, + kind: Some( + CodeActionKind( + "quickfix", + ), + ), + edit: Some( + SnippetWorkspaceEdit { + changes: Some( + { + Url { + scheme: "file", + cannot_be_a_base: false, + username: "", + password: None, + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }: [ + TextEdit { + range: Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + new_text: "_foo", + }, + ], + }, + ), + document_changes: None, + change_annotations: None, + }, + ), + is_preferred: Some( + true, + ), + data: None, + }, }, - ], + ), }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt index d7a974ae579..3ee50392a7f 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt @@ -72,7 +72,7 @@ ), data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -143,55 +143,69 @@ tags: None, data: None, }, - fixes: [ - CodeAction { - title: "consider prefixing with an underscore: `_foo`", - group: None, - kind: Some( - CodeActionKind( - "quickfix", - ), - ), - edit: Some( - SnippetWorkspaceEdit { - changes: Some( - { - Url { - scheme: "file", - cannot_be_a_base: false, - username: "", - password: None, - host: None, - port: None, - path: "/test/driver/subcommand/repl.rs", - query: None, - fragment: None, - }: [ - TextEdit { - range: Range { - start: Position { - line: 290, - character: 8, - }, - end: Position { - line: 290, - character: 11, - }, - }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + action: CodeAction { + title: "consider prefixing with an underscore: `_foo`", + group: None, + kind: Some( + CodeActionKind( + "quickfix", + ), + ), + edit: Some( + SnippetWorkspaceEdit { + changes: Some( + { + Url { + scheme: "file", + cannot_be_a_base: false, + username: "", + password: None, + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }: [ + TextEdit { + range: Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + new_text: "_foo", + }, + ], + }, + ), + document_changes: None, + change_annotations: None, + }, + ), + is_preferred: Some( + true, + ), + data: None, + }, }, - ], + ), }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt index 5ea27a15275..8ec92888ce1 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt @@ -88,7 +88,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -179,6 +179,6 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, ] diff --git a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt index f77abde5155..d7987f65eda 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt @@ -114,7 +114,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -205,7 +205,7 @@ tags: None, data: None, }, - fixes: [], + fix: None, }, MappedRustDiagnostic { url: Url { @@ -296,68 +296,92 @@ tags: None, data: None, }, - fixes: [ - CodeAction { - title: "return the expression directly: `(0..10).collect()`", - group: None, - kind: Some( - CodeActionKind( - "quickfix", - ), - ), - edit: Some( - SnippetWorkspaceEdit { - changes: Some( - { - Url { - scheme: "file", - cannot_be_a_base: false, - username: "", - password: None, - host: None, - port: None, - path: "/test/src/main.rs", - query: None, - fragment: None, - }: [ - TextEdit { - range: Range { - start: Position { - line: 2, - character: 4, - }, - end: Position { - line: 2, - character: 30, - }, - }, - new_text: "", - }, - TextEdit { - range: Range { - start: Position { - line: 3, - character: 4, - }, - end: Position { - line: 3, - character: 5, - }, - }, - new_text: "(0..10).collect()", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 2, + character: 4, + }, + end: Position { + line: 2, + character: 30, + }, }, - ), - is_preferred: Some( - true, - ), - data: None, + Range { + start: Position { + line: 3, + character: 4, + }, + end: Position { + line: 3, + character: 5, + }, + }, + ], + action: CodeAction { + title: "return the expression directly: `(0..10).collect()`", + group: None, + kind: Some( + CodeActionKind( + "quickfix", + ), + ), + edit: Some( + SnippetWorkspaceEdit { + changes: Some( + { + Url { + scheme: "file", + cannot_be_a_base: false, + username: "", + password: None, + host: None, + port: None, + path: "/test/src/main.rs", + query: None, + fragment: None, + }: [ + TextEdit { + range: Range { + start: Position { + line: 2, + character: 4, + }, + end: Position { + line: 2, + character: 30, + }, + }, + new_text: "", + }, + TextEdit { + range: Range { + start: Position { + line: 3, + character: 4, + }, + end: Position { + line: 3, + character: 5, + }, + }, + new_text: "(0..10).collect()", + }, + ], + }, + ), + document_changes: None, + change_annotations: None, + }, + ), + is_preferred: Some( + true, + ), + data: None, + }, }, - ], + ), }, ]