diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 31f47652..705af493 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.7.0-53' +let g:_SYNTASTIC_VERSION = '3.7.0-54' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/plugin/syntastic/checker.vim b/plugin/syntastic/checker.vim index ab2597e5..6569da62 100644 --- a/plugin/syntastic/checker.vim +++ b/plugin/syntastic/checker.vim @@ -7,26 +7,36 @@ let g:SyntasticChecker = {} " Public methods {{{1 -function! g:SyntasticChecker.New(args) abort " {{{2 +function! g:SyntasticChecker.New(args, ...) abort " {{{2 let newObj = copy(self) let newObj._filetype = a:args['filetype'] let newObj._name = a:args['name'] - let newObj._exec = get(a:args, 'exec', newObj._name) - if has_key(a:args, 'redirect') - let [filetype, name] = split(a:args['redirect'], '/') + if a:0 + " redirected checker + let newObj._exec = get(a:args, 'exec', a:1['_exec']) + + let filetype = a:1['_filetype'] + let name = a:1['_name'] let prefix = 'SyntaxCheckers_' . filetype . '_' . name . '_' if exists('g:syntastic_' . filetype . '_' . name . '_sort') && !exists('g:syntastic_' . newObj._filetype . '_' . newObj._name . '_sort') let g:syntastic_{newObj._filetype}_{newObj._name}_sort = g:syntastic_{filetype}_{name}_sort endif - else - let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_' - endif - if has_key(a:args, 'enable') - let newObj._enable = a:args['enable'] + if has_key(a:args, 'enable') + let newObj._enable = a:args['enable'] + elseif has_key(a:1, '_enable') + let newObj._enable = a:1['_enable'] + endif + else + let newObj._exec = get(a:args, 'exec', newObj._name) + let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_' + + if has_key(a:args, 'enable') + let newObj._enable = a:args['enable'] + endif endif let newObj._locListFunc = function(prefix . 'GetLocList') diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index d46484da..5ad0a192 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -159,8 +159,21 @@ function! g:SyntasticRegistry.Instance() abort " {{{2 endfunction " }}}2 function! g:SyntasticRegistry.CreateAndRegisterChecker(args) abort " {{{2 - let checker = g:SyntasticChecker.New(a:args) let registry = g:SyntasticRegistry.Instance() + + if has_key(a:args, 'redirect') + let [ft, name] = split(a:args['redirect'], '/') + call registry._loadCheckersFor(ft) + + let clone = get(registry._checkerMap[ft], name, {}) + if empty(clone) + throw 'Syntastic: Checker ' . a:args['redirect'] . ' redirects to unregistered checker ' . ft . '/' . name + endif + + let checker = g:SyntasticChecker.New(a:args, clone) + else + let checker = g:SyntasticChecker.New(a:args) + endif call registry._registerChecker(checker) endfunction " }}}2 @@ -195,7 +208,7 @@ function! g:SyntasticRegistry.getCheckersAvailable(ftalias, hints_list) abort " return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isAvailable()') endfunction " }}}2 -" Same as getCheckers(), but keep only the checkers tyhat are available and +" Same as getCheckers(), but keep only the checkers that are available and " disabled. This runs the corresponding IsAvailable() functions for all checkers. function! g:SyntasticRegistry.getCheckersDisabled(ftalias, hints_list) abort " {{{2 return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isDisabled() && v:val.isAvailable()') diff --git a/syntax_checkers/cpp/clang_check.vim b/syntax_checkers/cpp/clang_check.vim index 1a92d4b6..55784bba 100644 --- a/syntax_checkers/cpp/clang_check.vim +++ b/syntax_checkers/cpp/clang_check.vim @@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_clang_check_checker') endif let g:loaded_syntastic_cpp_clang_check_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'cpp', \ 'name': 'clang_check', diff --git a/syntax_checkers/cpp/clang_tidy.vim b/syntax_checkers/cpp/clang_tidy.vim index b45cf753..f6cac96d 100644 --- a/syntax_checkers/cpp/clang_tidy.vim +++ b/syntax_checkers/cpp/clang_tidy.vim @@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_clang_tidy_checker') endif let g:loaded_syntastic_cpp_clang_tidy_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'cpp', \ 'name': 'clang_tidy', diff --git a/syntax_checkers/cpp/cppcheck.vim b/syntax_checkers/cpp/cppcheck.vim index c103d7de..4e0eb86b 100644 --- a/syntax_checkers/cpp/cppcheck.vim +++ b/syntax_checkers/cpp/cppcheck.vim @@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_cppcheck_checker') endif let g:loaded_syntastic_cpp_cppcheck_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'cpp', \ 'name': 'cppcheck', diff --git a/syntax_checkers/cpp/oclint.vim b/syntax_checkers/cpp/oclint.vim index 127c5f09..82177694 100644 --- a/syntax_checkers/cpp/oclint.vim +++ b/syntax_checkers/cpp/oclint.vim @@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_cpp_oclint_checker') endif let g:loaded_syntastic_cpp_oclint_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'cpp', \ 'name': 'oclint', diff --git a/syntax_checkers/cpp/pc_lint.vim b/syntax_checkers/cpp/pc_lint.vim index d8346845..1e69dd4c 100644 --- a/syntax_checkers/cpp/pc_lint.vim +++ b/syntax_checkers/cpp/pc_lint.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_cpp_pc_lint_checker') endif let g:loaded_syntastic_cpp_pc_lint_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'cpp', \ 'name': 'pc_lint', diff --git a/syntax_checkers/css/phpcs.vim b/syntax_checkers/css/phpcs.vim index bdf2665e..a065f0e8 100644 --- a/syntax_checkers/css/phpcs.vim +++ b/syntax_checkers/css/phpcs.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_css_phpcs_checker') endif let g:loaded_syntastic_css_phpcs_checker = 1 -runtime! syntax_checkers/php/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'css', \ 'name': 'phpcs', diff --git a/syntax_checkers/css/recess.vim b/syntax_checkers/css/recess.vim index 92e84e04..ce6d5aea 100644 --- a/syntax_checkers/css/recess.vim +++ b/syntax_checkers/css/recess.vim @@ -16,8 +16,6 @@ if exists('g:loaded_syntastic_css_recess_checker') endif let g:loaded_syntastic_css_recess_checker = 1 -runtime! syntax_checkers/less/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'css', \ 'name': 'recess', diff --git a/syntax_checkers/docbk/xmllint.vim b/syntax_checkers/docbk/xmllint.vim index 01fa4162..30d66d25 100644 --- a/syntax_checkers/docbk/xmllint.vim +++ b/syntax_checkers/docbk/xmllint.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_docbk_xmllint_checker') endif let g:loaded_syntastic_docbk_xmllint_checker = 1 -runtime! syntax_checkers/xml/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'docbk', \ 'name': 'xmllint', diff --git a/syntax_checkers/nroff/igor.vim b/syntax_checkers/nroff/igor.vim index f19cf69c..dcad8c53 100644 --- a/syntax_checkers/nroff/igor.vim +++ b/syntax_checkers/nroff/igor.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_nroff_igor_checker') endif let g:loaded_syntastic_nroff_igor_checker = 1 -runtime! syntax_checkers/docbk/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'nroff', \ 'name': 'igor', diff --git a/syntax_checkers/objc/oclint.vim b/syntax_checkers/objc/oclint.vim index 7adf5b80..534d82b9 100644 --- a/syntax_checkers/objc/oclint.vim +++ b/syntax_checkers/objc/oclint.vim @@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_objc_oclint_checker') endif let g:loaded_syntastic_objc_oclint_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'objc', \ 'name': 'oclint', diff --git a/syntax_checkers/objcpp/oclint.vim b/syntax_checkers/objcpp/oclint.vim index addec47d..5528258e 100644 --- a/syntax_checkers/objcpp/oclint.vim +++ b/syntax_checkers/objcpp/oclint.vim @@ -14,8 +14,6 @@ if exists('g:loaded_syntastic_objcpp_oclint_checker') endif let g:loaded_syntastic_objcpp_oclint_checker = 1 -runtime! syntax_checkers/c/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'objcpp', \ 'name': 'oclint', diff --git a/syntax_checkers/perl/podchecker.vim b/syntax_checkers/perl/podchecker.vim index 7de61bb3..cad39bd3 100644 --- a/syntax_checkers/perl/podchecker.vim +++ b/syntax_checkers/perl/podchecker.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_perl_podchecker_checker') endif let g:loaded_syntastic_perl_podchecker_checker = 1 -runtime! syntax_checkers/pod/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'perl', \ 'name': 'podchecker', diff --git a/syntax_checkers/rmd/lintr.vim b/syntax_checkers/rmd/lintr.vim index 432a87d9..dcc235f7 100644 --- a/syntax_checkers/rmd/lintr.vim +++ b/syntax_checkers/rmd/lintr.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_rmd_lintr_checker') endif let g:loaded_syntastic_rmd_lintr_checker = 1 -runtime! syntax_checkers/r/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'rmd', \ 'name': 'lintr', diff --git a/syntax_checkers/scss/sass.vim b/syntax_checkers/scss/sass.vim index 426bf2d4..3df8c803 100644 --- a/syntax_checkers/scss/sass.vim +++ b/syntax_checkers/scss/sass.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_scss_sass_checker') endif let g:loaded_syntastic_scss_sass_checker = 1 -runtime! syntax_checkers/sass/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'scss', \ 'name': 'sass', diff --git a/syntax_checkers/scss/sassc.vim b/syntax_checkers/scss/sassc.vim index 98f7829a..f1b23729 100644 --- a/syntax_checkers/scss/sassc.vim +++ b/syntax_checkers/scss/sassc.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_scss_sassc_checker') endif let g:loaded_syntastic_scss_sassc_checker = 1 -runtime! syntax_checkers/sass/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'scss', \ 'name': 'sassc', diff --git a/syntax_checkers/text/igor.vim b/syntax_checkers/text/igor.vim index bf6fda9d..588cf3ba 100644 --- a/syntax_checkers/text/igor.vim +++ b/syntax_checkers/text/igor.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_text_igor_checker') endif let g:loaded_syntastic_text_igor_checker = 1 -runtime! syntax_checkers/docbk/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'text', \ 'name': 'igor', diff --git a/syntax_checkers/typescript/eslint.vim b/syntax_checkers/typescript/eslint.vim index 9d9f87e3..41e52764 100644 --- a/syntax_checkers/typescript/eslint.vim +++ b/syntax_checkers/typescript/eslint.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_typescript_eslint_checker') endif let g:loaded_syntastic_typescript_eslint_checker = 1 -runtime! syntax_checkers/javascript/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'typescript', \ 'name': 'eslint', diff --git a/syntax_checkers/xhtml/jshint.vim b/syntax_checkers/xhtml/jshint.vim index 413d112b..f4536e28 100644 --- a/syntax_checkers/xhtml/jshint.vim +++ b/syntax_checkers/xhtml/jshint.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_xhtml_jshint_checker') endif let g:loaded_syntastic_xhtml_jshint_checker = 1 -runtime! syntax_checkers/html/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'xhtml', \ 'name': 'jshint', diff --git a/syntax_checkers/xslt/xmllint.vim b/syntax_checkers/xslt/xmllint.vim index 1f16a46b..9ffb548f 100644 --- a/syntax_checkers/xslt/xmllint.vim +++ b/syntax_checkers/xslt/xmllint.vim @@ -15,8 +15,6 @@ if exists('g:loaded_syntastic_xslt_xmllint_checker') endif let g:loaded_syntastic_xslt_xmllint_checker = 1 -runtime! syntax_checkers/xml/*.vim - call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'xslt', \ 'name': 'xmllint',