Merge pull request #14014 from mfussenegger/textDocumentSync

LSP: Resolve text_document_save capability according to spec
This commit is contained in:
Michael Lingelbach 2021-02-25 10:25:14 -08:00 committed by GitHub
commit 0c7610cf9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -938,7 +938,7 @@ function protocol.resolve_capabilities(server_capabilities)
text_document_did_change = textDocumentSync; text_document_did_change = textDocumentSync;
text_document_will_save = false; text_document_will_save = false;
text_document_will_save_wait_until = false; text_document_will_save_wait_until = false;
text_document_save = false; text_document_save = true;
text_document_save_include_text = false; text_document_save_include_text = false;
} }
elseif type(textDocumentSync) == 'table' then elseif type(textDocumentSync) == 'table' then

View File

@ -333,6 +333,7 @@ describe('LSP', function()
client.stop() client.stop()
local full_kind = exec_lua("return require'vim.lsp.protocol'.TextDocumentSyncKind.Full") local full_kind = exec_lua("return require'vim.lsp.protocol'.TextDocumentSyncKind.Full")
eq(full_kind, client.resolved_capabilities().text_document_did_change) eq(full_kind, client.resolved_capabilities().text_document_did_change)
eq(true, client.resolved_capabilities().text_document_save)
end; end;
on_exit = function(code, signal) on_exit = function(code, signal)
eq(0, code, "exit code", fake_lsp_logfile) eq(0, code, "exit code", fake_lsp_logfile)