Include span label in rust lints (#601)

* Include span label in rust lints

This turns relatively unhelpful error messages like

    mismatched types

into more expressive messages along the lines of

    mismatched types: expected bool, found integral variable

Fixes #597.

* Exclude rust lint span label if empty

* Use single-quoted strings in vimscript

* Add test for detailed rust errors

* Prune Cargo JSON

* Use matching error file name

* Byte offsets not char offsets
This commit is contained in:
Jon Gjengset
2017-05-31 13:16:49 -04:00
committed by w0rp
parent 42efd51723
commit 88948e0ee3
2 changed files with 20 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ function! ale#handlers#rust#HandleRustErrorsForFile(buffer, full_filename, lines
\ 'end_lnum': l:span.line_end,
\ 'col': l:span.byte_start,
\ 'end_col': l:span.byte_end,
\ 'text': l:error.message,
\ 'text': empty(l:span.label) ? l:error.message : printf('%s: %s', l:error.message, l:span.label),
\ 'type': toupper(l:error.level[0]),
\})
else