diff options
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 6f334ae3..aaba4db2 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -258,16 +258,13 @@ function M.server_per_root_dir_manager(_make_config) return end if not new_config.cmd then - print( + vim.notify( string.format( - 'Error: cmd not defined for %q. You must manually set cmd in the setup{} call according to server_configurations.md, see :help lspconfig-index.', + 'Error: cmd not defined for %q. Manually set cmd in the setup {} call according to server_configurations.md, see :help lspconfig-index.', new_config.name ) ) return - elseif vim.fn.executable(new_config.cmd[1]) == 0 then - vim.notify(string.format('cmd [%q] is not executable.', new_config.cmd[1]), vim.log.levels.Error) - return end new_config.on_exit = M.add_hook_before(new_config.on_exit, function() clients[root_dir] = nil @@ -285,6 +282,12 @@ function M.server_per_root_dir_manager(_make_config) new_config.workspace_folders = nil end client_id = lsp.start_client(new_config) + + -- Handle failures in start_client + if not client_id then + return + end + if single_file_mode then single_file_clients[root_dir] = client_id else |
