install.fairie/dotfiles/.vim/plugged/ale/test/lsp/test_lsp_command_formatting.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

44 lines
871 B
Text

Before:
Save g:ale_command_wrapper
runtime autoload/ale/lsp.vim
let g:ale_command_wrapper = ''
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:
Restore
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': {-> 'x'},
\ 'project_root': {-> '/foo/bar'},
\ 'lsp': 'stdio',
\ 'executable': has('win32') ? 'cmd': 'true',
\ 'command': '%e --foo',
\ },
\ {-> 0}
\)
if has('win32')
AssertEqual
\ ['cmd', 'cmd /s/c "cmd --foo"'],
\ g:args
else
AssertEqual
\ ['true', [&shell, '-c', '''true'' --foo']],
\ g:args
endif