commit b9eba5cde2c4a578cf79897b6519d13a07328af3
parent 03f944b0fe6d1f56da96c0eb929be32e3616b521
Author: Pig Fang <g-plane@hotmail.com>
Date: Wed, 3 Dec 2025 08:56:35 +0800
test(lsp): accept callback for diagnostic
Diffstat:
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua
@@ -619,22 +619,15 @@ describe('vim.lsp.diagnostic', function()
diagnosticProvider = {},
},
handlers = {
- ['textDocument/diagnostic'] = function(_, params)
+ ['textDocument/diagnostic'] = function(_, _, callback)
_G.params = params
_G.requests = _G.requests + 1
- vim.lsp.diagnostic.on_diagnostic(nil, {
+ callback(nil, {
kind = 'full',
items = {
_G.make_warning('Pull Diagnostic', 4, 4, 4, 4),
},
- }, {
- params = {
- textDocument = { uri = fake_uri },
- },
- uri = fake_uri,
- client_id = client_id,
- bufnr = diagnostic_bufnr,
- }, {})
+ })
end,
},
})