#2132 - lint and fix with ale#command#Run

A new function is added here which will later be modified for public use
in linter and fixer callbacks. All linting and fixing now goes through
this new function, to prove that it works in all cases.
This commit is contained in:
w0rp
2019-02-06 22:00:11 +00:00
parent 3e11cbd18d
commit 81c73da3b9
25 changed files with 561 additions and 434 deletions

View File

@@ -18,6 +18,9 @@ Before:
endfunction
call ale#engine#InitBufferInfo(bufnr(''))
" Call this function first, so we can be sure the module is loaded before we
" check if it exists.
call ale#lsp_linter#ClearLSPData()
call ale#linter#Define('testft', {
\ 'name': 'lsplinter',
@@ -68,7 +71,10 @@ Execute(ALEStopAllLSPs should clear the loclist):
\ 'linter_name': 'otherlinter',
\ },
\]
let g:ale_buffer_info[bufnr('')].active_linter_list = ['lsplinter', 'otherlinter']
let g:ale_buffer_info[bufnr('')].active_linter_list = [
\ {'name': 'lsplinter'},
\ {'name': 'otherlinter'},
\]
ALEStopAllLSPs
@@ -87,4 +93,6 @@ Execute(ALEStopAllLSPs should clear the loclist):
\]
" The LSP linter should be removed from the active linter list.
AssertEqual g:ale_buffer_info[bufnr('')].active_linter_list, ['otherlinter']
AssertEqual
\ ['otherlinter'],
\ map(copy(g:ale_buffer_info[bufnr('')].active_linter_list), 'v:val.name')