diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-06-24 13:23:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 13:23:28 -0700 |
commit | 1e2fc1f9cd121ff16823e283a3dd074e668ce6b5 (patch) | |
tree | 8965afa53f62edad2c4b5a639fd7bb3e3e840571 /test/functional/plugin/lsp_spec.lua | |
parent | 24e0c16fd6cb33a399772330cb80dfa4c1306284 (diff) | |
parent | 444f175335f0fbe338931f977880e959afbb49b7 (diff) | |
download | rneovim-1e2fc1f9cd121ff16823e283a3dd074e668ce6b5.tar.gz rneovim-1e2fc1f9cd121ff16823e283a3dd074e668ce6b5.tar.bz2 rneovim-1e2fc1f9cd121ff16823e283a3dd074e668ce6b5.zip |
Merge pull request #14584 from akinsho/bugfix/vim-nil-conversion-logic
[RDY] fix(lsp): do not convert vim.NIL to nil in lists
Diffstat (limited to 'test/functional/plugin/lsp_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index fc26f77ffa..34e24efed0 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -927,6 +927,48 @@ describe('LSP', function() end; } end) + + it('should not trim vim.NIL from the end of a list', function() + local expected_handlers = { + {NIL, "shutdown", {}, 1}; + {NIL, "finish", {}, 1}; + {NIL, "workspace/executeCommand", { + arguments = { "EXTRACT_METHOD", {metadata = {}}, 3, 0, 6123, NIL }, + command = "refactor.perform", + title = "EXTRACT_METHOD" + }, 1}; + {NIL, "start", {}, 1}; + } + local client + test_rpc_server { + test_name = "decode_nil"; + on_setup = function() + exec_lua [[ + BUFFER = vim.api.nvim_create_buf(false, true) + vim.api.nvim_buf_set_lines(BUFFER, 0, -1, false, { + "testing"; + "123"; + }) + ]] + end; + on_init = function(_client) + client = _client + exec_lua [[ + assert(lsp.buf_attach_client(BUFFER, TEST_RPC_CLIENT_ID)) + ]] + end; + on_exit = function(code, signal) + eq(0, code, "exit code", fake_lsp_logfile) + eq(0, signal, "exit signal", fake_lsp_logfile) + end; + on_handler = function(err, method, params, client_id) + eq(table.remove(expected_handlers), {err, method, params, client_id}, "expected handler") + if method == 'finish' then + client.stop() + end + end; + } + end) end) describe('lsp._cmd_parts test', function() local function _cmd_parts(input) |