feat(lsp): pass resolved config to cmd() #34550

Problem:
In LSP configs, the function form of `cmd()` cannot easily get the
resolved root dir (workspace). One of the main use-cases of a dynamic
`cmd()` is to be able to start a new server  whose binary may be located
*in the workspace* ([example](https://github.com/neovim/nvim-lspconfig/pull/3912)).

Compare `reuse_client()`, which also receives the resolved config.

Solution:
Pass the resolved config to `cmd()`.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
Julian Visser
2025-06-18 13:52:17 +02:00
committed by GitHub
parent aa8c86e8f3
commit 32f30c4874
5 changed files with 24 additions and 15 deletions

View File

@@ -54,7 +54,7 @@ M.create_server_definition = function()
local server = {}
server.messages = {}
function server.cmd(dispatchers)
function server.cmd(dispatchers, _config)
local closing = false
local handlers = opts.handlers or {}
local srv = {}