diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-01-29 13:54:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 13:54:50 +0000 |
commit | c589e3d57d2a4d37445a4b97648c08e1b9741304 (patch) | |
tree | 382ad241a3ea4f048d0b31ddf6b488fad4f3b6ca | |
parent | 1832240cff33a91b0b12d8719b986838c2d36e6a (diff) | |
parent | 863fb60695764a41a6fd8139544938f343f61278 (diff) | |
download | ale-c589e3d57d2a4d37445a4b97648c08e1b9741304.zip |
Merge pull request #1322 from datanoise/master
fixed rust errors parsing
-rw-r--r-- | autoload/ale/handlers/rust.vim | 4 | ||||
-rw-r--r-- | test/handler/test_rust_handler.vader | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/autoload/ale/handlers/rust.vim b/autoload/ale/handlers/rust.vim index 395b915c..537bc731 100644 --- a/autoload/ale/handlers/rust.vim +++ b/autoload/ale/handlers/rust.vim @@ -51,8 +51,8 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort call add(l:output, { \ 'lnum': l:span.line_start, \ 'end_lnum': l:span.line_end, - \ 'col': l:span.byte_start, - \ 'end_col': l:span.byte_end, + \ 'col': l:span.column_start, + \ 'end_col': l:span.column_end, \ 'text': empty(l:span.label) ? l:error.message : printf('%s: %s', l:error.message, l:span.label), \ 'type': toupper(l:error.level[0]), \}) diff --git a/test/handler/test_rust_handler.vader b/test/handler/test_rust_handler.vader index 05bd1e94..e3ab3e86 100644 --- a/test/handler/test_rust_handler.vader +++ b/test/handler/test_rust_handler.vader @@ -7,16 +7,16 @@ Execute(The Rust handler should handle rustc output): \ 'lnum': 15, \ 'end_lnum': 15, \ 'type': 'E', - \ 'col': 418, - \ 'end_col': 421, + \ 'col': 5, + \ 'end_col': 8, \ 'text': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`', \ }, \ { \ 'lnum': 13, \ 'end_lnum': 13, \ 'type': 'E', - \ 'col': 407, - \ 'end_col': 410, + \ 'col': 7, + \ 'end_col': 10, \ 'text': 'no method named `wat` found for type `std::string::String` in the current scope', \ }, \ ], @@ -83,16 +83,16 @@ Execute(The Rust handler should handle cargo output): \ 'lnum': 15, \ 'end_lnum': 15, \ 'type': 'E', - \ 'col': 11505, - \ 'end_col': 11508, + \ 'col': 5, + \ 'end_col': 8, \ 'text': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`', \ }, \ { \ 'lnum': 13, \ 'end_lnum': 13, \ 'type': 'E', - \ 'col': 11494, - \ 'end_col': 11497, + \ 'col': 7, + \ 'end_col': 10, \ 'text': 'no method named `wat` found for type `std::string::String` in the current scope', \ }, \ ], @@ -157,8 +157,8 @@ Execute(The Rust handler should should errors from expansion spans): \ 'lnum': 4, \ 'end_lnum': 4, \ 'type': 'E', - \ 'col': 52, - \ 'end_col': 54, + \ 'col': 21, + \ 'end_col': 23, \ 'text': 'mismatched types: expected bool, found integral variable', \ }, \ ], @@ -207,8 +207,8 @@ Execute(The Rust handler should show detailed errors): \ 'lnum': 4, \ 'end_lnum': 4, \ 'type': 'E', - \ 'col': 52, - \ 'end_col': 54, + \ 'col': 21, + \ 'end_col': 23, \ 'text': 'mismatched types: expected bool, found integral variable', \ }, \ ], |