File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ if exists (' g:loaded_syntastic_swift_swiftpm_checker' )
2
+ finish
3
+ endif
4
+ let g: loaded_syntastic_swift_swiftpm_checker = 1
5
+
6
+ if ! exists (' g:syntastic_swift_swiftpm_executable' )
7
+ let g: syntastic_swift_swiftpm_executable = ' swift'
8
+ endif
9
+
10
+ if ! exists (' g:syntastic_swift_swiftpm_arguments' )
11
+ let g: syntastic_swift_swiftpm_arguments = ' build'
12
+ endif
13
+
14
+ let s: save_cpo = &cpo
15
+ set cpo &vim
16
+
17
+ function ! SyntaxCheckers_swift_swiftpm_IsAvailable () dict
18
+ if ! executable (self .getExec ())
19
+ return 0
20
+ endif
21
+
22
+ return filereadable (' Package.swift' )
23
+ endfunction
24
+
25
+ function ! SyntaxCheckers_swift_swiftpm_GetLocList () dict
26
+ let makeprg = self .makeprgBuild ({
27
+ \ ' fname' : ' ' ,
28
+ \ ' args' : g: syntastic_swift_swiftpm_arguments })
29
+
30
+ let errorformat =
31
+ \ ' %f:%l:%c: error: %m'
32
+
33
+ return SyntasticMake ({
34
+ \ ' makeprg' : makeprg ,
35
+ \ ' errorformat' : errorformat })
36
+ endfunction
37
+
38
+ call g: SyntasticRegistry .CreateAndRegisterChecker ({
39
+ \ ' filetype' : ' swift' ,
40
+ \ ' name' : ' swiftpm' ,
41
+ \ ' exec' : g: syntastic_swift_swiftpm_executable })
42
+
43
+ let &cpo = s: save_cpo
44
+ unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments