summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cargo.vim53
-rw-r--r--compiler/rustc.vim12
2 files changed, 19 insertions, 46 deletions
diff --git a/compiler/cargo.vim b/compiler/cargo.vim
index 2902449d..160d214e 100644
--- a/compiler/cargo.vim
+++ b/compiler/cargo.vim
@@ -21,51 +21,12 @@ else
CompilerSet makeprg=cargo\ $*
endif
-" Allow a configurable global Cargo.toml name. This makes it easy to
-" support variations like 'cargo.toml'.
-let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
-
-function! s:is_absolute(path)
- return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
-endfunction
-
-CompilerSet errorformat+=%-G%\\s%#Compiling%.%#
-
-let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
-if s:local_manifest != ''
- let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
- augroup cargo
- au!
- au QuickfixCmdPost make call s:FixPaths()
- augroup END
-
- " FixPaths() is run after Cargo, and is used to change the file paths
- " to be relative to the current directory instead of Cargo.toml.
- function! s:FixPaths()
- let qflist = getqflist()
- let manifest = s:local_manifest
- for qf in qflist
- if !qf.valid
- let m = matchlist(qf.text, '(file://\(.*\))$')
- if !empty(m)
- let manifest = m[1].'/'
- " Manually strip another slash if needed; usually just an
- " issue on Windows.
- if manifest =~ '^/[A-Z]\+:/'
- let manifest = manifest[1:]
- endif
- endif
- continue
- endif
- let filename = bufname(qf.bufnr)
- if s:is_absolute(filename)
- continue
- endif
- let qf.filename = simplify(manifest.filename)
- call remove(qf, 'bufnr')
- endfor
- call setqflist(qflist, 'r')
- endfunction
-endif
+" Ignore general cargo progress messages
+CompilerSet errorformat+=
+ \%-G%\\s%#Downloading%.%#,
+ \%-G%\\s%#Compiling%.%#,
+ \%-G%\\s%#Finished%.%#,
+ \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
+ \%-G%\\s%#To\ learn\ more\\,%.%#
endif
diff --git a/compiler/rustc.vim b/compiler/rustc.vim
index e6a53cda..5c02dd28 100644
--- a/compiler/rustc.vim
+++ b/compiler/rustc.vim
@@ -23,6 +23,7 @@ else
CompilerSet makeprg=rustc\ \%
endif
+" Old errorformat (before nightly 2016/08/10)
CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
@@ -31,6 +32,17 @@ CompilerSet errorformat=
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
+" New errorformat (after nightly 2016/08/10)
+CompilerSet errorformat+=
+ \%-G,
+ \%-Gerror:\ aborting\ %.%#,
+ \%-Gerror:\ Could\ not\ compile\ %.%#,
+ \%Eerror:\ %m,
+ \%Eerror[E%n]:\ %m,
+ \%Wwarning:\ %m,
+ \%Inote:\ %m,
+ \%C\ %#-->\ %f:%l:%c
+
let &cpo = s:cpo_save
unlet s:cpo_save