aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-01-14 14:38:43 -0800
committerMichael Lingelbach <m.j.lbach@gmail.com>2021-01-14 14:38:43 -0800
commitbaa45834fce81da70d3aa428ee767ddff238a8c0 (patch)
tree19950f2dd436e04840e3e5ddecd2167c8c22f8ea /lua/lspconfig/util.lua
parentMerge pull request #665 from mjlbach/fix_lsp_info_root_detect (diff)
downloadnvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.tar
nvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.tar.gz
nvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.tar.bz2
nvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.tar.lz
nvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.tar.xz
nvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.tar.zst
nvim-lspconfig-baa45834fce81da70d3aa428ee767ddff238a8c0.zip
Check if language server is executable before trying to start it
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 5b45ff51..607fbad8 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -255,10 +255,15 @@ function M.server_per_root_dir_manager(_make_config)
local client_id = clients[root_dir]
if not client_id then
local new_config = _make_config(root_dir)
- --TODO:mjlbach -- this current isn't printing
+ --TODO:mjlbach -- these prints only show up with nvim_error_writeln()
if not new_config.cmd then
- print(string.format("Error, cmd not defined for [%q]. You must manually define a cmd for the default config for this server. See server documentation.", new_config.name))
+ print(string.format("Error, cmd not defined for [%q]."..
+ "You must manually define a cmd for the default config for this server."
+ .."See server documentation.", new_config.name))
return
+ elseif vim.fn.executable(new_config.cmd[1]) == 0 then
+ print(string.format("Error, cmd [%q] is not executable.", new_config.cmd[1]))
+ return
end
new_config.on_exit = M.add_hook_before(new_config.on_exit, function()
clients[root_dir] = nil