| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | " Vim compiler file | 
					
						
							|  |  |  | " Compiler:         Cargo Compiler | 
					
						
							|  |  |  | " Maintainer:       Damien Radtke <damienradtke@gmail.com> | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  | " Latest Revision:  2023-09-11 | 
					
						
							| 
									
										
										
										
											2024-04-06 01:59:39 +08:00
										 |  |  | "                   2024 Apr 05 by The Vim Project (removed :CompilerSet definition) | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | " For bugs, patches and license go to https://github.com/rust-lang/rust.vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if exists('current_compiler') | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  |     finish | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | endif | 
					
						
							|  |  |  | runtime compiler/rustc.vim | 
					
						
							|  |  |  | let current_compiler = "cargo" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  | " vint: -ProhibitAbbreviationOption | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | let s:save_cpo = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  | " vint: +ProhibitAbbreviationOption | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | if exists('g:cargo_makeprg_params') | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  |     execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*' | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  |     CompilerSet makeprg=cargo\ $* | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  | augroup RustCargoQuickFixHooks | 
					
						
							|  |  |  |     autocmd! | 
					
						
							|  |  |  |     autocmd QuickFixCmdPre make call cargo#quickfix#CmdPre() | 
					
						
							|  |  |  |     autocmd QuickFixCmdPost make call cargo#quickfix#CmdPost() | 
					
						
							|  |  |  | augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | " Ignore general cargo progress messages | 
					
						
							|  |  |  | CompilerSet errorformat+= | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05: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-03-21 19:18:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  | " vint: -ProhibitAbbreviationOption | 
					
						
							| 
									
										
										
										
											2017-03-21 19:18:29 +01:00
										 |  |  | let &cpo = s:save_cpo | 
					
						
							|  |  |  | unlet s:save_cpo | 
					
						
							| 
									
										
										
										
											2023-09-12 13:23:38 -05:00
										 |  |  | " vint: +ProhibitAbbreviationOption | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " vim: set et sw=4 sts=4 ts=8: |