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