Add g:ale_disable_lsp and b:ale_disable_lsp to disable linters powered by LSP

This commit is contained in:
rhysd
2019-03-30 13:53:18 +09:00
parent 89273b65b8
commit 6a29641872
4 changed files with 62 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ function! ale#engine#ignore#GetList(filetype, config) abort
endfunction
" Given a List of linter descriptions, exclude the linters to be ignored.
function! ale#engine#ignore#Exclude(filetype, all_linters, config) abort
function! ale#engine#ignore#Exclude(filetype, all_linters, config, disable_lsp) abort
let l:names_to_remove = ale#engine#ignore#GetList(a:filetype, a:config)
let l:filtered_linters = []
@@ -37,6 +37,10 @@ function! ale#engine#ignore#Exclude(filetype, all_linters, config) abort
endif
endfor
if a:disable_lsp && has_key(l:linter, 'lsp') && l:linter.lsp isnot# ''
let l:should_include = 0
endif
if l:should_include
call add(l:filtered_linters, l:linter)
endif