diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2024-08-01 16:01:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 16:01:15 +0200 |
commit | 720b309c786c4a258adccc9c468d433fb0f755b9 (patch) | |
tree | fd3f02f5fc9f8eccf8bb76d5ba1732bd789549fc /test/functional/plugin/lsp/diagnostic_spec.lua | |
parent | 32e128f20992e350b3e39c7469baa1f692418203 (diff) | |
download | rneovim-720b309c786c4a258adccc9c468d433fb0f755b9.tar.gz rneovim-720b309c786c4a258adccc9c468d433fb0f755b9.tar.bz2 rneovim-720b309c786c4a258adccc9c468d433fb0f755b9.zip |
fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)
`buf.code_action` always included diagnostics on a given line from all
clients. Servers should only receive diagnostics they published, and in
the exact same format they sent it.
Should fix https://github.com/neovim/neovim/issues/29500
Diffstat (limited to 'test/functional/plugin/lsp/diagnostic_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/diagnostic_spec.lua | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua index c5e14ffdc2..779c4641b9 100644 --- a/test/functional/plugin/lsp/diagnostic_spec.lua +++ b/test/functional/plugin/lsp/diagnostic_spec.lua @@ -98,33 +98,6 @@ describe('vim.lsp.diagnostic', function() clear() end) - describe('vim.lsp.diagnostic', function() - it('maintains LSP information when translating diagnostics', function() - local result = exec_lua [[ - local diagnostics = { - make_error("Error 1", 1, 1, 1, 5), - } - - diagnostics[1].code = 42 - diagnostics[1].data = "Hello world" - - vim.lsp.diagnostic.on_publish_diagnostics(nil, { - uri = fake_uri, - diagnostics = diagnostics, - }, {client_id=client_id}) - - return { - vim.diagnostic.get(diagnostic_bufnr, {lnum=1})[1], - vim.lsp.diagnostic.get_line_diagnostics(diagnostic_bufnr, 1)[1], - } - ]] - eq({ code = 42, data = 'Hello world' }, result[1].user_data.lsp) - eq(42, result[1].code) - eq(42, result[2].code) - eq('Hello world', result[2].data) - end) - end) - describe('vim.lsp.diagnostic.on_publish_diagnostics', function() it('allows configuring the virtual text via vim.lsp.with', function() local expected_spacing = 10 |