]> git.lizzy.rs Git - rust.git/blobdiff - crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt
Fix tests
[rust.git] / crates / rust-analyzer / src / diagnostics / test_data / rustc_unused_variable_as_info.txt
index c0b79428d89b7bf342ab8cdf6ca31d4aef6049b0..1072d8a17700612f64e138ef138495c4b52de268 100644 (file)
@@ -2,6 +2,9 @@
     MappedRustDiagnostic {
         url: Url {
             scheme: "file",
+            cannot_be_a_base: false,
+            username: "",
+            password: None,
             host: None,
             port: None,
             path: "/test/driver/subcommand/repl.rs",
@@ -20,7 +23,9 @@
                 },
             },
             severity: Some(
-                Information,
+                DiagnosticSeverity(
+                    3,
+                ),
             ),
             code: Some(
                 String(
                 "rustc",
             ),
             message: "unused variable: `foo`\n#[warn(unused_variables)] on by default",
-            related_information: None,
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: 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,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "consider prefixing with an underscore: `_foo`",
+                    },
+                ],
+            ),
             tags: Some(
                 [
-                    Unnecessary,
+                    DiagnosticTag(
+                        1,
+                    ),
+                ],
+            ),
+            data: None,
+        },
+        fixes: [],
+    },
+    MappedRustDiagnostic {
+        url: 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,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 290,
+                    character: 8,
+                },
+                end: Position {
+                    line: 290,
+                    character: 11,
+                },
+            },
+            severity: Some(
+                DiagnosticSeverity(
+                    4,
+                ),
+            ),
+            code: Some(
+                String(
+                    "unused_variables",
+                ),
+            ),
+            code_description: None,
+            source: Some(
+                "rustc",
+            ),
+            message: "consider prefixing with an underscore: `_foo`",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: 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,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
                 ],
             ),
+            tags: None,
             data: None,
         },
         fixes: [
             CodeAction {
-                title: "consider prefixing with an underscore",
+                title: "consider prefixing with an underscore: `_foo`",
                 group: None,
                 kind: Some(
                     CodeActionKind(
                             {
                                 Url {
                                     scheme: "file",
+                                    cannot_be_a_base: false,
+                                    username: "",
+                                    password: None,
                                     host: None,
                                     port: None,
                                     path: "/test/driver/subcommand/repl.rs",
                             },
                         ),
                         document_changes: None,
+                        change_annotations: None,
                     },
                 ),
                 is_preferred: Some(