diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/lsp/message.vim | 8 | ||||
-rw-r--r-- | autoload/ale/util.vim | 2 |
2 files changed, 3 insertions, 7 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 diff --git a/autoload/ale/util.vim b/autoload/ale/util.vim index c884076a..2dc71ce5 100644 --- a/autoload/ale/util.vim +++ b/autoload/ale/util.vim @@ -542,7 +542,7 @@ function! ale#util#SetBufferContents(buffer, lines) abort endfunction function! ale#util#GetBufferContents(buffer) abort - return join(getbufline(a:buffer, 1, '$'), '\n') . '\n' + return join(getbufline(a:buffer, 1, '$'), "\n") . "\n" endfunction function! ale#util#ToURI(resource) abort |