diff options
author | William Boman <william@redwill.se> | 2022-05-05 18:50:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 18:50:12 +0200 |
commit | 94eb72cc44fee4cae7a41cb1ff5fb21f81976658 (patch) | |
tree | 7df203fbcf80f232861aefc64a51cc068017391d /test/functional/fixtures/fake-lsp-server.lua | |
parent | b2fb3614b05f2c2f5f65e8300f4da548e6095b61 (diff) | |
download | rneovim-94eb72cc44fee4cae7a41cb1ff5fb21f81976658.tar.gz rneovim-94eb72cc44fee4cae7a41cb1ff5fb21f81976658.tar.bz2 rneovim-94eb72cc44fee4cae7a41cb1ff5fb21f81976658.zip |
fix(lsp): make sure to always reset active codelens refreshes (#18331)
This fixes issues where subsequent calls to vim.lsp.codelens.refresh()
would have no effect due to the buffer not getting cleared from the
active_refresh table.
Examples of how such scenarios would occur are:
- A textDocument/codeLens result yielded an error.
- The 'textDocument/codeLens' handler was overriden in such a way that
it no longer called vim.lsp.codelens.on_codelens().
Diffstat (limited to 'test/functional/fixtures/fake-lsp-server.lua')
-rw-r--r-- | test/functional/fixtures/fake-lsp-server.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua index 79a29cd8d8..0418ca7335 100644 --- a/test/functional/fixtures/fake-lsp-server.lua +++ b/test/functional/fixtures/fake-lsp-server.lua @@ -792,6 +792,48 @@ function tests.clientside_commands() } end +function tests.codelens_refresh_lock() + skeleton { + on_init = function() + return { + capabilities = { + codeLensProvider = { resolveProvider = true; }; + } + } + end; + body = function() + notify('start') + expect_request("textDocument/codeLens", function () + return {code = -32002, message = "ServerNotInitialized"}, nil + end) + expect_request("textDocument/codeLens", function () + local lenses = { + { + range = { + start = { line = 0, character = 0, }, + ['end'] = { line = 0, character = 3 } + }, + command = { title = 'Lens1', command = 'Dummy' } + }, + } + return nil, lenses + end) + expect_request("textDocument/codeLens", function () + local lenses = { + { + range = { + start = { line = 0, character = 0, }, + ['end'] = { line = 0, character = 3 } + }, + command = { title = 'Lens2', command = 'Dummy' } + }, + } + return nil, lenses + end) + notify('shutdown') + end; + } +end function tests.basic_formatting() skeleton { |