summaryrefslogtreecommitdiff
path: root/autoload/ale/lsp/message.vim
diff options
context:
space:
mode:
authorWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2021-10-07 07:48:54 -0400
committerGitHub <noreply@github.com>2021-10-07 20:48:54 +0900
commit42a6e039cb36fbc5a60215b2be55e54c364b15e9 (patch)
tree12f5d3affc4ff27a844c819656dd67e99365ec1a /autoload/ale/lsp/message.vim
parent34a972f85d0aa80997b7b0ac36c667a6137ce9a0 (diff)
downloadale-42a6e039cb36fbc5a60215b2be55e54c364b15e9.zip
Implement textDocument/didSave includeText optional argument (#3925)
Diffstat (limited to 'autoload/ale/lsp/message.vim')
-rw-r--r--autoload/ale/lsp/message.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/autoload/ale/lsp/message.vim b/autoload/ale/lsp/message.vim
index 38be4da6..b40c4407 100644
--- a/autoload/ale/lsp/message.vim
+++ b/autoload/ale/lsp/message.vim
@@ -77,12 +77,19 @@ function! ale#lsp#message#DidChange(buffer) abort
\}]
endfunction
-function! ale#lsp#message#DidSave(buffer) abort
- return [1, 'textDocument/didSave', {
+function! ale#lsp#message#DidSave(buffer, includeText) abort
+ let l:response = [1, 'textDocument/didSave', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\}]
+
+ if a:includeText
+ let l:response[2].textDocument.version = ale#lsp#message#GetNextVersionID()
+ let l:response[2].text = ale#util#GetBufferContents(a:buffer)
+ endif
+
+ return l:response
endfunction
function! ale#lsp#message#DidClose(buffer) abort