Updated plugins
This commit is contained in:
parent
31b9fa01a5
commit
8c9210dca4
32 changed files with 251 additions and 149 deletions
|
@ -67,7 +67,8 @@ function! syntastic#c#GetLocList(filetype, subchecker, options)
|
|||
return []
|
||||
endtry
|
||||
|
||||
let makeprg = expand(g:syntastic_{a:filetype}_compiler) . ' ' . flags . ' ' . syntastic#util#shexpand('%')
|
||||
let makeprg = syntastic#util#shexpand(g:syntastic_{a:filetype}_compiler) .
|
||||
\ ' ' . flags . ' ' . syntastic#util#shexpand('%')
|
||||
|
||||
let errorformat = s:GetCheckerVar('g', a:filetype, a:subchecker, 'errorformat', a:options['errorformat'])
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ function! syntastic#log#debugShowOptions(level, names)
|
|||
|
||||
let vlist = type(a:names) == type("") ? [a:names] : a:names
|
||||
if !empty(vlist)
|
||||
call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))")
|
||||
call map(copy(vlist), "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))")
|
||||
echomsg leader . join(vlist, ', ')
|
||||
endif
|
||||
call s:logRedirect(0)
|
||||
|
|
|
@ -52,6 +52,13 @@ function! syntastic#util#parseShebang()
|
|||
return { 'exe': '', 'args': [] }
|
||||
endfunction
|
||||
|
||||
" Get the value of a variable. Allow local variables to override global ones.
|
||||
function! syntastic#util#var(name)
|
||||
return
|
||||
\ exists('b:syntastic_' . a:name) ? b:syntastic_{a:name} :
|
||||
\ exists('g:syntastic_' . a:name) ? g:syntastic_{a:name} : ''
|
||||
endfunction
|
||||
|
||||
" Parse a version string. Return an array of version components.
|
||||
function! syntastic#util#parseVersion(version)
|
||||
return split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.')
|
||||
|
@ -214,11 +221,11 @@ endfunction
|
|||
|
||||
function! s:translateFilter(filters)
|
||||
let conditions = []
|
||||
for [k, v] in items(a:filters)
|
||||
if type(v) == type([])
|
||||
call extend(conditions, map(copy(v), 's:translateElement(k, v:val)'))
|
||||
for k in keys(a:filters)
|
||||
if type(a:filters[k]) == type([])
|
||||
call extend(conditions, map(copy(a:filters[k]), 's:translateElement(k, v:val)'))
|
||||
else
|
||||
call add(conditions, s:translateElement(k, v))
|
||||
call add(conditions, s:translateElement(k, a:filters[k]))
|
||||
endif
|
||||
endfor
|
||||
return len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
|
||||
|
|
|
@ -498,6 +498,16 @@ When set, debugging messages are written to the file named by its value, in
|
|||
addition to being added to Vim's |message-history|: >
|
||||
let g:syntastic_debug_file = '~/syntastic.log'
|
||||
<
|
||||
*'syntastic_extra_filetypes'*
|
||||
Default: []
|
||||
List of filetypes handled by checkers external to syntastic. If you have a Vim
|
||||
plugin that adds a checker for syntastic, and if the said checker deals with a
|
||||
filetype that is unknown to syntastic, you might consider adding that filetype
|
||||
to this list: >
|
||||
let g:syntastic_extra_filetypes = [ 'make', 'gitcommit' ]
|
||||
<
|
||||
This will allow |:SyntasticInfo| to do proper tab completion for the new
|
||||
filetypes.
|
||||
|
||||
==============================================================================
|
||||
5. Checker Options *syntastic-checker-options*
|
||||
|
@ -557,7 +567,9 @@ The result is a 'makeprg' of the form: >
|
|||
*'syntastic_<filetype>_<subchecker>_exe'*
|
||||
All arguments above are optional, and can be overridden by setting global
|
||||
variables 'g:syntastic_<filetype>_<checker-name>_<option-name>' - even
|
||||
parameters not specified in the call to makeprgBuild().
|
||||
parameters not specified in the call to makeprgBuild(). These variables also
|
||||
have local versions 'b:syntastic_<filetype>_<checker-name>_<option-name>',
|
||||
which take precedence over the global ones in the corresponding buffers.
|
||||
|
||||
The 'exe' is normally the same as the 'exec' attribute described above, in
|
||||
which case it may be omitted. However, you can use it to add environment
|
||||
|
|
|
@ -105,6 +105,20 @@ if exists("g:syntastic_quiet_warnings")
|
|||
endif
|
||||
endif
|
||||
|
||||
let s:debug_dump_options = [
|
||||
\ 'shell',
|
||||
\ 'shellcmdflag',
|
||||
\ 'shellpipe',
|
||||
\ 'shellquote',
|
||||
\ 'shellredir',
|
||||
\ 'shellslash',
|
||||
\ 'shelltemp',
|
||||
\ 'shellxquote'
|
||||
\ ]
|
||||
if v:version > 703 || (v:version == 703 && has('patch446'))
|
||||
call add(s:debug_dump_options, 'shellxescape')
|
||||
endif
|
||||
|
||||
|
||||
" debug constants
|
||||
let g:SyntasticDebugTrace = 1
|
||||
|
@ -283,24 +297,21 @@ function! s:CacheErrors(checkers)
|
|||
let active_checkers = 0
|
||||
let names = []
|
||||
|
||||
call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, [
|
||||
\ 'shell', 'shellcmdflag', 'shellquote', 'shellxquote', 'shellredir',
|
||||
\ 'shellslash', 'shellpipe', 'shelltemp', 'shellxescape', 'shellxquote' ])
|
||||
call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, s:debug_dump_options)
|
||||
call syntastic#log#debugDump(g:SyntasticDebugVariables)
|
||||
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'syntastic_aggregate_errors')
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, 'getcwd() = ' . getcwd())
|
||||
|
||||
let filetypes = s:ResolveFiletypes()
|
||||
let aggregate_errors =
|
||||
\ exists('b:syntastic_aggregate_errors') ? b:syntastic_aggregate_errors : g:syntastic_aggregate_errors
|
||||
let decorate_errors = (aggregate_errors || len(filetypes) > 1) &&
|
||||
\ (exists('b:syntastic_id_checkers') ? b:syntastic_id_checkers : g:syntastic_id_checkers)
|
||||
let aggregate_errors = syntastic#util#var('aggregate_errors')
|
||||
let decorate_errors = (aggregate_errors || len(filetypes) > 1) && syntastic#util#var('id_checkers')
|
||||
|
||||
for ft in filetypes
|
||||
let clist = empty(a:checkers) ? s:registry.getActiveCheckers(ft) : s:registry.getCheckers(ft, a:checkers)
|
||||
|
||||
for checker in clist
|
||||
let active_checkers += 1
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, "CacheErrors: Invoking checker: " . checker.getName())
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . checker.getName())
|
||||
|
||||
let loclist = checker.getLocList()
|
||||
|
||||
|
@ -342,11 +353,11 @@ function! s:CacheErrors(checkers)
|
|||
endif
|
||||
endif
|
||||
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "aggregated:", newLoclist)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'aggregated:', newLoclist)
|
||||
|
||||
if type(g:syntastic_quiet_messages) == type({}) && !empty(g:syntastic_quiet_messages)
|
||||
call newLoclist.quietMessages(g:syntastic_quiet_messages)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "filtered by g:syntastic_quiet_messages:", newLoclist)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'filtered by g:syntastic_quiet_messages:', newLoclist)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -456,11 +467,11 @@ function! SyntasticMake(options)
|
|||
let $LC_ALL = old_lc_all
|
||||
let $LC_MESSAGES = old_lc_messages
|
||||
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "checker output:", err_lines)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'checker output:', err_lines)
|
||||
|
||||
if has_key(a:options, 'preprocess')
|
||||
let err_lines = call(a:options['preprocess'], [err_lines])
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "preprocess:", err_lines)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess:', err_lines)
|
||||
endif
|
||||
lgetexpr err_lines
|
||||
|
||||
|
@ -480,7 +491,7 @@ function! SyntasticMake(options)
|
|||
call syntastic#util#redraw(g:syntastic_full_redraws)
|
||||
endif
|
||||
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "raw loclist:", errors)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'raw loclist:', errors)
|
||||
|
||||
if has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
|
||||
throw 'Syntastic: checker error'
|
||||
|
@ -499,7 +510,7 @@ function! SyntasticMake(options)
|
|||
for rule in a:options['postprocess']
|
||||
let errors = call('syntastic#postprocess#' . rule, [errors])
|
||||
endfor
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "postprocess:", errors)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess:', errors)
|
||||
endif
|
||||
|
||||
return errors
|
||||
|
|
|
@ -21,9 +21,7 @@ function! g:SyntasticBalloonsNotifier.New()
|
|||
endfunction
|
||||
|
||||
function! g:SyntasticBalloonsNotifier.enabled()
|
||||
return
|
||||
\ has('balloon_eval') &&
|
||||
\ (exists('b:syntastic_enable_balloons') ? b:syntastic_enable_balloons : g:syntastic_enable_balloons)
|
||||
return has('balloon_eval') && syntastic#util#var('enable_balloons')
|
||||
endfunction
|
||||
|
||||
" Update the error balloons
|
||||
|
|
|
@ -76,14 +76,14 @@ function! g:SyntasticChecker.getLocList()
|
|||
endfunction
|
||||
|
||||
function! g:SyntasticChecker.makeprgBuild(opts)
|
||||
let setting = 'g:syntastic_' . self._filetype . '_' . self._name . '_'
|
||||
let basename = self._filetype . '_' . self._name . '_'
|
||||
|
||||
let parts = []
|
||||
call extend(parts, self._getOpt(a:opts, setting, 'exe', self.getExecEscaped()))
|
||||
call extend(parts, self._getOpt(a:opts, setting, 'args', ''))
|
||||
call extend(parts, self._getOpt(a:opts, setting, 'fname', syntastic#util#shexpand('%')))
|
||||
call extend(parts, self._getOpt(a:opts, setting, 'post_args', ''))
|
||||
call extend(parts, self._getOpt(a:opts, setting, 'tail', ''))
|
||||
call extend(parts, self._getOpt(a:opts, basename, 'exe', self.getExecEscaped()))
|
||||
call extend(parts, self._getOpt(a:opts, basename, 'args', ''))
|
||||
call extend(parts, self._getOpt(a:opts, basename, 'fname', syntastic#util#shexpand('%')))
|
||||
call extend(parts, self._getOpt(a:opts, basename, 'post_args', ''))
|
||||
call extend(parts, self._getOpt(a:opts, basename, 'tail', ''))
|
||||
|
||||
return join(parts)
|
||||
endfunction
|
||||
|
@ -115,11 +115,11 @@ function! g:SyntasticChecker._populateHighlightRegexes(errors)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticChecker._getOpt(opts, setting, name, default)
|
||||
let sname = a:setting . a:name
|
||||
function! g:SyntasticChecker._getOpt(opts, basename, name, default)
|
||||
let user_val = syntastic#util#var(a:basename . a:name)
|
||||
let ret = []
|
||||
call extend( ret, self._shescape(get(a:opts, a:name . '_before', '')) )
|
||||
call extend( ret, self._shescape(exists(sname) ? {sname} : get(a:opts, a:name, a:default)) )
|
||||
call extend( ret, self._shescape(user_val != '' ? user_val : get(a:opts, a:name, a:default)) )
|
||||
call extend( ret, self._shescape(get(a:opts, a:name . '_after', '')) )
|
||||
|
||||
return ret
|
||||
|
|
|
@ -17,7 +17,7 @@ function! g:SyntasticCursorNotifier.New()
|
|||
endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.enabled()
|
||||
return exists('b:syntastic_echo_current_error') ? b:syntastic_echo_current_error : g:syntastic_echo_current_error
|
||||
return syntastic#util#var('echo_current_error')
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.refresh(loclist)
|
||||
|
|
|
@ -28,9 +28,7 @@ function! g:SyntasticHighlightingNotifier.New()
|
|||
endfunction
|
||||
|
||||
function! g:SyntasticHighlightingNotifier.enabled()
|
||||
return
|
||||
\ s:has_highlighting &&
|
||||
\ (exists('b:syntastic_enable_highlighting') ? b:syntastic_enable_highlighting : g:syntastic_enable_highlighting)
|
||||
return s:has_highlighting && syntastic#util#var('enable_highlighting')
|
||||
endfunction
|
||||
|
||||
" Sets error highlights in the cuirrent window
|
||||
|
|
|
@ -48,9 +48,7 @@ function! g:SyntasticSignsNotifier.New()
|
|||
endfunction
|
||||
|
||||
function! g:SyntasticSignsNotifier.enabled()
|
||||
return
|
||||
\ has('signs') &&
|
||||
\ exists('b:syntastic_enable_signs') ? b:syntastic_enable_signs : g:syntastic_enable_signs
|
||||
return has('signs') && syntastic#util#var('enable_signs')
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticSignsNotifier.refresh(loclist)
|
||||
|
|
|
@ -28,6 +28,10 @@ endif
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_cppcheck_Preprocess(errors)
|
||||
return map(copy(a:errors), 'substitute(v:val, ''\v^\[[^]]+\]\zs( -\> \[[^]]+\])+\ze:'', "", "")')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_cppcheck_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_cppcheck_config_file),
|
||||
|
@ -46,6 +50,7 @@ function! SyntaxCheckers_c_cppcheck_GetLocList() dict
|
|||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'SyntaxCheckers_c_cppcheck_Preprocess',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
|
|
|
@ -15,10 +15,6 @@ if exists('g:loaded_syntastic_c_gcc_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_c_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_c_compiler = executable('gcc') ? 'gcc' : 'clang'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_compiler_options')
|
||||
let g:syntastic_c_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
@ -27,6 +23,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_gcc_IsAvailable() dict
|
||||
if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_c_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
|
||||
endif
|
||||
return executable(expand(g:syntastic_c_compiler))
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -21,48 +21,11 @@ if exists("g:loaded_syntastic_cpp_cppcheck_checker")
|
|||
endif
|
||||
let g:loaded_syntastic_cpp_cppcheck_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cppcheck_config_file')
|
||||
let g:syntastic_cppcheck_config_file = '.syntastic_cppcheck_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cpp_cppcheck_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': syntastic#c#ReadConfig(g:syntastic_cppcheck_config_file),
|
||||
\ 'args_after': '-q --enable=style' })
|
||||
|
||||
let errorformat =
|
||||
\ '[%f:%l]: (%trror) %m,' .
|
||||
\ '[%f:%l]: (%tarning) %m,' .
|
||||
\ '[%f:%l]: (%ttyle) %m,' .
|
||||
\ '[%f:%l]: (%terformance) %m,' .
|
||||
\ '[%f:%l]: (%tortability) %m,' .
|
||||
\ '[%f:%l]: (%tnformation) %m,' .
|
||||
\ '[%f:%l]: (%tnconclusive) %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] =~? '\m^[SPI]'
|
||||
let e['type'] = 'w'
|
||||
let e['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'cppcheck'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
\ 'name': 'cppcheck',
|
||||
\ 'redirect': 'c/cppcheck'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
||||
|
|
|
@ -15,10 +15,6 @@ if exists('g:loaded_syntastic_cpp_gcc_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_cpp_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cpp_compiler')
|
||||
let g:syntastic_cpp_compiler = executable('g++') ? 'g++' : 'clang++'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_cpp_compiler_options')
|
||||
let g:syntastic_cpp_compiler_options = ''
|
||||
endif
|
||||
|
@ -27,6 +23,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cpp_gcc_IsAvailable() dict
|
||||
if !exists('g:syntastic_cpp_compiler')
|
||||
let g:syntastic_cpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang++'
|
||||
endif
|
||||
return executable(expand(g:syntastic_cpp_compiler))
|
||||
endfunction
|
||||
|
||||
|
@ -47,7 +46,8 @@ endfunction
|
|||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'gcc' })
|
||||
\ 'name': 'gcc',
|
||||
\ 'exec': 'g++' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
"============================================================================
|
||||
"File: syntaxerl.vim
|
||||
"Description: Syntax checking plugin for syntastic.
|
||||
"Maintainer: locojay
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_erlang_syntaxerl_checker")
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:loaded_syntastic_erlang_syntaxerl_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
function! SyntaxCheckers_erlang_syntaxerl_GetLocList() dict
|
||||
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat =
|
||||
\ '%W%f:%l: warning: %m,'.
|
||||
\ '%E%f:%l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'erlang',
|
||||
\ 'name': 'syntaxerl'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
|
@ -15,19 +15,18 @@ if exists("g:loaded_syntastic_eruby_ruby_checker")
|
|||
endif
|
||||
let g:loaded_syntastic_eruby_ruby_checker = 1
|
||||
|
||||
if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = "ruby"
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
|
||||
if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = self.getExec()
|
||||
endif
|
||||
return executable(expand(g:syntastic_ruby_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
||||
let exe = expand(g:syntastic_ruby_exec)
|
||||
let exe = syntastic#util#shexpand(g:syntastic_ruby_exec)
|
||||
if !syntastic#util#isRunningWindows()
|
||||
let exe = 'RUBYOPT= ' . exe
|
||||
endif
|
||||
|
@ -35,7 +34,7 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
|||
let fname = "'" . escape(expand('%'), "\\'") . "'"
|
||||
|
||||
" TODO: encodings became useful in ruby 1.9 :)
|
||||
if syntastic#util#versionIsAtLeast(syntastic#util#getVersion('ruby --version'), [1, 9])
|
||||
if syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [1, 9])
|
||||
let enc = &fileencoding != '' ? &fileencoding : &encoding
|
||||
let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
|
||||
else
|
||||
|
|
|
@ -50,11 +50,15 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
|||
" compiled by `go build`, therefore `go test` must be called for those.
|
||||
if match(expand('%'), '\m_test\.go$') == -1
|
||||
let makeprg = 'go build ' . syntastic#c#NullOutput()
|
||||
let cleanup = 0
|
||||
else
|
||||
let makeprg = 'go test -c ' . syntastic#c#NullOutput()
|
||||
let cleanup = 1
|
||||
endif
|
||||
|
||||
" The first pattern is for warnings from C compilers.
|
||||
let errorformat =
|
||||
\ '%W%f:%l: warning: %m,' .
|
||||
\ '%E%f:%l:%c:%m,' .
|
||||
\ '%E%f:%l:%m,' .
|
||||
\ '%C%\s%\+%m,' .
|
||||
|
@ -70,6 +74,10 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
|||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
|
||||
if cleanup
|
||||
call delete(expand('%:p:h') . syntastic#util#Slash() . expand('%:p:h:t') . '.test')
|
||||
endif
|
||||
|
||||
return errors
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -15,20 +15,19 @@ if exists('g:loaded_syntastic_haml_haml_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_haml_haml_checker = 1
|
||||
|
||||
if !exists('g:syntastic_haml_interpreter')
|
||||
let g:syntastic_haml_interpreter = 'haml'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haml_haml_IsAvailable() dict
|
||||
if !exists('g:syntastic_haml_interpreter')
|
||||
let g:syntastic_haml_interpreter = self.getExec()
|
||||
endif
|
||||
return executable(expand(g:syntastic_haml_interpreter))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haml_haml_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': expand(g:syntastic_haml_interpreter),
|
||||
\ 'exe': syntastic#util#shexpand(g:syntastic_haml_interpreter),
|
||||
\ 'args_after': '-c' })
|
||||
|
||||
let errorformat =
|
||||
|
|
|
@ -226,7 +226,7 @@ function! s:GetMavenProperties()
|
|||
let pom = findfile("pom.xml", ".;")
|
||||
if s:has_maven && filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
|
||||
let mvn_cmd = expand(g:syntastic_java_maven_executable) . ' -f ' . pom
|
||||
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) . ' -f ' . pom
|
||||
let mvn_is_managed_tag = 1
|
||||
let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n")
|
||||
let current_path = 'project'
|
||||
|
@ -265,7 +265,7 @@ function! s:GetMavenClasspath()
|
|||
let pom = findfile("pom.xml", ".;")
|
||||
if s:has_maven && filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom)
|
||||
let mvn_cmd = expand(g:syntastic_java_maven_executable) . ' -f ' . pom
|
||||
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) . ' -f ' . pom
|
||||
let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n")
|
||||
let mvn_classpath = ''
|
||||
let class_path_next = 0
|
||||
|
|
|
@ -14,10 +14,6 @@ if exists('g:loaded_syntastic_javascript_jshint_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_javascript_jshint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_jshint_exec')
|
||||
let g:syntastic_jshint_exec = 'jshint'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_javascript_jshint_conf')
|
||||
let g:syntastic_javascript_jshint_conf = ''
|
||||
endif
|
||||
|
@ -26,17 +22,21 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
|
||||
if !exists('g:syntastic_jshint_exec')
|
||||
let g:syntastic_jshint_exec = self.getExec()
|
||||
endif
|
||||
return executable(expand(g:syntastic_jshint_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_GetLocList() dict
|
||||
let exe = syntastic#util#shexpand(g:syntastic_jshint_exec)
|
||||
if !exists('s:jshint_new')
|
||||
let s:jshint_new =
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(expand(g:syntastic_jshint_exec) . ' --version'), [1, 1])
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [1, 1])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': expand(g:syntastic_jshint_exec),
|
||||
\ 'exe': exe,
|
||||
\ 'args': (g:syntastic_javascript_jshint_conf != '' ? '--config ' . g:syntastic_javascript_jshint_conf : ''),
|
||||
\ 'args_after': (s:jshint_new ? '--verbose ' : '') })
|
||||
|
||||
|
|
|
@ -33,17 +33,17 @@ endif
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if g:syntastic_less_use_less_lint
|
||||
let s:check_file = 'node ' . syntastic#util#shescape(expand('<sfile>:p:h') . syntastic#util#Slash() . 'less-lint.js')
|
||||
else
|
||||
let s:check_file = 'lessc'
|
||||
endif
|
||||
let s:node_file = 'node ' . syntastic#util#shescape(expand('<sfile>:p:h') . syntastic#util#Slash() . 'less-lint.js')
|
||||
|
||||
function! SyntaxCheckers_less_lessc_IsAvailable() dict
|
||||
return g:syntastic_less_use_less_lint ? executable('node') : executable('lessc')
|
||||
return g:syntastic_less_use_less_lint ? executable('node') : executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_less_lessc_GetLocList() dict
|
||||
if !exists('s:check_file')
|
||||
let s:check_file = g:syntastic_less_use_less_lint ? s:node_file : self.getExecEscaped()
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': s:check_file,
|
||||
\ 'args': g:syntastic_less_options,
|
||||
|
|
|
@ -15,10 +15,6 @@ if exists('g:loaded_syntastic_objc_gcc_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_objc_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_objc_compiler')
|
||||
let g:syntastic_objc_compiler = executable('gcc') ? 'gcc' : 'clang'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_objc_compiler_options')
|
||||
let g:syntastic_objc_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
@ -27,6 +23,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_objc_gcc_IsAvailable() dict
|
||||
if !exists('g:syntastic_objc_compiler')
|
||||
let g:syntastic_objc_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
|
||||
endif
|
||||
return executable(expand(g:syntastic_objc_compiler))
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -15,10 +15,6 @@ if exists('g:loaded_syntastic_objcpp_gcc_checker')
|
|||
endif
|
||||
let g:loaded_syntastic_objcpp_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_objcpp_compiler')
|
||||
let g:syntastic_objcpp_compiler = executable('gcc') ? 'gcc' : 'clang'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_objcpp_compiler_options')
|
||||
let g:syntastic_objcpp_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
@ -27,6 +23,9 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_objcpp_gcc_IsAvailable() dict
|
||||
if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_objcpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
|
||||
endif
|
||||
return executable(expand(g:syntastic_objcpp_compiler))
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ set cpo&vim
|
|||
function! SyntaxCheckers_perl_perl_IsAvailable() dict
|
||||
" don't call executable() here, to allow things like
|
||||
" let g:syntastic_perl_interpreter='/usr/bin/env perl'
|
||||
silent! call system(expand(g:syntastic_perl_interpreter) . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
silent! call system(syntastic#util#shexpand(g:syntastic_perl_interpreter) . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
|
@ -63,7 +63,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
|
|||
call syntastic#log#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
let includes = split(g:syntastic_perl_lib_path, ',')
|
||||
else
|
||||
let includes = copy(exists('b:syntastic_perl_lib_path') ? b:syntastic_perl_lib_path : g:syntastic_perl_lib_path)
|
||||
let includes = copy(syntastic#util#var('perl_lib_path'))
|
||||
endif
|
||||
let shebang = syntastic#util#parseShebang()
|
||||
let extra = join(map(includes, '"-I" . v:val')) .
|
||||
|
|
|
@ -58,7 +58,9 @@ function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'post_args_before': 'text codesize,design,unusedcode,naming' })
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args_before': 'text',
|
||||
\ 'post_args': 'codesize,design,unusedcode,naming' })
|
||||
|
||||
let errorformat = '%E%f:%l%\s%#%m'
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ endif
|
|||
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
|
||||
return
|
||||
\ executable("puppet") &&
|
||||
\ executable("puppet-lint") &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('puppet-lint --version 2>' .
|
||||
\ syntastic#util#DevNull()), [0,1,10])
|
||||
\ executable(self.getExec()) &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
|
||||
\ self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull()), [0,1,10])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_GetLocList() dict
|
||||
|
|
|
@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_ruby_mri_checker")
|
|||
endif
|
||||
let g:loaded_syntastic_ruby_mri_checker = 1
|
||||
|
||||
if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = "ruby"
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
@ -32,7 +28,11 @@ function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_GetLocList() dict
|
||||
let exe = expand(g:syntastic_ruby_exec)
|
||||
if !exists('g:syntastic_ruby_exec')
|
||||
let g:syntastic_ruby_exec = self.getExec()
|
||||
endif
|
||||
|
||||
let exe = syntastic#util#shexpand(g:syntastic_ruby_exec)
|
||||
if !syntastic#util#isRunningWindows()
|
||||
let exe = 'RUBYOPT= ' . exe
|
||||
endif
|
||||
|
|
|
@ -17,13 +17,21 @@ let g:loaded_syntastic_scss_scss_lint_checker = 1
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict
|
||||
return
|
||||
\ executable(self.getExec()) &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
|
||||
\ self.getExecEscaped() . ' --version'), [0, 12])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
let errorformat = '%f:%l [%t] %m'
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style'})
|
||||
\ 'subtype': 'Style',
|
||||
\ 'returns': [0, 1, 65] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
|
|
@ -18,17 +18,15 @@ let g:loaded_syntastic_slim_slimrb_checker = 1
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:SlimrbVersion()
|
||||
if !exists('s:slimrb_version')
|
||||
let s:slimrb_version = syntastic#util#getVersion('slimrb --version 2>' . syntastic#util#DevNull())
|
||||
endif
|
||||
return s:slimrb_version
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_slim_slimrb_GetLocList() dict
|
||||
if !exists('s:slimrb_new')
|
||||
let s:slimrb_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
|
||||
\ self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull()), [1, 3, 1])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-c' })
|
||||
|
||||
if syntastic#util#versionIsAtLeast(s:SlimrbVersion(), [1,3,1])
|
||||
if s:slimrb_new
|
||||
let errorformat =
|
||||
\ '%C\ %#%f\, Line %l\, Column %c,'.
|
||||
\ '%-G\ %.%#,'.
|
||||
|
|
|
@ -80,7 +80,7 @@ function! s:vimlintOutput(filename, pos, ev, eid, mes, obj)
|
|||
\ 'vcol': 0,
|
||||
\ 'type': a:ev[0],
|
||||
\ 'text': '[' . a:eid . '] ' . a:mes,
|
||||
\ 'valid': 1 })
|
||||
\ 'valid': a:pos.lnum > 0 })
|
||||
endfunction
|
||||
" @vimlint(EVL103, 0, a:filename)
|
||||
|
||||
|
|
|
@ -16,10 +16,6 @@ if exists("g:loaded_syntastic_yaml_yamlxs_checker")
|
|||
endif
|
||||
let g:loaded_syntastic_yaml_yamlxs_checker = 1
|
||||
|
||||
if !exists('g:syntastic_perl_interpreter')
|
||||
let g:syntastic_perl_interpreter = 'perl'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_perl_lib_path')
|
||||
let g:syntastic_perl_lib_path = []
|
||||
endif
|
||||
|
@ -28,6 +24,10 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_yaml_yamlxs_IsAvailable() dict
|
||||
if !exists('g:syntastic_perl_interpreter')
|
||||
let g:syntastic_perl_interpreter = self.getExec()
|
||||
endif
|
||||
|
||||
" don't call executable() here, to allow things like
|
||||
" let g:syntastic_perl_interpreter='/usr/bin/env perl'
|
||||
silent! call system(s:Exe() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)'))
|
||||
|
@ -54,7 +54,7 @@ function! SyntaxCheckers_yaml_yamlxs_GetLocList() dict
|
|||
endfunction
|
||||
|
||||
function! s:Exe()
|
||||
return expand(g:syntastic_perl_interpreter)
|
||||
return syntastic#util#shexpand(g:syntastic_perl_interpreter)
|
||||
endfunction
|
||||
|
||||
function s:Modules()
|
||||
|
@ -62,7 +62,7 @@ function s:Modules()
|
|||
call syntastic#log#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
let includes = split(g:syntastic_perl_lib_path, ',')
|
||||
else
|
||||
let includes = copy(exists('b:syntastic_perl_lib_path') ? b:syntastic_perl_lib_path : g:syntastic_perl_lib_path)
|
||||
let includes = copy(syntastic#util#var('perl_lib_path'))
|
||||
endif
|
||||
return join(map(includes, '"-I" . v:val') + ['-MYAML::XS'])
|
||||
endfunction
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
" vim-airline companion theme of Hybrid
|
||||
" (https://github.com/w0ng/vim-hybrid)
|
||||
|
||||
let g:airline#themes#hybrid#palette = {}
|
||||
|
||||
function! airline#themes#hybrid#refresh()
|
||||
let s:N1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:N2 = airline#themes#get_highlight('CursorLine')
|
||||
let s:N3 = airline#themes#get_highlight('PMenu')
|
||||
let g:airline#themes#hybrid#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.normal_modified = {
|
||||
\ 'airline_c': airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#hybrid#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffText', 'bg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellLocal', 'bg'], 'bold')
|
||||
let s:I3 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellCap', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#hybrid#palette.insert_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.insert.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.insert_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#hybrid#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let replace_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.replace_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.replace.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.replace_modified.airline_warning = g:airline#themes#hybrid#palette.replace_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Text', 'fg'], ['Folded', 'bg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V3 = airline#themes#get_highlight2(['Text', 'fg'], ['Error', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#hybrid#palette.visual_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.visual.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.visual_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#hybrid#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#hybrid#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#hybrid#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#hybrid#refresh()
|
Loading…
Reference in a new issue