From abcbc5a9f346f98591f27eb73bc1c63787779368 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Sun, 20 Dec 2020 18:12:39 +0100 Subject: lsp: Fix text payload in didSave notification (#13363) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the specification[1] the payload must look like this: interface DidSaveTextDocumentParams { /** * The document that was saved. */ textDocument: TextDocumentIdentifier; /** * Optional the content when saved. Depends on the includeText value * when the save notification was requested. */ text?: string; } `text` must be on the same level as `textDocument´. Where `TextDocumentIdentifier` is: interface TextDocumentIdentifier { /** * The text document's URI. */ uri: DocumentUri; } [1]: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave --- runtime/lua/vim/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index ed31572abb..7c7edf98e7 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -881,8 +881,8 @@ function lsp._text_document_did_save_handler(bufnr) client.notify('textDocument/didSave', { textDocument = { uri = uri; - text = included_text; - } + }; + text = included_text; }) end end) -- cgit