mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix: show error when language server start fails and prevent future requests
This commit is contained in:
parent
0c7610cf9d
commit
365c353c9a
@ -376,6 +376,9 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
|
|||||||
spawn_params.env = env_merge(extra_spawn_params.env)
|
spawn_params.env = env_merge(extra_spawn_params.env)
|
||||||
end
|
end
|
||||||
handle, pid = uv.spawn(cmd, spawn_params, onexit)
|
handle, pid = uv.spawn(cmd, spawn_params, onexit)
|
||||||
|
if handle == nil then
|
||||||
|
error(string.format("start `%s` failed: %s", cmd, pid))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--@private
|
--@private
|
||||||
@ -386,7 +389,7 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
|
|||||||
--@returns true if the payload could be scheduled, false if the main event-loop is in the process of closing.
|
--@returns true if the payload could be scheduled, false if the main event-loop is in the process of closing.
|
||||||
local function encode_and_send(payload)
|
local function encode_and_send(payload)
|
||||||
local _ = log.debug() and log.debug("rpc.send.payload", payload)
|
local _ = log.debug() and log.debug("rpc.send.payload", payload)
|
||||||
if handle:is_closing() then return false end
|
if handle == nil or handle:is_closing() then return false end
|
||||||
-- TODO(ashkan) remove this once we have a Lua json_encode
|
-- TODO(ashkan) remove this once we have a Lua json_encode
|
||||||
schedule(function()
|
schedule(function()
|
||||||
local encoded = assert(json_encode(payload))
|
local encoded = assert(json_encode(payload))
|
||||||
|
Loading…
Reference in New Issue
Block a user