mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 21:37:43 +00:00
backport: feat(lsp): pass resolved config to cmd() #34560
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()`.
(cherry picked from commit 32f30c4874)
Co-authored-by: Julian Visser <12615757+justmejulian@users.noreply.github.com>
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user