File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ " Vim syntastic plugin
2
+ " Language: Rust
3
+ " Maintainer: Julien Levesy <jlevesy@gmail.com>
4
+ "
5
+ " See for details on how to add an external Syntastic checker:
6
+ " https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external
7
+
8
+ if exists (" g:loaded_syntastic_rust_cargo_checker" )
9
+ finish
10
+ endif
11
+ let g: loaded_syntastic_rust_cargo_checker = 1
12
+
13
+ let g: syntastic_rust_cargo_fname = " "
14
+
15
+ let s: save_cpo = &cpo
16
+ set cpo &vim
17
+
18
+ function ! SyntaxCheckers_rust_cargo_IsAvailable () dict
19
+ return executable (self .getExec ())
20
+ endfunction
21
+
22
+ function ! SyntaxCheckers_rust_cargo_GetLocList () dict
23
+ let makeprg = self .makeprgBuild ({ " args" : " check" })
24
+
25
+ " Ignored patterns, and blank lines
26
+ let errorformat =
27
+ \ ' %-G,' .
28
+ \ ' %-Gerror: aborting %.%#,' .
29
+ \ ' %-Gerror: Could not compile %.%#,' .
30
+ \ ' %-Gwarning: the option `Z` is unstable %.%#,'
31
+
32
+ " Meaningful lines (errors, notes, warnings, contextual information)
33
+ let errorformat .=
34
+ \ ' %Eerror: %m,' .
35
+ \ ' %Eerror[E%n]: %m,' .
36
+ \ ' %Wwarning: %m,' .
37
+ \ ' %Inote: %m,' .
38
+ \ ' %C %#--> %f:%l:%c'
39
+
40
+ return SyntasticMake ({
41
+ \ ' makeprg' : makeprg ,
42
+ \ ' errorformat' : errorformat })
43
+ endfunction
44
+
45
+ call g: SyntasticRegistry .CreateAndRegisterChecker ({
46
+ \ ' filetype' : ' rust' ,
47
+ \ ' name' : ' cargo' })
48
+
49
+ let &cpo = s: save_cpo
50
+ unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments