Files
vim-lsp-mirror/test/integration/rust/document_formatting.vimspec
Prabir Shrestha 0c2a9d34e0 add goto definition integration tests for same file (#972)
* add goto definition integration tests for same file
2020-12-24 14:21:49 -08:00

37 lines
893 B
Plaintext

Describe integration#rust#document_formatting
Before
%bwipeout!
if lsp#test#hasproject('rust')
call lsp#test#openproject('rust', {})
endif
End
After all
%bwipeout!
call lsp#test#closeproject('rust')
End
It should correctly format document when using LspDocumentFormatSync
if !lsp#test#hasproject('rust')
Skip rust project not supported
endif
setl shiftwidth=4
normal! m'
execute printf('keepalt keepjumps edit %s', lsp#test#projectdir('rust') . '/src/documentformat.rs')
let l:original = getline(1, "$")
call execute('LspDocumentFormatSync')
let got = getline(1, "$")
let want = [
\ 'fn format() {',
\ ' unimplemented!();',
\ '}'
\ ]
Assert Equals(got, want)
End
End