]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp/test/integration/go/document_formatting.vimspec

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:

Merge commit 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / vim-lsp / test / integration / go / document_formatting.vimspec
1 Describe integration#go#document_formatting
2     Before
3         %bwipeout!
4         if lsp#test#hasproject('go')
5             call lsp#test#openproject('go', {})
6         endif
7     End
8
9     After all
10         %bwipeout!
11         call lsp#test#closeproject('go')
12     End
13
14     It should correctly format document when using LspDocumentFormatSync
15         if !lsp#test#hasproject('go')
16             Skip go project not supported
17         endif
18
19         Assert Equals(lsp#get_server_status('gopls'), 'running')
20
21         execute printf('keepalt keepjumps edit %s', lsp#test#projectdir('go') . '/documentformat.go')
22         let l:original = getline(1, "$")
23
24         call execute('LspDocumentFormatSync')
25
26         let got = getline(1, "$")
27         let want = [
28             \ 'package main',
29             \ '',
30             \ 'func main() {',
31             \ ' print("hello, world!")',
32             \ ' print("こんにちは、世界")',
33             \ ' print("a β c")',
34             \ ' print("δ")',
35             \ '}'
36             \ ]
37         Assert Equals(got, want)
38     End
39
40 End