1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
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
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(''),
\ {
\ 'language_callback': {-> 'x'},
\ 'project_root_callback': {-> '/foo/bar'},
\ 'lsp': 'stdio',
\ 'executable': has('win32') ? 'cmd': 'true',
\ 'command': '%e --foo',
\ },
\ {->0}
\)
if has('win32')
AssertEqual
\ ['cmd', 'cmd /s/c "cmd --foo"', '/foo/bar'],
\ g:args[:2]
else
AssertEqual
\ ['true', [&shell, '-c', '''true'' --foo'], '/foo/bar'],
\ g:args[:2]
endif
|