mirror of
https://github.com/neovim/neovim.git
synced 2025-12-11 17:12:40 +00:00
fix(lsp): fix handler signature, tests
- not necessary on master: got lost in the vim.lsp.diagnostic => vim.diagnostic migration - fix tests which accidentally depended on previous session - ref #15504
This commit is contained in:
@@ -455,12 +455,15 @@ local function text_document_did_open_handler(bufnr, client)
|
|||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"](
|
vim.lsp.handlers["textDocument/publishDiagnostics"](
|
||||||
nil,
|
nil,
|
||||||
"textDocument/publishDiagnostics",
|
|
||||||
{
|
{
|
||||||
diagnostics = vim.lsp.diagnostic.get(bufnr, client.id),
|
diagnostics = vim.lsp.diagnostic.get(bufnr, client.id),
|
||||||
uri = vim.uri_from_bufnr(bufnr),
|
uri = vim.uri_from_bufnr(bufnr),
|
||||||
},
|
},
|
||||||
client.id
|
{
|
||||||
|
method="textDocument/publishDiagnostics",
|
||||||
|
client_id=client.id,
|
||||||
|
bufnr=bufnr,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -130,9 +130,12 @@ local function test_rpc_server(config)
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe('LSP', function()
|
describe('LSP', function()
|
||||||
|
before_each(function()
|
||||||
|
clear_notrace()
|
||||||
|
end)
|
||||||
|
|
||||||
describe('server_name specified', function()
|
describe('server_name specified', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear_notrace()
|
|
||||||
-- Run an instance of nvim on the file which contains our "scripts".
|
-- Run an instance of nvim on the file which contains our "scripts".
|
||||||
-- Pass TEST_NAME to pick the script.
|
-- Pass TEST_NAME to pick the script.
|
||||||
local test_name = "basic_init"
|
local test_name = "basic_init"
|
||||||
@@ -332,7 +335,6 @@ describe('LSP', function()
|
|||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
it('workspace/configuration returns NIL per section if client was started without config.settings', function()
|
it('workspace/configuration returns NIL per section if client was started without config.settings', function()
|
||||||
clear_notrace()
|
|
||||||
fake_lsp_server_setup('workspace/configuration no settings')
|
fake_lsp_server_setup('workspace/configuration no settings')
|
||||||
eq({ NIL, NIL, }, exec_lua [[
|
eq({ NIL, NIL, }, exec_lua [[
|
||||||
local result = {
|
local result = {
|
||||||
|
|||||||
Reference in New Issue
Block a user