2017-11-06 16:46:08 -07:00
|
|
|
" Vim compiler file
|
|
|
|
" Compiler: Cargo Compiler
|
|
|
|
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
2023-09-12 13:30:02 -07:00
|
|
|
" Latest Revision: 2023-09-11
|
2024-04-05 20:13:56 -07:00
|
|
|
" 2024 Apr 05 by The Vim Project (removed :CompilerSet definition)
|
2017-11-06 16:46:08 -07:00
|
|
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
|
|
|
|
|
|
|
if exists('current_compiler')
|
2023-09-12 13:30:02 -07:00
|
|
|
finish
|
2017-11-06 16:46:08 -07:00
|
|
|
endif
|
|
|
|
runtime compiler/rustc.vim
|
|
|
|
let current_compiler = "cargo"
|
|
|
|
|
2023-09-12 13:30:02 -07:00
|
|
|
" vint: -ProhibitAbbreviationOption
|
2017-11-06 16:46:08 -07:00
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
2023-09-12 13:30:02 -07:00
|
|
|
" vint: +ProhibitAbbreviationOption
|
2017-11-06 16:46:08 -07:00
|
|
|
|
|
|
|
if exists('g:cargo_makeprg_params')
|
2023-09-12 13:30:02 -07:00
|
|
|
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
2017-11-06 16:46:08 -07:00
|
|
|
else
|
2023-09-12 13:30:02 -07:00
|
|
|
CompilerSet makeprg=cargo\ $*
|
2017-11-06 16:46:08 -07:00
|
|
|
endif
|
|
|
|
|
2023-09-12 13:30:02 -07:00
|
|
|
augroup RustCargoQuickFixHooks
|
|
|
|
autocmd!
|
|
|
|
autocmd QuickFixCmdPre make call cargo#quickfix#CmdPre()
|
|
|
|
autocmd QuickFixCmdPost make call cargo#quickfix#CmdPost()
|
|
|
|
augroup END
|
|
|
|
|
2017-11-06 16:46:08 -07:00
|
|
|
" Ignore general cargo progress messages
|
|
|
|
CompilerSet errorformat+=
|
2023-09-12 13:30:02 -07:00
|
|
|
\%-G%\\s%#Downloading%.%#,
|
|
|
|
\%-G%\\s%#Checking%.%#,
|
|
|
|
\%-G%\\s%#Compiling%.%#,
|
|
|
|
\%-G%\\s%#Finished%.%#,
|
|
|
|
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
|
|
|
\%-G%\\s%#To\ learn\ more\\,%.%#,
|
|
|
|
\%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
|
|
|
|
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
|
|
|
|
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
|
2017-11-06 16:46:08 -07:00
|
|
|
|
2023-09-12 13:30:02 -07:00
|
|
|
" vint: -ProhibitAbbreviationOption
|
2017-11-06 16:46:08 -07:00
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
2023-09-12 13:30:02 -07:00
|
|
|
" vint: +ProhibitAbbreviationOption
|
|
|
|
|
|
|
|
" vim: set et sw=4 sts=4 ts=8:
|