]> git.madduck.net Git - etc/vim.git/blob - test/lsp/test_lsp_command_formatting.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / lsp / test_lsp_command_formatting.vader
1 Before:
2   Save g:ale_command_wrapper
3
4   runtime autoload/ale/lsp.vim
5
6   let g:ale_command_wrapper = ''
7
8   let g:args = []
9
10   " Mock the StartProgram function so we can just capture the arguments.
11   function! ale#lsp#StartProgram(...) abort
12     let g:args = a:000[1:]
13   endfunction
14
15 After:
16   Restore
17
18   unlet! g:args
19
20   runtime autoload/ale/lsp.vim
21
22 Execute(Command formatting should be applied correctly for LSP linters):
23   call ale#lsp_linter#StartLSP(
24   \ bufnr(''),
25   \ {
26   \   'name': 'linter',
27   \   'language': {-> 'x'},
28   \   'project_root': {-> '/foo/bar'},
29   \   'lsp': 'stdio',
30   \   'executable': has('win32') ? 'cmd': 'true',
31   \   'command': '%e --foo',
32   \ },
33   \ {-> 0}
34   \)
35
36   if has('win32')
37     AssertEqual
38     \ ['cmd', 'cmd /s/c "cmd --foo"'],
39     \ g:args
40   else
41     AssertEqual
42     \ ['true', [&shell, '-c', '''true'' --foo']],
43     \ g:args
44   endif