766636e0c4
All linters should have a name variable set in their dictionary, and code should be able to rely on that. Fix this test such that its example linter contains a name entry.
38 lines
803 B
Plaintext
38 lines
803 B
Plaintext
Before:
|
|
runtime autoload/ale/lsp.vim
|
|
|
|
let g:args = []
|
|
|
|
" Mock the StartProgram function so we can just capture the arguments.
|
|
function! ale#lsp#StartProgram(...) abort
|
|
let g:args = a:000[1:]
|
|
endfunction
|
|
|
|
After:
|
|
unlet! g:args
|
|
|
|
runtime autoload/ale/lsp.vim
|
|
|
|
Execute(Command formatting should be applied correctly for LSP linters):
|
|
call ale#lsp_linter#StartLSP(
|
|
\ bufnr(''),
|
|
\ {
|
|
\ 'name': 'linter',
|
|
\ 'language_callback': {-> 'x'},
|
|
\ 'project_root_callback': {-> '/foo/bar'},
|
|
\ 'lsp': 'stdio',
|
|
\ 'executable': has('win32') ? 'cmd': 'true',
|
|
\ 'command': '%e --foo',
|
|
\ },
|
|
\)
|
|
|
|
if has('win32')
|
|
AssertEqual
|
|
\ ['cmd', 'cmd /s/c "cmd --foo"'],
|
|
\ g:args
|
|
else
|
|
AssertEqual
|
|
\ ['true', [&shell, '-c', '''true'' --foo']],
|
|
\ g:args
|
|
endif
|