mirror of
https://github.com/neovim/neovim.git
synced 2025-11-16 07:11:20 +00:00
feat(lsp)!: rename vim.lsp.get_active_clients to get_clients (#24113)
This commit is contained in:
committed by
GitHub
parent
d0d132fbd0
commit
1b9ccd38a1
@@ -82,7 +82,7 @@ describe('LSP', function()
|
||||
describe('server_name specified', function()
|
||||
it('start_client(), stop_client()', function()
|
||||
retry(nil, 4000, function()
|
||||
eq(1, exec_lua('return #lsp.get_active_clients()'))
|
||||
eq(1, exec_lua('return #lsp.get_clients()'))
|
||||
end)
|
||||
eq(2, exec_lua([[
|
||||
TEST_CLIENT2 = test__start_client()
|
||||
@@ -93,20 +93,20 @@ describe('LSP', function()
|
||||
return TEST_CLIENT3
|
||||
]]))
|
||||
retry(nil, 4000, function()
|
||||
eq(3, exec_lua('return #lsp.get_active_clients()'))
|
||||
eq(3, exec_lua('return #lsp.get_clients()'))
|
||||
end)
|
||||
|
||||
eq(false, exec_lua('return lsp.get_client_by_id(TEST_CLIENT1) == nil'))
|
||||
eq(false, exec_lua('return lsp.get_client_by_id(TEST_CLIENT1).is_stopped()'))
|
||||
exec_lua('return lsp.get_client_by_id(TEST_CLIENT1).stop()')
|
||||
retry(nil, 4000, function()
|
||||
eq(2, exec_lua('return #lsp.get_active_clients()'))
|
||||
eq(2, exec_lua('return #lsp.get_clients()'))
|
||||
end)
|
||||
eq(true, exec_lua('return lsp.get_client_by_id(TEST_CLIENT1) == nil'))
|
||||
|
||||
exec_lua('lsp.stop_client({TEST_CLIENT2, TEST_CLIENT3})')
|
||||
retry(nil, 4000, function()
|
||||
eq(0, exec_lua('return #lsp.get_active_clients()'))
|
||||
eq(0, exec_lua('return #lsp.get_clients()'))
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -116,12 +116,12 @@ describe('LSP', function()
|
||||
TEST_CLIENT3 = test__start_client()
|
||||
]])
|
||||
retry(nil, 4000, function()
|
||||
eq(3, exec_lua('return #lsp.get_active_clients()'))
|
||||
eq(3, exec_lua('return #lsp.get_clients()'))
|
||||
end)
|
||||
-- Stop all clients.
|
||||
exec_lua('lsp.stop_client(lsp.get_active_clients())')
|
||||
exec_lua('lsp.stop_client(lsp.get_clients())')
|
||||
retry(nil, 4000, function()
|
||||
eq(0, exec_lua('return #lsp.get_active_clients()'))
|
||||
eq(0, exec_lua('return #lsp.get_clients()'))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
@@ -151,7 +151,7 @@ describe('LSP', function()
|
||||
describe('basic_init test', function()
|
||||
after_each(function()
|
||||
stop()
|
||||
exec_lua("lsp.stop_client(lsp.get_active_clients(), true)")
|
||||
exec_lua("lsp.stop_client(lsp.get_clients(), true)")
|
||||
exec_lua("vim.api.nvim_exec_autocmds('VimLeavePre', { modeline = false })")
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user