mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
#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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user