]> git.lizzy.rs Git - rust.git/blob - crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt
Merge #7276
[rust.git] / crates / rust-analyzer / src / diagnostics / test_data / rustc_unused_variable_as_info.txt
1 [
2     MappedRustDiagnostic {
3         url: Url {
4             scheme: "file",
5             host: None,
6             port: None,
7             path: "/test/driver/subcommand/repl.rs",
8             query: None,
9             fragment: None,
10         },
11         diagnostic: Diagnostic {
12             range: Range {
13                 start: Position {
14                     line: 290,
15                     character: 8,
16                 },
17                 end: Position {
18                     line: 290,
19                     character: 11,
20                 },
21             },
22             severity: Some(
23                 Information,
24             ),
25             code: Some(
26                 String(
27                     "unused_variables",
28                 ),
29             ),
30             code_description: None,
31             source: Some(
32                 "rustc",
33             ),
34             message: "unused variable: `foo`\n#[warn(unused_variables)] on by default",
35             related_information: Some(
36                 [
37                     DiagnosticRelatedInformation {
38                         location: Location {
39                             uri: Url {
40                                 scheme: "file",
41                                 host: None,
42                                 port: None,
43                                 path: "/test/driver/subcommand/repl.rs",
44                                 query: None,
45                                 fragment: None,
46                             },
47                             range: Range {
48                                 start: Position {
49                                     line: 290,
50                                     character: 8,
51                                 },
52                                 end: Position {
53                                     line: 290,
54                                     character: 11,
55                                 },
56                             },
57                         },
58                         message: "consider prefixing with an underscore",
59                     },
60                 ],
61             ),
62             tags: Some(
63                 [
64                     Unnecessary,
65                 ],
66             ),
67             data: None,
68         },
69         fixes: [],
70     },
71     MappedRustDiagnostic {
72         url: Url {
73             scheme: "file",
74             host: None,
75             port: None,
76             path: "/test/driver/subcommand/repl.rs",
77             query: None,
78             fragment: None,
79         },
80         diagnostic: Diagnostic {
81             range: Range {
82                 start: Position {
83                     line: 290,
84                     character: 8,
85                 },
86                 end: Position {
87                     line: 290,
88                     character: 11,
89                 },
90             },
91             severity: Some(
92                 Hint,
93             ),
94             code: Some(
95                 String(
96                     "unused_variables",
97                 ),
98             ),
99             code_description: None,
100             source: Some(
101                 "rustc",
102             ),
103             message: "consider prefixing with an underscore",
104             related_information: Some(
105                 [
106                     DiagnosticRelatedInformation {
107                         location: Location {
108                             uri: Url {
109                                 scheme: "file",
110                                 host: None,
111                                 port: None,
112                                 path: "/test/driver/subcommand/repl.rs",
113                                 query: None,
114                                 fragment: None,
115                             },
116                             range: Range {
117                                 start: Position {
118                                     line: 290,
119                                     character: 8,
120                                 },
121                                 end: Position {
122                                     line: 290,
123                                     character: 11,
124                                 },
125                             },
126                         },
127                         message: "original diagnostic",
128                     },
129                 ],
130             ),
131             tags: None,
132             data: None,
133         },
134         fixes: [
135             CodeAction {
136                 title: "consider prefixing with an underscore",
137                 group: None,
138                 kind: Some(
139                     CodeActionKind(
140                         "quickfix",
141                     ),
142                 ),
143                 edit: Some(
144                     SnippetWorkspaceEdit {
145                         changes: Some(
146                             {
147                                 Url {
148                                     scheme: "file",
149                                     host: None,
150                                     port: None,
151                                     path: "/test/driver/subcommand/repl.rs",
152                                     query: None,
153                                     fragment: None,
154                                 }: [
155                                     TextEdit {
156                                         range: Range {
157                                             start: Position {
158                                                 line: 290,
159                                                 character: 8,
160                                             },
161                                             end: Position {
162                                                 line: 290,
163                                                 character: 11,
164                                             },
165                                         },
166                                         new_text: "_foo",
167                                     },
168                                 ],
169                             },
170                         ),
171                         document_changes: None,
172                     },
173                 ),
174                 is_preferred: Some(
175                     true,
176                 ),
177                 data: None,
178             },
179         ],
180     },
181 ]