Skip to content

Commit 2030019

Browse files
authored
Merge pull request #99 from jpernst/master
Add support for new error format
2 parents fc11d02 + 4dd6704 commit 2030019

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

compiler/cargo.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ function! s:is_absolute(path)
2727
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
2828
endfunction
2929

30-
CompilerSet errorformat+=%-G%\\s%#Compiling%.%#
30+
" Ignore general cargo progress messages
31+
CompilerSet errorformat+=
32+
\%-G%\\s%#Downloading%.%#,
33+
\%-G%\\s%#Compiling%.%#,
34+
\%-G%\\s%#Finished%.%#,
35+
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
36+
\%-G%\\s%#To\ learn\ more\\,%.%#
3137

3238
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
3339
if s:local_manifest != ''

compiler/rustc.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ else
2121
CompilerSet makeprg=rustc\ \%
2222
endif
2323

24+
" Old errorformat (before nightly 2016/08/10)
2425
CompilerSet errorformat=
2526
\%f:%l:%c:\ %t%*[^:]:\ %m,
2627
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
@@ -29,5 +30,16 @@ CompilerSet errorformat=
2930
\%-G%*[\ ]^%*[~],
3031
\%-G%*[\ ]...
3132

33+
" New errorformat (after nightly 2016/08/10)
34+
CompilerSet errorformat+=
35+
\%-G,
36+
\%-Gerror:\ aborting\ %.%#,
37+
\%-Gerror:\ Could\ not\ compile\ %.%#,
38+
\%Eerror:\ %m,
39+
\%Eerror[E%n]:\ %m,
40+
\%Wwarning:\ %m,
41+
\%Inote:\ %m,
42+
\%C\ %#-->\ %f:%l:%c
43+
3244
let &cpo = s:cpo_save
3345
unlet s:cpo_save

syntax_checkers/rust/rustc.vim

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@ set cpo&vim
1616
function! SyntaxCheckers_rust_rustc_GetLocList() dict
1717
let makeprg = self.makeprgBuild({ 'args': '-Zparse-only' })
1818

19+
" Old errorformat (before nightly 2016/08/10)
1920
let errorformat =
2021
\ '%E%f:%l:%c: %\d%#:%\d%# %.%\{-}error:%.%\{-} %m,' .
2122
\ '%W%f:%l:%c: %\d%#:%\d%# %.%\{-}warning:%.%\{-} %m,' .
22-
\ '%C%f:%l %m,' .
23-
\ '%-Z%.%#'
23+
\ '%C%f:%l %m'
24+
25+
" New errorformat (after nightly 2016/08/10)
26+
let errorformat .=
27+
\ ',' .
28+
\ '%-G,' .
29+
\ '%-Gerror: aborting %.%#,' .
30+
\ '%-Gerror: Could not compile %.%#,' .
31+
\ '%Eerror: %m,' .
32+
\ '%Eerror[E%n]: %m,' .
33+
\ '%Wwarning: %m,' .
34+
\ '%Inote: %m,' .
35+
\ '%C %#--> %f:%l:%c'
2436

2537
return SyntasticMake({
2638
\ 'makeprg': makeprg,

0 commit comments

Comments
 (0)