summaryrefslogtreecommitdiff
path: root/autoload/ale/lsp/message.vim
diff options
context:
space:
mode:
authorWilson E. Alvarez <wilson.e.alvarez@rubonnek.com>2023-03-14 16:55:28 -0400
committerGitHub <noreply@github.com>2023-03-14 20:55:28 +0000
commite1a0781f9de7d90554ea572cd220d72f823be3dc (patch)
tree99d4504938542555401a5e584378ba4067e97cea /autoload/ale/lsp/message.vim
parent011e4f6590e8fb26ee2b55bd6b368f1bb784a537 (diff)
downloadale-e1a0781f9de7d90554ea572cd220d72f823be3dc.zip
Fix `ale#util#GetBufferContents` and propagate use (#4457)
* Use newline characters instead in ale#util#GetBufferContents * Propagate use of ale#util#GetBufferContents * Add ale#util#GetContentBuffer test
Diffstat (limited to 'autoload/ale/lsp/message.vim')
-rw-r--r--autoload/ale/lsp/message.vim8
1 files changed, 2 insertions, 6 deletions
diff --git a/autoload/ale/lsp/message.vim b/autoload/ale/lsp/message.vim
index c2238dec..9d5b6228 100644
--- a/autoload/ale/lsp/message.vim
+++ b/autoload/ale/lsp/message.vim
@@ -52,28 +52,24 @@ function! ale#lsp#message#Exit() abort
endfunction
function! ale#lsp#message#DidOpen(buffer, language_id) abort
- let l:lines = getbufline(a:buffer, 1, '$')
-
return [1, 'textDocument/didOpen', {
\ 'textDocument': {
\ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(),
- \ 'text': join(l:lines, "\n") . "\n",
+ \ 'text': ale#util#GetBufferContents(a:buffer),
\ },
\}]
endfunction
function! ale#lsp#message#DidChange(buffer) abort
- let l:lines = getbufline(a:buffer, 1, '$')
-
" For changes, we simply send the full text of the document to the server.
return [1, 'textDocument/didChange', {
\ 'textDocument': {
\ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(),
\ },
- \ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}]
+ \ 'contentChanges': [{'text': ale#util#GetBufferContents(a:buffer)}]
\}]
endfunction