mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
feat(lsp): static registration support (#34371)
This commit is contained in:
committed by
GitHub
parent
a5f236291c
commit
d75ffa5934
@ -5727,6 +5727,28 @@ describe('LSP', function()
|
||||
eq({ method = 'textDocument/rangeFormatting', supported = true, fname = tmpfile }, result[4])
|
||||
eq({ method = 'textDocument/completion', supported = false }, result[5])
|
||||
end)
|
||||
|
||||
it('supports static registration', function()
|
||||
exec_lua(create_server_definition)
|
||||
|
||||
local client_id = exec_lua(function()
|
||||
local server = _G._create_server({
|
||||
capabilities = {
|
||||
colorProvider = { id = 'color-registration' },
|
||||
},
|
||||
})
|
||||
|
||||
return assert(vim.lsp.start({ name = 'dynamic-test', cmd = server.cmd }))
|
||||
end)
|
||||
|
||||
eq(
|
||||
true,
|
||||
exec_lua(function()
|
||||
local client = assert(vim.lsp.get_client_by_id(client_id))
|
||||
return client.dynamic_capabilities:get('textDocument/documentColor') ~= nil
|
||||
end)
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('vim.lsp._watchfiles', function()
|
||||
|
Reference in New Issue
Block a user