File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-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
+
12
+ let g: loaded_syntastic_rust_cargo_checker = 1
13
+
14
+ " Force syntastic to call cargo without a specific file name
15
+ let g: syntastic_rust_cargo_fname = " "
16
+
17
+ let s: save_cpo = &cpo
18
+ set cpo &vim
19
+
20
+ function ! SyntaxCheckers_rust_cargo_IsAvailable () dict
21
+ return executable (self .getExec ()) &&
22
+ \ syntastic#util#versionIsAtLeast (self .getVersion (), [0 , 16 , 0 ])
23
+ endfunction
24
+
25
+ function ! SyntaxCheckers_rust_cargo_GetLocList () dict
26
+ let makeprg = self .makeprgBuild ({ " args" : " check" })
27
+
28
+ " Ignored patterns, and blank lines
29
+ let errorformat =
30
+ \ ' %-G,' .
31
+ \ ' %-Gerror: aborting %.%#,' .
32
+ \ ' %-Gerror: Could not compile %.%#,'
33
+
34
+ " Meaningful lines (errors, notes, warnings, contextual information)
35
+ let errorformat .=
36
+ \ ' %Eerror: %m,' .
37
+ \ ' %Eerror[E%n]: %m,' .
38
+ \ ' %Wwarning: %m,' .
39
+ \ ' %Inote: %m,' .
40
+ \ ' %C %#--> %f:%l:%c'
41
+
42
+ return SyntasticMake ({
43
+ \ ' makeprg' : makeprg ,
44
+ \ ' cwd' : expand (' %:p:h' ),
45
+ \ ' errorformat' : errorformat })
46
+ endfunction
47
+
48
+ call g: SyntasticRegistry .CreateAndRegisterChecker ({
49
+ \ ' filetype' : ' rust' ,
50
+ \ ' name' : ' cargo' })
51
+
52
+ let &cpo = s: save_cpo
53
+ unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments