lsp: Fix text payload in didSave notification (#13363)

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
This commit is contained in:
Mathias Fußenegger
2020-12-20 18:12:39 +01:00
committed by GitHub
parent fa46123998
commit abcbc5a9f3

View File

@@ -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)