#2132 - Implement deferred command handling for linters

This commit is contained in:
w0rp
2019-02-21 21:24:41 +00:00
parent a8b987a1c3
commit ffa45fa3fb
9 changed files with 102 additions and 11 deletions

View File

@@ -59,13 +59,18 @@ function! ale#assert#Linter(expected_executable, expected_command) abort
endif
else
let l:command = ale#linter#GetCommand(l:buffer, l:linter)
while ale#command#IsDeferred(l:command)
call ale#test#FlushJobs()
let l:command = l:command.value
endwhile
endif
if type(l:command) is v:t_string
" Replace %e with the escaped executable, so tests keep passing after
" linters are changed to use %e.
let l:command = substitute(l:command, '%e', '\=ale#Escape(l:executable)', 'g')
else
elseif type(l:command) is v:t_list
call map(l:command, 'substitute(v:val, ''%e'', ''\=ale#Escape(l:executable)'', ''g'')')
endif