All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_rust_ignore_secondary_spans
4 let g:ale_rust_ignore_secondary_spans = 0
9 Execute(The Rust handler should handle rustc output):
10 call ale#test#SetFilename('src/playpen.rs')
20 \ 'text': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`',
28 \ 'text': 'no method named `wat` found for type `std::string::String` in the current scope',
31 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
35 \ 'message': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`',
40 \ 'file_name': '<anon>',
47 \ 'is_primary': v:true,
53 \ 'message': 'main function not found',
61 \ 'message': 'no method named `wat` found for type `std::string::String` in the current scope',
68 \ 'file_name': '<anon>',
69 \ 'is_primary': v:true,
79 \ 'message': 'aborting due to previous error',
85 Execute(The Rust handler should handle cargo output):
86 call ale#test#SetFilename('src/playpen.rs')
96 \ 'text': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`',
104 \ 'text': 'no method named `wat` found for type `std::string::String` in the current scope',
107 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
114 \ 'message': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`',
118 \ 'byte_start': 11505,
121 \ 'file_name': ale#path#Simplify('src/playpen.rs'),
122 \ 'is_primary': v:true,
134 \ 'message': 'no method named `wat` found for type `std::string::String` in the current scope',
138 \ 'byte_start': 11494,
141 \ 'file_name': ale#path#Simplify('src/playpen.rs'),
142 \ 'is_primary': v:true,
154 \ 'message': 'aborting due to previous error',
161 Execute(The Rust handler should should errors from expansion spans):
170 \ 'text': 'mismatched types: expected bool, found integral variable',
173 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
178 \ 'message': 'mismatched types',
185 \ 'file_name': ale#path#Simplify('src/other.rs'),
186 \ 'is_primary': v:true,
187 \ 'label': 'some other error',
195 \ 'column_start': 21,
196 \ 'file_name': ale#path#Simplify('src/playpen.rs'),
197 \ 'is_primary': v:true,
198 \ 'label': 'expected bool, found integral variable',
209 Execute(The Rust handler should show detailed errors):
210 call ale#test#SetFilename('src/playpen.rs')
220 \ 'text': 'mismatched types: expected bool, found integral variable',
223 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
230 \ 'message': 'mismatched types',
236 \ 'column_start': 21,
237 \ 'expansion': v:null,
238 \ 'file_name': ale#path#Simplify('src/playpen.rs'),
239 \ 'is_primary': v:true,
240 \ 'label': 'expected bool, found integral variable',
251 \ 'message': 'aborting due to previous error(s)',
258 Execute(The Rust handler should show detailed clippy errors with rendered field if it's available):
259 call ale#test#SetFilename('src/playpen.rs')
269 \ 'text': 'mismatched types: expected bool, found integral variable',
270 \ 'detail': 'this is a detailed description',
273 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
280 \ 'message': 'mismatched types',
281 \ 'rendered': 'this is a detailed description',
287 \ 'column_start': 21,
288 \ 'expansion': v:null,
289 \ 'file_name': ale#path#Simplify('src/playpen.rs'),
290 \ 'is_primary': v:true,
291 \ 'label': 'expected bool, found integral variable',
302 \ 'message': 'aborting due to previous error(s)',
309 Execute(The Rust handler should find correct files):
310 call ale#test#SetFilename('src/noerrors/mod.rs')
314 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
321 \ 'message': 'unresolved import `Undefined`',
328 \ 'file_name': 'src/haserrors/mod.rs',
329 \ 'is_primary': v:true,
330 \ 'label': 'no `Undefined` in the root',
341 \ 'message': 'aborting due to previous error',
348 Execute(The Rust handler should remove secondary spans if set):
349 call ale#test#SetFilename('src/noerrors/mod.rs')
359 \ 'text': 'this function takes 1 parameter but 0 were supplied: defined here',
367 \ 'text': 'this function takes 1 parameter but 0 were supplied: expected 1 parameter',
370 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
372 \ 'fn test(x: u8) -> u8 { x } fn main() { x(); }',
377 \ 'explanation': 'Dummy explanation; not used'
380 \ 'message': 'this function takes 1 parameter but 0 were supplied',
387 \ 'file_name': 'src/noerrors/mod.rs',
388 \ 'is_primary': v:false,
389 \ 'label': 'defined here',
397 \ 'column_start': 40,
398 \ 'file_name': '<anon>',
399 \ 'is_primary': v:true,
400 \ 'label': 'expected 1 parameter',
411 \ 'message': 'aborting due to previous error',
419 \ 'message': 'For more information about this error, try `rustc --explain E0061`.',
425 let g:ale_rust_ignore_secondary_spans = 1
435 \ 'text': 'this function takes 1 parameter but 0 were supplied: expected 1 parameter',
438 \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
440 \ 'fn test(x: u8) -> u8 { x } fn main() { x(); }',
445 \ 'explanation': 'Dummy explanation; not used'
448 \ 'message': 'this function takes 1 parameter but 0 were supplied',
455 \ 'file_name': 'src/noerrors/mod.rs',
456 \ 'is_primary': v:false,
457 \ 'label': 'defined here',
465 \ 'column_start': 40,
466 \ 'file_name': '<anon>',
467 \ 'is_primary': v:true,
468 \ 'label': 'expected 1 parameter',
479 \ 'message': 'aborting due to previous error',
487 \ 'message': 'For more information about this error, try `rustc --explain E0061`.',