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