summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-05 21:41:53 +0000
committerw0rp <devw0rp@gmail.com>2017-11-05 21:41:53 +0000
commitfa7d041c26aa6616c13a62274a7fc8458f6096dd (patch)
treec6e872d4254c0af33aa1eb5f270f5406abb33875
parent3c8e6ed51c4dcae759231d3bd8baff18da30e120 (diff)
downloadale-fa7d041c26aa6616c13a62274a7fc8458f6096dd.zip
Fix #1085 - Add a final newline character to tsserver and LSP messages
-rw-r--r--autoload/ale/lsp/message.vim4
-rw-r--r--autoload/ale/lsp/tsserver_message.vim2
-rw-r--r--test/lsp/test_lsp_client_messages.vader6
3 files changed, 6 insertions, 6 deletions
diff --git a/autoload/ale/lsp/message.vim b/autoload/ale/lsp/message.vim
index 7910247d..31a9b210 100644
--- a/autoload/ale/lsp/message.vim
+++ b/autoload/ale/lsp/message.vim
@@ -53,7 +53,7 @@ function! ale#lsp#message#DidOpen(buffer, language_id) abort
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(),
- \ 'text': join(l:lines, "\n"),
+ \ 'text': join(l:lines, "\n") . "\n",
\ },
\}]
endfunction
@@ -67,7 +67,7 @@ function! ale#lsp#message#DidChange(buffer) abort
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(),
\ },
- \ 'contentChanges': [{'text': join(l:lines, "\n")}]
+ \ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}]
\}]
endfunction
diff --git a/autoload/ale/lsp/tsserver_message.vim b/autoload/ale/lsp/tsserver_message.vim
index ab18d742..e2706ed5 100644
--- a/autoload/ale/lsp/tsserver_message.vim
+++ b/autoload/ale/lsp/tsserver_message.vim
@@ -28,7 +28,7 @@ function! ale#lsp#tsserver_message#Change(buffer) abort
\ 'offset': 1,
\ 'endLine': 1073741824,
\ 'endOffset': 1,
- \ 'insertString': join(l:lines, "\n"),
+ \ 'insertString': join(l:lines, "\n") . "\n",
\}]
endfunction
diff --git a/test/lsp/test_lsp_client_messages.vader b/test/lsp/test_lsp_client_messages.vader
index 7ec905cc..a7660ce3 100644
--- a/test/lsp/test_lsp_client_messages.vader
+++ b/test/lsp/test_lsp_client_messages.vader
@@ -45,7 +45,7 @@ Execute(ale#lsp#message#DidOpen() should return correct messages):
\ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
\ 'languageId': 'typescript',
\ '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'),
\ 'version': 34,
\ },
- \ 'contentChanges': [{'text': "foo()\nbar()\nbaz()"}],
+ \ 'contentChanges': [{'text': "foo()\nbar()\nbaz()\n"}],
\ }
\ ],
\ ale#lsp#message#DidChange(bufnr(''))
@@ -134,7 +134,7 @@ Execute(ale#lsp#tsserver_message#Change() should return correct messages):
\ 'offset': 1,
\ 'endLine': 1073741824,
\ 'endOffset': 1,
- \ 'insertString': "foo()\nbar()\nbaz()",
+ \ 'insertString': "foo()\nbar()\nbaz()\n",
\ }
\ ],
\ ale#lsp#tsserver_message#Change(bufnr(''))