feat(lsp): use uv_spawn to check if server executable (#16430)

Previously, the built-in language server client checked if the first
argument of cmd was executable via vim.fn.executable. This ignores PATH
injected via cmd_env. Instead, we now start the client via uv.spawn, and
handle the failure mode, reporting the error back to the user.

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
This commit is contained in:
Michael Lingelbach
2021-11-25 07:54:45 -05:00
committed by GitHub
parent 6ea5e80393
commit 1a60580925
2 changed files with 11 additions and 3 deletions

View File

@@ -790,6 +790,9 @@ function lsp.start_client(config)
env = config.cmd_env;
})
-- Return nil if client fails to start
if not rpc then return end
local client = {
id = client_id;
name = name;