diff options
author | Mathias Fussenegger <f.mathias@zignar.net> | 2021-02-25 10:08:14 +0100 |
---|---|---|
committer | Mathias Fussenegger <f.mathias@zignar.net> | 2021-02-25 10:08:14 +0100 |
commit | eff7666163ce0c81fc1a54eceb8c8d84c314aaad (patch) | |
tree | 3745a0eb5c1f2a1beacb3fe4f42180e051e7d4a6 | |
parent | e55ded00cfb8432a7bc8af40b477aaf0cba70405 (diff) | |
download | rneovim-eff7666163ce0c81fc1a54eceb8c8d84c314aaad.tar.gz rneovim-eff7666163ce0c81fc1a54eceb8c8d84c314aaad.tar.bz2 rneovim-eff7666163ce0c81fc1a54eceb8c8d84c314aaad.zip |
LSP: Resolve text_document_save capability according to spec
Fixes https://github.com/neovim/neovim/issues/13989
See https://github.com/microsoft/language-server-protocol/issues/288
-rw-r--r-- | runtime/lua/vim/lsp/protocol.lua | 2 | ||||
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 3e111c154a..388f65c180 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -938,7 +938,7 @@ function protocol.resolve_capabilities(server_capabilities) text_document_did_change = textDocumentSync; text_document_will_save = false; text_document_will_save_wait_until = false; - text_document_save = false; + text_document_save = true; text_document_save_include_text = false; } elseif type(textDocumentSync) == 'table' then diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index b36bfdfd9b..8ac81daeef 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -333,6 +333,7 @@ describe('LSP', function() client.stop() local full_kind = exec_lua("return require'vim.lsp.protocol'.TextDocumentSyncKind.Full") eq(full_kind, client.resolved_capabilities().text_document_did_change) + eq(true, client.resolved_capabilities().text_document_save) end; on_exit = function(code, signal) eq(0, code, "exit code", fake_lsp_logfile) |