1
0
Fork 0
mirror of synced 2024-11-14 13:08:59 -05:00
ultimate-vim/sources_non_forked/swift.vim/syntax_checkers/swift/swiftpm.vim

45 lines
1 KiB
VimL
Raw Normal View History

2017-03-27 03:44:07 -04:00
if exists('g:loaded_syntastic_swift_swiftpm_checker')
finish
endif
let g:loaded_syntastic_swift_swiftpm_checker = 1
if !exists('g:syntastic_swift_swiftpm_executable')
let g:syntastic_swift_swiftpm_executable = 'swift'
endif
if !exists('g:syntastic_swift_swiftpm_arguments')
let g:syntastic_swift_swiftpm_arguments = 'build'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_swift_swiftpm_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
return filereadable('Package.swift')
endfunction
function! SyntaxCheckers_swift_swiftpm_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'fname': '',
\ 'args': g:syntastic_swift_swiftpm_arguments })
let errorformat =
\ '%f:%l:%c: error: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'swift',
\ 'name': 'swiftpm',
\ 'exec': g:syntastic_swift_swiftpm_executable })
let &cpo = s:save_cpo
unlet s:save_cpo