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