More detailed debugging.
Moved logging functions to autoload/syntastic/log.vim. Cleanup debug functions. Add a function to dump option variables.
This commit is contained in:
parent
bbd382ba5d
commit
7b36f9147f
170
autoload/syntastic/log.vim
Normal file
170
autoload/syntastic/log.vim
Normal file
@ -0,0 +1,170 @@
|
||||
if exists("g:loaded_syntastic_log_autoload")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_log_autoload = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists("g:syntastic_debug")
|
||||
let g:syntastic_debug = 0
|
||||
endif
|
||||
|
||||
let s:deprecation_notices_issued = []
|
||||
|
||||
" Public functions {{{1
|
||||
|
||||
function! syntastic#log#info(msg)
|
||||
echomsg "syntastic: info: " . a:msg
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#warn(msg)
|
||||
echohl WarningMsg
|
||||
echomsg "syntastic: warning: " . a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#error(msg)
|
||||
execute "normal \<Esc>"
|
||||
echohl ErrorMsg
|
||||
echomsg "syntastic: error: " . a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#deprecationWarn(msg)
|
||||
if index(s:deprecation_notices_issued, a:msg) >= 0
|
||||
return
|
||||
endif
|
||||
|
||||
call add(s:deprecation_notices_issued, a:msg)
|
||||
call syntastic#log#warn(a:msg)
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#debug(level, msg, ...)
|
||||
if !s:isDebugEnabled(a:level)
|
||||
return
|
||||
endif
|
||||
|
||||
let leader = s:logTimestamp()
|
||||
call s:logRedirect(1)
|
||||
|
||||
if a:0 > 0
|
||||
" filter out dictionary functions
|
||||
echomsg leader . a:msg . ' ' .
|
||||
\ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ?
|
||||
\ filter(copy(a:1), 'type(v:val) != type(function("tr"))') : a:1))
|
||||
else
|
||||
echomsg leader . a:msg
|
||||
endif
|
||||
|
||||
call s:logRedirect(0)
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#debugShowOptions(level, names)
|
||||
if !s:isDebugEnabled(a:level)
|
||||
return
|
||||
endif
|
||||
|
||||
let leader = s:logTimestamp()
|
||||
call s:logRedirect(1)
|
||||
|
||||
let vlist = type(a:names) == type("") ? [a:names] : a:names
|
||||
if !empty(vlist)
|
||||
call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))")
|
||||
echomsg leader . join(vlist, ', ')
|
||||
endif
|
||||
call s:logRedirect(0)
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#debugShowVariables(level, names)
|
||||
if !s:isDebugEnabled(a:level)
|
||||
return
|
||||
endif
|
||||
|
||||
let leader = s:logTimestamp()
|
||||
call s:logRedirect(1)
|
||||
|
||||
let vlist = type(a:names) == type("") ? [a:names] : a:names
|
||||
for name in vlist
|
||||
echomsg leader . s:formatVariable(name)
|
||||
endfor
|
||||
|
||||
call s:logRedirect(0)
|
||||
endfunction
|
||||
|
||||
function! syntastic#log#debugDump(level)
|
||||
if !s:isDebugEnabled(a:level)
|
||||
return
|
||||
endif
|
||||
|
||||
let vars = [
|
||||
\ 'syntastic_aggregate_errors',
|
||||
\ 'syntastic_always_populate_loc_list',
|
||||
\ 'syntastic_auto_jump',
|
||||
\ 'syntastic_auto_loc_list',
|
||||
\ 'syntastic_check_on_open',
|
||||
\ 'syntastic_check_on_wq',
|
||||
\ 'syntastic_debug',
|
||||
\ 'syntastic_delayed_redraws',
|
||||
\ 'syntastic_echo_current_error',
|
||||
\ 'syntastic_enable_balloons',
|
||||
\ 'syntastic_enable_highlighting',
|
||||
\ 'syntastic_enable_signs',
|
||||
\ 'syntastic_error_symbol',
|
||||
\ 'syntastic_filetype_map',
|
||||
\ 'syntastic_full_redraws',
|
||||
\ 'syntastic_id_checkers',
|
||||
\ 'syntastic_ignore_files',
|
||||
\ 'syntastic_loc_list_height',
|
||||
\ 'syntastic_mode_map',
|
||||
\ 'syntastic_quiet_warnings',
|
||||
\ 'syntastic_reuse_loc_lists',
|
||||
\ 'syntastic_stl_format',
|
||||
\ 'syntastic_style_error_symbol',
|
||||
\ 'syntastic_style_warning_symbol',
|
||||
\ 'syntastic_warning_symbol' ]
|
||||
|
||||
call syntastic#log#debugShowVariables(a:level, vars)
|
||||
endfunction
|
||||
|
||||
" Private functions {{{1
|
||||
|
||||
function! s:isDebugEnabled(level)
|
||||
" poor man's bit test for bit N, assuming a:level == 2**N
|
||||
return (g:syntastic_debug / a:level) % 2
|
||||
endfunction
|
||||
|
||||
function! s:logRedirect(on)
|
||||
if exists("g:syntastic_debug_file")
|
||||
if a:on
|
||||
try
|
||||
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file))
|
||||
catch /^Vim\%((\a\+)\)\=:/
|
||||
silent! redir END
|
||||
unlet g:syntastic_debug_file
|
||||
endtry
|
||||
else
|
||||
silent! redir END
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:logTimestamp()
|
||||
return 'syntastic: ' . ( has('reltime') ? split(reltimestr(reltime(g:syntastic_start)))[0] : 'debug' ) . ': '
|
||||
endfunction
|
||||
|
||||
function! s:formatVariable(name)
|
||||
let vals = []
|
||||
if exists('g:' . a:name)
|
||||
call add(vals, 'g:' . a:name . ' = ' . strtrans(string(g:{a:name})))
|
||||
endif
|
||||
if exists('b:' . a:name)
|
||||
call add(vals, 'b:' . a:name . ' = ' . strtrans(string(b:{a:name})))
|
||||
endif
|
||||
|
||||
return join(vals, ', ')
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: set et sts=4 sw=4 fdm=marker:
|
@ -6,15 +6,10 @@ let g:loaded_syntastic_util_autoload = 1
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists("g:syntastic_debug")
|
||||
let g:syntastic_debug = 0
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_delayed_redraws")
|
||||
let g:syntastic_delayed_redraws = 0
|
||||
endif
|
||||
|
||||
let s:deprecationNoticesIssued = []
|
||||
let s:redraw_delayed = 0
|
||||
let s:redraw_full = 0
|
||||
|
||||
@ -31,6 +26,8 @@ if g:syntastic_delayed_redraws
|
||||
augroup END
|
||||
endif
|
||||
|
||||
" Public functions {{{1
|
||||
|
||||
function! syntastic#util#DevNull()
|
||||
if has('win32')
|
||||
return 'NUL'
|
||||
@ -208,7 +205,7 @@ endfunction
|
||||
" Vim segfault, so move redraws to a CursorHold / CursorHoldI handler.
|
||||
function! syntastic#util#redraw(full)
|
||||
if !g:syntastic_delayed_redraws || !pumvisible()
|
||||
call s:Redraw(a:full)
|
||||
call s:doRedraw(a:full)
|
||||
let s:redraw_delayed = 0
|
||||
let s:redraw_full = 0
|
||||
else
|
||||
@ -219,94 +216,13 @@ endfunction
|
||||
|
||||
function! syntastic#util#redrawHandler()
|
||||
if s:redraw_delayed && !pumvisible()
|
||||
call s:Redraw(s:redraw_full)
|
||||
call s:doRedraw(s:redraw_full)
|
||||
let s:redraw_delayed = 0
|
||||
let s:redraw_full = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#debug(level, msg, ...)
|
||||
" poor man's bit test for bit N, assuming a:level == 2**N
|
||||
if (g:syntastic_debug / a:level) % 2
|
||||
if has('reltime')
|
||||
let leader = 'syntastic: ' . split(reltimestr(reltime(g:syntastic_start)))[0] . ': '
|
||||
else
|
||||
let leader = 'syntastic: debug: '
|
||||
endif
|
||||
if exists("g:syntastic_debug_file")
|
||||
try
|
||||
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file))
|
||||
catch /^Vim\%((\a\+)\)\=:/
|
||||
unlet g:syntastic_debug_file
|
||||
silent! redir END
|
||||
endtry
|
||||
endif
|
||||
|
||||
if a:0 > 0
|
||||
" filter out dictionary functions
|
||||
echomsg leader . a:msg .
|
||||
\ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ?
|
||||
\ filter(copy(a:1), 'type(v:val) != type(function("tr"))') : a:1))
|
||||
else
|
||||
echomsg leader . a:msg
|
||||
endif
|
||||
|
||||
if exists("g:syntastic_debug_file")
|
||||
silent! redir END
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#showVariables(level, names)
|
||||
let vlist = type(a:names) == type("") ? [a:names] : a:names
|
||||
for name in vlist
|
||||
let vals = []
|
||||
if exists('g:' . name)
|
||||
call add(vals, 'g:' . name . ' = ' . strtrans(string(g:{name})))
|
||||
endif
|
||||
if exists('b:' . name)
|
||||
call add(vals, 'b:' . name . ' = ' . strtrans(string(b:{name})))
|
||||
endif
|
||||
|
||||
if !empty(vals)
|
||||
call syntastic#util#debug(a:level, join(vals, ', '))
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#showOptions(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 syntastic#util#debug(a:level, join(vlist, ', '))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#info(msg)
|
||||
echomsg "syntastic: info: " . a:msg
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#warn(msg)
|
||||
echohl WarningMsg
|
||||
echomsg "syntastic: warning: " . a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#error(msg)
|
||||
execute "normal \<Esc>"
|
||||
echohl ErrorMsg
|
||||
echomsg "syntastic: error: " . a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#deprecationWarn(msg)
|
||||
if index(s:deprecationNoticesIssued, a:msg) >= 0
|
||||
return
|
||||
endif
|
||||
|
||||
call add(s:deprecationNoticesIssued, a:msg)
|
||||
call syntastic#util#warn(a:msg)
|
||||
endfunction
|
||||
" Private functions {{{1
|
||||
|
||||
"Redraw in a way that doesnt make the screen flicker or leave anomalies behind.
|
||||
"
|
||||
@ -315,7 +231,7 @@ endfunction
|
||||
"
|
||||
"However, on some versions of gvim using `redraw!` causes the screen to
|
||||
"flicker - so use redraw.
|
||||
function! s:Redraw(full)
|
||||
function! s:doRedraw(full)
|
||||
if a:full
|
||||
redraw!
|
||||
else
|
||||
@ -325,4 +241,4 @@ endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: set et sts=4 sw=4:
|
||||
" vim: set et sts=4 sw=4 fdm=marker:
|
||||
|
@ -401,10 +401,11 @@ Default: 0
|
||||
Set this to the sum of one or more of the following flags to enable
|
||||
debugging:
|
||||
|
||||
1 - trace checker calls
|
||||
2 - dump loclists
|
||||
4 - trace notifiers
|
||||
8 - trace autocommands
|
||||
1 - trace checker calls
|
||||
2 - dump loclists
|
||||
4 - trace notifiers
|
||||
8 - trace autocommands
|
||||
16 - dump variables
|
||||
|
||||
Example: >
|
||||
let g:syntastic_debug = 1
|
||||
|
@ -25,7 +25,7 @@ let s:running_windows = has("win16") || has("win32")
|
||||
|
||||
for feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
|
||||
if !has(feature)
|
||||
call syntastic#util#error("need Vim compiled with feature " . feature)
|
||||
call syntastic#log#error("need Vim compiled with feature " . feature)
|
||||
finish
|
||||
endif
|
||||
endfor
|
||||
@ -34,7 +34,7 @@ if !s:running_windows && executable('uname')
|
||||
try
|
||||
let s:uname = system('uname')
|
||||
catch /^Vim\%((\a\+)\)\=:E484/
|
||||
call syntastic#util#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
|
||||
call syntastic#log#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
|
||||
finish
|
||||
endtry
|
||||
endif
|
||||
@ -150,20 +150,20 @@ endif
|
||||
|
||||
function! s:BufReadPostHook()
|
||||
if g:syntastic_check_on_open
|
||||
call syntastic#util#debug(g:SyntasticDebugAutocommands,
|
||||
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
||||
\ 'autocmd: BufReadPost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
|
||||
call s:UpdateErrors(1)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:BufWritePostHook()
|
||||
call syntastic#util#debug(g:SyntasticDebugAutocommands,
|
||||
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
||||
\ 'autocmd: BufWritePost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
|
||||
call s:UpdateErrors(1)
|
||||
endfunction
|
||||
|
||||
function! s:BufWinEnterHook()
|
||||
call syntastic#util#debug(g:SyntasticDebugAutocommands,
|
||||
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
||||
\ 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
|
||||
\ ', &buftype = ' . string(&buftype))
|
||||
if empty(&buftype)
|
||||
@ -173,7 +173,7 @@ function! s:BufWinEnterHook()
|
||||
endfunction
|
||||
|
||||
function! s:BufEnterHook()
|
||||
call syntastic#util#debug(g:SyntasticDebugAutocommands,
|
||||
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
||||
\ 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
|
||||
\ ', &buftype = ' . string(&buftype))
|
||||
" TODO: at this point there is no b:syntastic_loclist
|
||||
@ -185,7 +185,7 @@ function! s:BufEnterHook()
|
||||
endfunction
|
||||
|
||||
function! s:QuitPreHook()
|
||||
call syntastic#util#debug(g:SyntasticDebugAutocommands,
|
||||
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
||||
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
|
||||
let b:syntastic_skip_checks = !g:syntastic_check_on_wq
|
||||
call g:SyntasticLoclistHide()
|
||||
@ -240,9 +240,10 @@ function! s:CacheErrors(...)
|
||||
let active_checkers = 0
|
||||
let names = []
|
||||
|
||||
call syntastic#util#showOptions(g:SyntasticDebugTrace,
|
||||
call syntastic#log#debugShowOptions(g:SyntasticDebugTrace,
|
||||
\ ['shell', 'shellcmdflag', 'shellxquote', 'shellredir', 'shellslash'])
|
||||
call syntastic#util#showVariables(g:SyntasticDebugTrace, 'syntastic_aggregate_errors')
|
||||
call syntastic#log#debugDump(g:SyntasticDebugVariables)
|
||||
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'syntastic_aggregate_errors')
|
||||
|
||||
let aggregate_errors =
|
||||
\ exists('b:syntastic_aggregate_errors') ? b:syntastic_aggregate_errors : g:syntastic_aggregate_errors
|
||||
@ -259,7 +260,7 @@ function! s:CacheErrors(...)
|
||||
|
||||
for checker in checkers
|
||||
let active_checkers += 1
|
||||
call syntastic#util#debug(g:SyntasticDebugTrace, "CacheErrors: Invoking checker: " . checker.getName())
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, "CacheErrors: Invoking checker: " . checker.getName())
|
||||
|
||||
let loclist = checker.getLocList()
|
||||
|
||||
@ -292,13 +293,13 @@ function! s:CacheErrors(...)
|
||||
|
||||
if !active_checkers
|
||||
if a:0
|
||||
call syntastic#util#warn('checker ' . a:1 . ' is not active for filetype ' . &filetype)
|
||||
call syntastic#log#warn('checker ' . a:1 . ' is not active for filetype ' . &filetype)
|
||||
else
|
||||
call syntastic#util#debug(g:SyntasticDebugTrace, 'CacheErrors: no active checkers for filetype ' . &filetype)
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: no active checkers for filetype ' . &filetype)
|
||||
endif
|
||||
endif
|
||||
|
||||
call syntastic#util#debug(g:SyntasticDebugLoclist, "aggregated:", newLoclist)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "aggregated:", newLoclist)
|
||||
endif
|
||||
|
||||
let b:syntastic_loclist = newLoclist
|
||||
@ -416,7 +417,7 @@ endfunction
|
||||
" 'cwd' - change directory to the given path before running the checker
|
||||
" 'returns' - a list of valid exit codes for the checker
|
||||
function! SyntasticMake(options)
|
||||
call syntastic#util#debug(g:SyntasticDebugTrace, 'SyntasticMake: called with options:', a:options)
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, 'SyntasticMake: called with options:', a:options)
|
||||
|
||||
let old_shell = &shell
|
||||
let old_shellredir = &shellredir
|
||||
@ -447,11 +448,11 @@ function! SyntasticMake(options)
|
||||
let $LC_ALL = old_lc_all
|
||||
let $LC_MESSAGES = old_lc_messages
|
||||
|
||||
call syntastic#util#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#util#debug(g:SyntasticDebugLoclist, "preprocess:", err_lines)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "preprocess:", err_lines)
|
||||
endif
|
||||
lgetexpr err_lines
|
||||
|
||||
@ -471,7 +472,7 @@ function! SyntasticMake(options)
|
||||
call syntastic#util#redraw(g:syntastic_full_redraws)
|
||||
endif
|
||||
|
||||
call syntastic#util#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'
|
||||
@ -490,7 +491,7 @@ function! SyntasticMake(options)
|
||||
endfor
|
||||
if do_ignore
|
||||
call filter(errors, '!ignored[v:val["bufnr"]]')
|
||||
call syntastic#util#debug(g:SyntasticDebugLoclist, "filtered loclist:", errors)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "filtered loclist:", errors)
|
||||
endif
|
||||
|
||||
" Add subtype info if present.
|
||||
@ -502,7 +503,7 @@ function! SyntasticMake(options)
|
||||
for rule in a:options['postprocess']
|
||||
let errors = call('syntastic#postprocess#' . rule, [errors])
|
||||
endfor
|
||||
call syntastic#util#debug(g:SyntasticDebugLoclist, "postprocess:", errors)
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, "postprocess:", errors)
|
||||
endif
|
||||
|
||||
return errors
|
||||
|
@ -17,12 +17,12 @@ function! g:SyntasticAutoloclistNotifier.New()
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticAutoloclistNotifier.refresh(loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'autoloclist: refresh')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'autoloclist: refresh')
|
||||
call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'autoloclist: toggle')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'autoloclist: toggle')
|
||||
if a:loclist.hasErrorsOrWarningsToDisplay()
|
||||
if g:syntastic_auto_loc_list == 1
|
||||
call a:loclist.show()
|
||||
|
@ -30,7 +30,7 @@ endfunction
|
||||
function! g:SyntasticBalloonsNotifier.refresh(loclist)
|
||||
let b:syntastic_balloons = {}
|
||||
if self.enabled() && a:loclist.hasErrorsOrWarningsToDisplay()
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'balloons: refresh')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: refresh')
|
||||
let buf = bufnr('')
|
||||
let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf')
|
||||
if !empty(issues)
|
||||
@ -49,7 +49,7 @@ endfunction
|
||||
" Reset the error balloons
|
||||
function! g:SyntasticBalloonsNotifier.reset(loclist)
|
||||
if has('balloon_eval')
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'balloons: reset')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: reset')
|
||||
set nobeval
|
||||
endif
|
||||
endfunction
|
||||
|
@ -58,11 +58,11 @@ endfunction
|
||||
function! g:SyntasticChecker.getLocList()
|
||||
try
|
||||
let list = self._locListFunc()
|
||||
call syntastic#util#debug(g:SyntasticDebugTrace,
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace,
|
||||
\ 'getLocList: checker ' . self._filetype . '/' . self._name . ' returned ' . v:shell_error)
|
||||
catch /\m\C^Syntastic: checker error$/
|
||||
let list = []
|
||||
call syntastic#util#error('checker ' . self._filetype . '/' . self._name . ' returned abnormal status ' . v:shell_error)
|
||||
call syntastic#log#error('checker ' . self._filetype . '/' . self._name . ' returned abnormal status ' . v:shell_error)
|
||||
endtry
|
||||
call self._populateHighlightRegexes(list)
|
||||
return g:SyntasticLoclist.New(list)
|
||||
|
@ -22,7 +22,7 @@ endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.refresh(loclist)
|
||||
if self.enabled() && a:loclist.hasErrorsOrWarningsToDisplay()
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'cursor: refresh')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: refresh')
|
||||
let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
|
||||
let b:oldLine = -1
|
||||
autocmd! syntastic CursorMoved
|
||||
@ -31,7 +31,7 @@ function! g:SyntasticCursorNotifier.refresh(loclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.reset(loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'cursor: reset')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: reset')
|
||||
autocmd! syntastic CursorMoved
|
||||
unlet! b:syntastic_messages
|
||||
let b:oldLine = -1
|
||||
|
@ -29,7 +29,7 @@ endfunction
|
||||
function! g:SyntasticHighlightingNotifier.refresh(loclist)
|
||||
if self.enabled()
|
||||
call self.reset(a:loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'highlighting: refresh')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: refresh')
|
||||
let buf = bufnr('')
|
||||
let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf')
|
||||
for item in issues
|
||||
@ -56,7 +56,7 @@ endfunction
|
||||
" Remove all error highlights from the window
|
||||
function! g:SyntasticHighlightingNotifier.reset(loclist)
|
||||
if s:has_highlighting
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
|
||||
for match in getmatches()
|
||||
if stridx(match['group'], 'Syntastic') == 0
|
||||
call matchdelete(match['id'])
|
||||
|
@ -149,7 +149,7 @@ endfunction
|
||||
|
||||
"display the cached errors for this buf in the location list
|
||||
function! g:SyntasticLoclist.show()
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'loclist: show')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: show')
|
||||
if !exists('w:syntastic_loclist_set')
|
||||
let w:syntastic_loclist_set = 0
|
||||
endif
|
||||
@ -185,7 +185,7 @@ endfunction
|
||||
" Non-method functions {{{1
|
||||
|
||||
function! g:SyntasticLoclistHide()
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'loclist: hide')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: hide')
|
||||
silent! lclose
|
||||
endfunction
|
||||
|
||||
|
@ -19,7 +19,7 @@ function! g:SyntasticNotifiers.Instance()
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticNotifiers.refresh(loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'notifiers: refresh')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'notifiers: refresh')
|
||||
for type in self._enabled_types
|
||||
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
|
||||
if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled()
|
||||
@ -29,7 +29,7 @@ function! g:SyntasticNotifiers.refresh(loclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticNotifiers.reset(loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'notifiers: reset')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'notifiers: reset')
|
||||
for type in self._enabled_types
|
||||
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
|
||||
|
||||
|
@ -239,7 +239,7 @@ endfunction
|
||||
function! g:SyntasticRegistry._userHasFiletypeSettings(filetype)
|
||||
if exists("g:syntastic_" . a:filetype . "_checker") && !exists("g:syntastic_" . a:filetype . "_checkers")
|
||||
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
|
||||
call syntastic#util#deprecationWarn("variable g:syntastic_" . a:filetype . "_checker is deprecated")
|
||||
call syntastic#log#deprecationWarn("variable g:syntastic_" . a:filetype . "_checker is deprecated")
|
||||
endif
|
||||
return exists("b:syntastic_checkers") || exists("g:syntastic_" . a:filetype . "_checkers")
|
||||
endfunction
|
||||
|
@ -54,7 +54,7 @@ function! g:SyntasticSignsNotifier.enabled()
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticSignsNotifier.refresh(loclist)
|
||||
call syntastic#util#debug(g:SyntasticDebugNotifications, 'signs: refresh')
|
||||
call syntastic#log#debug(g:SyntasticDebugNotifications, 'signs: refresh')
|
||||
let old_signs = copy(self._bufSignIds())
|
||||
if self.enabled()
|
||||
call self._signErrors(a:loclist)
|
||||
|
@ -49,7 +49,7 @@ function! s:GhcModNew(exe)
|
||||
let ghc_mod_version = filter(split(system(a:exe), '\n'), 'v:val =~# ''\m^ghc-mod version''')[0]
|
||||
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(ghc_mod_version), [2, 1, 2])
|
||||
catch /^Vim\%((\a\+)\)\=:E684/
|
||||
call syntastic#util#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
|
||||
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
|
||||
let ret = -1
|
||||
endtry
|
||||
return ret
|
||||
|
@ -54,7 +54,7 @@ endfunction
|
||||
function! SyntaxCheckers_perl_perl_GetLocList() dict
|
||||
let exe = expand(g:syntastic_perl_interpreter)
|
||||
if type(g:syntastic_perl_lib_path) == type('')
|
||||
call syntastic#util#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
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)
|
||||
|
@ -17,7 +17,7 @@ let g:loaded_syntastic_puppet_puppetlint_checker=1
|
||||
|
||||
if exists("g:syntastic_puppet_lint_arguments")
|
||||
let g:syntastic_puppet_puppetlint_args = g:syntastic_puppet_lint_arguments
|
||||
call syntastic#util#deprecationWarn("variable g:syntastic_puppet_lint_arguments is deprecated, please use g:syntastic_puppet_puppetlint_args instead")
|
||||
call syntastic#log#deprecationWarn("variable g:syntastic_puppet_lint_arguments is deprecated, please use g:syntastic_puppet_puppetlint_args instead")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
|
||||
|
@ -55,7 +55,7 @@ function! s:PylintNew(exe)
|
||||
let pylint_version = substitute(pylint_version, '\v^\S+\s+', '', '')
|
||||
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1])
|
||||
catch /^Vim\%((\a\+)\)\=:E684/
|
||||
call syntastic#util#error("checker python/pylint: can't parse version string (abnormal termination?)")
|
||||
call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)")
|
||||
let ret = -1
|
||||
endtry
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user