]> git.lizzy.rs Git - rust.git/blob - src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / tools / rust-analyzer / crates / rust-analyzer / src / diagnostics / test_data / snap_multi_line_fix.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/src/main.rs",
11             query: None,
12             fragment: None,
13         },
14         diagnostic: Diagnostic {
15             range: Range {
16                 start: Position {
17                     line: 3,
18                     character: 4,
19                 },
20                 end: Position {
21                     line: 3,
22                     character: 5,
23                 },
24             },
25             severity: Some(
26                 Warning,
27             ),
28             code: Some(
29                 String(
30                     "let_and_return",
31                 ),
32             ),
33             code_description: Some(
34                 CodeDescription {
35                     href: Url {
36                         scheme: "https",
37                         cannot_be_a_base: false,
38                         username: "",
39                         password: None,
40                         host: Some(
41                             Domain(
42                                 "rust-lang.github.io",
43                             ),
44                         ),
45                         port: None,
46                         path: "/rust-clippy/master/index.html",
47                         query: None,
48                         fragment: Some(
49                             "let_and_return",
50                         ),
51                     },
52                 },
53             ),
54             source: Some(
55                 "clippy",
56             ),
57             message: "returning the result of a let binding from a block\n`#[warn(clippy::let_and_return)]` on by default\nfor further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return",
58             related_information: Some(
59                 [
60                     DiagnosticRelatedInformation {
61                         location: Location {
62                             uri: Url {
63                                 scheme: "file",
64                                 cannot_be_a_base: false,
65                                 username: "",
66                                 password: None,
67                                 host: None,
68                                 port: None,
69                                 path: "/test/src/main.rs",
70                                 query: None,
71                                 fragment: None,
72                             },
73                             range: Range {
74                                 start: Position {
75                                     line: 2,
76                                     character: 4,
77                                 },
78                                 end: Position {
79                                     line: 2,
80                                     character: 30,
81                                 },
82                             },
83                         },
84                         message: "unnecessary let binding",
85                     },
86                     DiagnosticRelatedInformation {
87                         location: Location {
88                             uri: Url {
89                                 scheme: "file",
90                                 cannot_be_a_base: false,
91                                 username: "",
92                                 password: None,
93                                 host: None,
94                                 port: None,
95                                 path: "/test/src/main.rs",
96                                 query: None,
97                                 fragment: None,
98                             },
99                             range: Range {
100                                 start: Position {
101                                     line: 2,
102                                     character: 4,
103                                 },
104                                 end: Position {
105                                     line: 2,
106                                     character: 30,
107                                 },
108                             },
109                         },
110                         message: "return the expression directly: `(0..10).collect()`",
111                     },
112                 ],
113             ),
114             tags: None,
115             data: None,
116         },
117         fix: None,
118     },
119     MappedRustDiagnostic {
120         url: Url {
121             scheme: "file",
122             cannot_be_a_base: false,
123             username: "",
124             password: None,
125             host: None,
126             port: None,
127             path: "/test/src/main.rs",
128             query: None,
129             fragment: None,
130         },
131         diagnostic: Diagnostic {
132             range: Range {
133                 start: Position {
134                     line: 2,
135                     character: 4,
136                 },
137                 end: Position {
138                     line: 2,
139                     character: 30,
140                 },
141             },
142             severity: Some(
143                 Hint,
144             ),
145             code: Some(
146                 String(
147                     "let_and_return",
148                 ),
149             ),
150             code_description: Some(
151                 CodeDescription {
152                     href: Url {
153                         scheme: "https",
154                         cannot_be_a_base: false,
155                         username: "",
156                         password: None,
157                         host: Some(
158                             Domain(
159                                 "rust-lang.github.io",
160                             ),
161                         ),
162                         port: None,
163                         path: "/rust-clippy/master/index.html",
164                         query: None,
165                         fragment: Some(
166                             "let_and_return",
167                         ),
168                     },
169                 },
170             ),
171             source: Some(
172                 "clippy",
173             ),
174             message: "unnecessary let binding",
175             related_information: Some(
176                 [
177                     DiagnosticRelatedInformation {
178                         location: Location {
179                             uri: Url {
180                                 scheme: "file",
181                                 cannot_be_a_base: false,
182                                 username: "",
183                                 password: None,
184                                 host: None,
185                                 port: None,
186                                 path: "/test/src/main.rs",
187                                 query: None,
188                                 fragment: None,
189                             },
190                             range: Range {
191                                 start: Position {
192                                     line: 3,
193                                     character: 4,
194                                 },
195                                 end: Position {
196                                     line: 3,
197                                     character: 5,
198                                 },
199                             },
200                         },
201                         message: "original diagnostic",
202                     },
203                 ],
204             ),
205             tags: None,
206             data: None,
207         },
208         fix: None,
209     },
210     MappedRustDiagnostic {
211         url: Url {
212             scheme: "file",
213             cannot_be_a_base: false,
214             username: "",
215             password: None,
216             host: None,
217             port: None,
218             path: "/test/src/main.rs",
219             query: None,
220             fragment: None,
221         },
222         diagnostic: Diagnostic {
223             range: Range {
224                 start: Position {
225                     line: 2,
226                     character: 4,
227                 },
228                 end: Position {
229                     line: 2,
230                     character: 30,
231                 },
232             },
233             severity: Some(
234                 Hint,
235             ),
236             code: Some(
237                 String(
238                     "let_and_return",
239                 ),
240             ),
241             code_description: Some(
242                 CodeDescription {
243                     href: Url {
244                         scheme: "https",
245                         cannot_be_a_base: false,
246                         username: "",
247                         password: None,
248                         host: Some(
249                             Domain(
250                                 "rust-lang.github.io",
251                             ),
252                         ),
253                         port: None,
254                         path: "/rust-clippy/master/index.html",
255                         query: None,
256                         fragment: Some(
257                             "let_and_return",
258                         ),
259                     },
260                 },
261             ),
262             source: Some(
263                 "clippy",
264             ),
265             message: "return the expression directly: `(0..10).collect()`",
266             related_information: Some(
267                 [
268                     DiagnosticRelatedInformation {
269                         location: Location {
270                             uri: Url {
271                                 scheme: "file",
272                                 cannot_be_a_base: false,
273                                 username: "",
274                                 password: None,
275                                 host: None,
276                                 port: None,
277                                 path: "/test/src/main.rs",
278                                 query: None,
279                                 fragment: None,
280                             },
281                             range: Range {
282                                 start: Position {
283                                     line: 3,
284                                     character: 4,
285                                 },
286                                 end: Position {
287                                     line: 3,
288                                     character: 5,
289                                 },
290                             },
291                         },
292                         message: "original diagnostic",
293                     },
294                 ],
295             ),
296             tags: None,
297             data: None,
298         },
299         fix: Some(
300             Fix {
301                 ranges: [
302                     Range {
303                         start: Position {
304                             line: 2,
305                             character: 4,
306                         },
307                         end: Position {
308                             line: 2,
309                             character: 30,
310                         },
311                     },
312                     Range {
313                         start: Position {
314                             line: 3,
315                             character: 4,
316                         },
317                         end: Position {
318                             line: 3,
319                             character: 5,
320                         },
321                     },
322                 ],
323                 action: CodeAction {
324                     title: "return the expression directly: `(0..10).collect()`",
325                     group: None,
326                     kind: Some(
327                         CodeActionKind(
328                             "quickfix",
329                         ),
330                     ),
331                     command: None,
332                     edit: Some(
333                         SnippetWorkspaceEdit {
334                             changes: Some(
335                                 {
336                                     Url {
337                                         scheme: "file",
338                                         cannot_be_a_base: false,
339                                         username: "",
340                                         password: None,
341                                         host: None,
342                                         port: None,
343                                         path: "/test/src/main.rs",
344                                         query: None,
345                                         fragment: None,
346                                     }: [
347                                         TextEdit {
348                                             range: Range {
349                                                 start: Position {
350                                                     line: 2,
351                                                     character: 4,
352                                                 },
353                                                 end: Position {
354                                                     line: 2,
355                                                     character: 30,
356                                                 },
357                                             },
358                                             new_text: "",
359                                         },
360                                         TextEdit {
361                                             range: Range {
362                                                 start: Position {
363                                                     line: 3,
364                                                     character: 4,
365                                                 },
366                                                 end: Position {
367                                                     line: 3,
368                                                     character: 5,
369                                                 },
370                                             },
371                                             new_text: "(0..10).collect()",
372                                         },
373                                     ],
374                                 },
375                             ),
376                             document_changes: None,
377                             change_annotations: None,
378                         },
379                     ),
380                     is_preferred: Some(
381                         true,
382                     ),
383                     data: None,
384                 },
385             },
386         ),
387     },
388 ]