Fix #1085 - Add a final newline character to tsserver and LSP messages

This commit is contained in:
w0rp 2017-11-05 21:41:53 +00:00
parent 3c8e6ed51c
commit fa7d041c26
3 changed files with 6 additions and 6 deletions

View File

@ -53,7 +53,7 @@ function! ale#lsp#message#DidOpen(buffer, language_id) abort
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id, \ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(), \ 'version': ale#lsp#message#GetNextVersionID(),
\ 'text': join(l:lines, "\n"), \ 'text': join(l:lines, "\n") . "\n",
\ }, \ },
\}] \}]
endfunction endfunction
@ -67,7 +67,7 @@ function! ale#lsp#message#DidChange(buffer) abort
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(), \ 'version': ale#lsp#message#GetNextVersionID(),
\ }, \ },
\ 'contentChanges': [{'text': join(l:lines, "\n")}] \ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}]
\}] \}]
endfunction endfunction

View File

@ -28,7 +28,7 @@ function! ale#lsp#tsserver_message#Change(buffer) abort
\ 'offset': 1, \ 'offset': 1,
\ 'endLine': 1073741824, \ 'endLine': 1073741824,
\ 'endOffset': 1, \ 'endOffset': 1,
\ 'insertString': join(l:lines, "\n"), \ 'insertString': join(l:lines, "\n") . "\n",
\}] \}]
endfunction endfunction

View File

@ -45,7 +45,7 @@ Execute(ale#lsp#message#DidOpen() should return correct messages):
\ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'), \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
\ 'languageId': 'typescript', \ 'languageId': 'typescript',
\ 'version': 12, \ 'version': 12,
\ 'text': "foo()\nbar()\nbaz()", \ 'text': "foo()\nbar()\nbaz()\n",
\ }, \ },
\ } \ }
\ ], \ ],
@ -63,7 +63,7 @@ Execute(ale#lsp#message#DidChange() should return correct messages):
\ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'), \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
\ 'version': 34, \ 'version': 34,
\ }, \ },
\ 'contentChanges': [{'text': "foo()\nbar()\nbaz()"}], \ 'contentChanges': [{'text': "foo()\nbar()\nbaz()\n"}],
\ } \ }
\ ], \ ],
\ ale#lsp#message#DidChange(bufnr('')) \ ale#lsp#message#DidChange(bufnr(''))
@ -134,7 +134,7 @@ Execute(ale#lsp#tsserver_message#Change() should return correct messages):
\ 'offset': 1, \ 'offset': 1,
\ 'endLine': 1073741824, \ 'endLine': 1073741824,
\ 'endOffset': 1, \ 'endOffset': 1,
\ 'insertString': "foo()\nbar()\nbaz()", \ 'insertString': "foo()\nbar()\nbaz()\n",
\ } \ }
\ ], \ ],
\ ale#lsp#tsserver_message#Change(bufnr('')) \ ale#lsp#tsserver_message#Change(bufnr(''))