Unnamed repository; edit this file 'description' to name the repository.
Update expected test results
10 files changed, 336 insertions, 256 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 fd04163de9..4610984acb 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", + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 41, + character: 23, + }, + end: Position { + line: 41, + character: 28, + }, + }, + ], + 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, + 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", }, - new_text: "self", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, - }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + }, + ), + 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 a7f936a703..989e5cf66d 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 8bee4cfe10..fe5cf9b3be 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 afc562a0e2..dc36aa761c 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 05074a914b..d557196c2b 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 3ded70411d..46d44192c5 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", + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + ], + 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, + 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", }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, - }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + }, + ), + 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 0993aa1af1..b595487e8f 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", + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + ], + 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, + 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", }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, - }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + }, + ), + 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 d7a974ae57..3ee50392a7 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", + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + ], + 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, + 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", }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, - }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + }, + ), + 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 5ea27a1527..8ec92888ce 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 f77abde515..d7987f65ed 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", + fix: Some( + Fix { + ranges: [ + Range { + start: Position { + line: 2, + character: 4, + }, + end: Position { + line: 2, + character: 30, + }, + }, + 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, + 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: "", }, - new_text: "", - }, - TextEdit { - range: Range { - start: Position { - line: 3, - character: 4, - }, - end: Position { - line: 3, - character: 5, + TextEdit { + range: Range { + start: Position { + line: 3, + character: 4, + }, + end: Position { + line: 3, + character: 5, + }, }, + new_text: "(0..10).collect()", }, - new_text: "(0..10).collect()", - }, - ], - }, - ), - document_changes: None, - change_annotations: None, - }, - ), - is_preferred: Some( - true, - ), - data: None, + ], + }, + ), + document_changes: None, + change_annotations: None, + }, + ), + is_preferred: Some( + true, + ), + data: None, + }, }, - ], + ), }, ] |