mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(lsp): avoid pipe leaks if lsp cmd isn't executable (#19717)
The `onexit` handler isn't called if `uv.spawn` doesn't return a handle.
This commit is contained in:
parent
8b67f37798
commit
996fc2256b
@ -340,6 +340,9 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
|
|||||||
end
|
end
|
||||||
handle, pid = uv.spawn(cmd, spawn_params, onexit)
|
handle, pid = uv.spawn(cmd, spawn_params, onexit)
|
||||||
if handle == nil then
|
if handle == nil then
|
||||||
|
stdin:close()
|
||||||
|
stdout:close()
|
||||||
|
stderr:close()
|
||||||
local msg = string.format('Spawning language server with cmd: `%s` failed', cmd)
|
local msg = string.format('Spawning language server with cmd: `%s` failed', cmd)
|
||||||
if string.match(pid, 'ENOENT') then
|
if string.match(pid, 'ENOENT') then
|
||||||
msg = msg
|
msg = msg
|
||||||
|
Loading…
Reference in New Issue
Block a user