diff options
author | notkild <notkild@gmail.com> | 2017-02-06 09:21:06 +0100 |
---|---|---|
committer | notkild <notkild@gmail.com> | 2017-02-06 09:21:06 +0100 |
commit | 0143eb6a53fdf77e6d11b5d714501db2667b3ee2 (patch) | |
tree | 3992cbedadd71bfa1e76f7ba1814b50526bb9230 /ale_linters/rust/rustc.vim | |
parent | 744d7d789f859b70ea5981377600678c0ff4f6c2 (diff) | |
download | ale-0143eb6a53fdf77e6d11b5d714501db2667b3ee2.zip |
Fix rust linting with cargo when multiple targets are present
Diffstat (limited to 'ale_linters/rust/rustc.vim')
-rw-r--r-- | ale_linters/rust/rustc.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ale_linters/rust/rustc.vim b/ale_linters/rust/rustc.vim index 3eeede66..e31b895c 100644 --- a/ale_linters/rust/rustc.vim +++ b/ale_linters/rust/rustc.vim @@ -17,12 +17,20 @@ function! ale_linters#rust#rustc#HandleRustcErrors(buffer_number, errorlines) ab endif let l:error = json_decode(l:errorline) + if !has_key(l:error, 'code') && !has_key(l:error, 'message') + continue + endif + + if has_key(l:error, 'message') + let l:error = l:error.message + endif if !empty(l:error.code) && index(g:ale_rust_ignore_error_codes, l:error.code.code) > -1 continue endif for l:span in l:error.spans + let l:span.file_name = fnamemodify(l:span.file_name, ':t') if l:span.is_primary && \ (l:span.file_name ==# l:file_name || l:span.file_name ==# '<anon>') call add(l:output, { |