diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-11-25 07:54:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-25 07:54:45 -0500 |
commit | 1a60580925865445efbe476931dd02ef1a3a8e7f (patch) | |
tree | 64fb35f610a1cc62b7e0cf5b18a4d8fba69122bd /runtime/lua/vim/lsp.lua | |
parent | 6ea5e80393dbcc6205ee8586c29a097e8a08ad53 (diff) | |
download | rneovim-1a60580925865445efbe476931dd02ef1a3a8e7f.tar.gz rneovim-1a60580925865445efbe476931dd02ef1a3a8e7f.tar.bz2 rneovim-1a60580925865445efbe476931dd02ef1a3a8e7f.zip |
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>
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index a380164a51..4b13bea276 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -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; |