aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/diagnostic_spec.lua
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2020-12-03 20:22:15 +0100
committerGitHub <noreply@github.com>2020-12-03 14:22:15 -0500
commitf5e0f17968eae6770cc0da136d8c9a4b23bc6da2 (patch)
tree0c4b90d830c7472e90a642b1d259b3834e5867dd /test/functional/plugin/lsp/diagnostic_spec.lua
parent5c7141cc710030b1bf77dd524cfcfb0947b58a4c (diff)
downloadrneovim-f5e0f17968eae6770cc0da136d8c9a4b23bc6da2.tar.gz
rneovim-f5e0f17968eae6770cc0da136d8c9a4b23bc6da2.tar.bz2
rneovim-f5e0f17968eae6770cc0da136d8c9a4b23bc6da2.zip
lsp: Change diagnosticg.get_all to return {bufnr: Diagnostic[]} (#13310)
Allows users to associate the diagnostics with the right bufnr.
Diffstat (limited to 'test/functional/plugin/lsp/diagnostic_spec.lua')
-rw-r--r--test/functional/plugin/lsp/diagnostic_spec.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua
index 11b2beba7a..3a676359ab 100644
--- a/test/functional/plugin/lsp/diagnostic_spec.lua
+++ b/test/functional/plugin/lsp/diagnostic_spec.lua
@@ -68,20 +68,23 @@ describe('vim.lsp.diagnostic', function()
describe('vim.lsp.diagnostic', function()
describe('handle_publish_diagnostics', function()
it('should be able to retrieve diagnostics from all buffers and clients', function()
- eq(3, exec_lua [[
+ local result = exec_lua [[
vim.lsp.diagnostic.save(
{
make_error('Diagnostic #1', 1, 1, 1, 1),
make_error('Diagnostic #2', 2, 1, 2, 1),
- }, 0, 1
+ }, 1, 1
)
vim.lsp.diagnostic.save(
{
make_error('Diagnostic #3', 3, 1, 3, 1),
- }, 1, 2
+ }, 2, 2
)
- return #vim.lsp.diagnostic.get_all()
- ]])
+ return vim.lsp.diagnostic.get_all()
+ ]]
+ eq(2, #result)
+ eq(2, #result[1])
+ eq('Diagnostic #1', result[1][1].message)
end)
it('should be able to save and count a single client error', function()
eq(1, exec_lua [[
@@ -153,7 +156,6 @@ describe('vim.lsp.diagnostic', function()
}
]])
end)
-
it('should handle one server clearing highlights while the other still has highlights', function()
-- 1 Error (1)
-- 1 Warning (2)