diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-01-15 00:41:11 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 00:41:11 -0800 |
| commit | fb927a55db165c4d941528e37dac11bdfc239f7e (patch) | |
| tree | c579d839022b1e796e37baf8cc98bcd15aee21c5 /lua | |
| parent | Merge pull request #661 from mjlbach/lspinfo_fix_display (diff) | |
| parent | Check if language server is executable before trying to start it (diff) | |
| download | nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.tar nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.tar.gz nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.tar.bz2 nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.tar.lz nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.tar.xz nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.tar.zst nvim-lspconfig-fb927a55db165c4d941528e37dac11bdfc239f7e.zip | |
Merge pull request #670 from mjlbach/add_executable_check
Check if language server is executable before trying to start it
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 9 |
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 |
