feat(lsp): deprecate vim.lsp.start_client #31341

Problem:
LSP module has multiple "start" interfaces.

Solution:
- Enhance vim.lsp.start
- Deprecate vim.lsp.start_client
This commit is contained in:
Maria José Solano
2024-12-04 05:14:47 -08:00
committed by GitHub
parent b079a9d2e7
commit e56437cd48
8 changed files with 139 additions and 126 deletions

View File

@@ -89,7 +89,7 @@ describe('vim.lsp.diagnostic', function()
return extmarks
end
client_id = assert(vim.lsp.start_client {
client_id = assert(vim.lsp.start({
cmd_env = {
NVIM_LUA_NOTRACK = '1',
},
@@ -101,7 +101,7 @@ describe('vim.lsp.diagnostic', function()
'--headless',
},
offset_encoding = 'utf-16',
})
}, { attach = false }))
end)
fake_uri = 'file:///fake/uri'

View File

@@ -456,7 +456,7 @@ describe('semantic token highlighting', function()
vim.notify = function(...)
table.insert(_G.notifications, 1, { ... })
end
return vim.lsp.start_client({ name = 'dummy', cmd = _G.server.cmd })
return vim.lsp.start({ name = 'dummy', cmd = _G.server.cmd }, { attach = false })
end)
eq(false, exec_lua('return vim.lsp.buf_is_attached(0, ...)', client_id))

View File

@@ -95,7 +95,7 @@ describe('LSP', function()
exec_lua(function()
_G.lsp = require('vim.lsp')
function _G.test__start_client()
return vim.lsp.start_client {
return vim.lsp.start({
cmd_env = {
NVIM_LOG_FILE = fake_lsp_logfile,
NVIM_APPNAME = 'nvim_lsp_test',
@@ -112,7 +112,7 @@ describe('LSP', function()
name = 'test_folder',
},
},
}
}, { attach = false })
end
_G.TEST_CLIENT1 = _G.test__start_client()
end)