From 637c795b3c9a56795977ade0cedbc7a9fb7dc453 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Thu, 12 Mar 2020 15:01:53 +0100 Subject: Correctly handle multi-line fixes from cargo/clippy --- .../ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap') diff --git a/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap b/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap index 3e1fe736c..8bab09540 100644 --- a/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap +++ b/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap @@ -48,7 +48,7 @@ MappedRustDiagnostic { }, fixes: [ CodeAction { - title: "consider prefixing with an underscore: \'_foo\'", + title: "consider prefixing with an underscore", kind: Some( "quickfix", ), -- cgit v1.2.3 From 98e8ad5e608b739d1d28a43c8c69358e77c1c1f0 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Thu, 12 Mar 2020 15:24:20 +0100 Subject: Handle diagnostics with multiple primary spans --- ...ch__conv__test__snap_rustc_unused_variable.snap | 148 +++++++++++---------- 1 file changed, 75 insertions(+), 73 deletions(-) (limited to 'crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap') diff --git a/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap b/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap index 8bab09540..5989ed202 100644 --- a/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap +++ b/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_rustc_unused_variable.snap @@ -2,83 +2,85 @@ source: crates/ra_cargo_watch/src/conv/test.rs expression: diag --- -MappedRustDiagnostic { - location: Location { - uri: "file:///test/driver/subcommand/repl.rs", - range: Range { - start: Position { - line: 290, - character: 8, - }, - end: Position { - line: 290, - character: 11, +[ + MappedRustDiagnostic { + location: Location { + uri: "file:///test/driver/subcommand/repl.rs", + range: Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, }, }, - }, - diagnostic: Diagnostic { - range: Range { - start: Position { - line: 290, - character: 8, - }, - end: Position { - line: 290, - character: 11, + diagnostic: Diagnostic { + range: Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, }, - }, - severity: Some( - Warning, - ), - code: Some( - String( - "unused_variables", + severity: Some( + Warning, ), - ), - source: Some( - "rustc", - ), - message: "unused variable: `foo`\n#[warn(unused_variables)] on by default", - related_information: None, - tags: Some( - [ - Unnecessary, - ], - ), - }, - fixes: [ - CodeAction { - title: "consider prefixing with an underscore", - kind: Some( - "quickfix", + code: Some( + String( + "unused_variables", + ), ), - diagnostics: None, - edit: Some( - WorkspaceEdit { - changes: Some( - { - "file:///test/driver/subcommand/repl.rs": [ - TextEdit { - range: Range { - start: Position { - line: 290, - character: 8, - }, - end: Position { - line: 290, - character: 11, - }, - }, - new_text: "_foo", - }, - ], - }, - ), - document_changes: None, - }, + source: Some( + "rustc", + ), + message: "unused variable: `foo`\n#[warn(unused_variables)] on by default", + related_information: None, + tags: Some( + [ + Unnecessary, + ], ), - command: None, - is_preferred: None, }, - ], -} + fixes: [ + CodeAction { + title: "consider prefixing with an underscore", + kind: Some( + "quickfix", + ), + diagnostics: None, + edit: Some( + WorkspaceEdit { + changes: Some( + { + "file:///test/driver/subcommand/repl.rs": [ + TextEdit { + range: Range { + start: Position { + line: 290, + character: 8, + }, + end: Position { + line: 290, + character: 11, + }, + }, + new_text: "_foo", + }, + ], + }, + ), + document_changes: None, + }, + ), + command: None, + is_preferred: None, + }, + ], + }, +] -- cgit v1.2.3