Print a message if no active checkers are found.

This commit is contained in:
LCD 47 2013-06-15 07:36:20 +03:00
parent ede4127f13
commit af9d6f627b
2 changed files with 20 additions and 4 deletions

View File

@ -138,13 +138,21 @@ function! syntastic#util#debug(msg)
endif
endfunction
function! syntastic#util#info(msg)
echomsg "syntastic: info: " . a:msg
endfunction
function! syntastic#util#warn(msg)
echomsg "syntastic: warning: " . a:msg
endfunction
function! syntastic#util#deprecationWarn(msg)
if index(s:deprecationNoticesIssued, a:msg) >= 0
return
endif
call add(s:deprecationNoticesIssued, a:msg)
echomsg "syntastic: warning: " . a:msg
call syntastic#util#warn(a:msg)
endfunction
let &cpo = s:save_cpo

View File

@ -162,17 +162,17 @@ function! s:CacheErrors(...)
let newLoclist = g:SyntasticLoclist.New([])
if !s:SkipFile()
let active_checkers = 0
for ft in s:CurrentFiletypes()
if a:0
let checker = s:registry.getChecker(ft, a:1)
if !empty(checker)
let checkers = [checker]
endif
let checkers = !empty(checker) ? [checker] : []
else
let checkers = s:registry.getActiveCheckers(ft)
endif
for checker in checkers
let active_checkers += 1
call syntastic#util#debug("CacheErrors: Invoking checker: " . checker.getName())
let loclist = checker.getLocList()
@ -186,6 +186,14 @@ function! s:CacheErrors(...)
endif
endfor
endfor
if !active_checkers
if a:0
call syntastic#util#warn('checker ' . a:1 . ' is not active for filetype ' . &filetype)
else
call syntastic#util#info('no active checkers for filetype ' . &filetype)
endif
endif
endif
let b:syntastic_loclist = newLoclist