add basic deprecation warning system

This commit is contained in:
Martin Grenfell 2013-04-13 17:19:24 +01:00
parent a9938e0afd
commit 49b6012f98
2 changed files with 11 additions and 1 deletions

View File

@ -130,6 +130,16 @@ function! syntastic#util#unique(list)
return keys(seen) return keys(seen)
endfunction endfunction
let s:deprecationNoticesIssued = []
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
endfunction
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set et sts=4 sw=4:

View File

@ -141,7 +141,7 @@ endfunction
function! g:SyntasticRegistry._userHasFiletypeSettings(filetype) function! g:SyntasticRegistry._userHasFiletypeSettings(filetype)
if exists("g:syntastic_" . a:filetype . "_checker") && !exists("g:syntastic_" . a:filetype . "_checkers") if exists("g:syntastic_" . a:filetype . "_checker") && !exists("g:syntastic_" . a:filetype . "_checkers")
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker] let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
echomsg "syntastic: warning: variable g:syntastic_" . a:filetype . "_checker is deprecated" call syntastic#util#deprecationWarn("variable g:syntastic_" . a:filetype . "_checker is deprecated")
endif endif
return exists("b:syntastic_checkers") || exists("g:syntastic_" . a:filetype . "_checkers") return exists("b:syntastic_checkers") || exists("g:syntastic_" . a:filetype . "_checkers")
endfunction endfunction