From 10ad0cca1b83713ed98ed4cb7ea60f2ea8e55c49 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Thu, 25 Nov 2021 23:28:56 -0500 Subject: fix: only set cmd_cwd if filepath exists (#1485) --- lua/lspconfig/util.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua/lspconfig/util.lua') diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 72035748..4d340391 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -272,7 +272,8 @@ function M.server_per_root_dir_manager(_make_config) end) -- Launch the server in the root directory used internally by lspconfig, if otherwise unset - if not new_config.cmd_cwd then + -- also check that the path exist + if not new_config.cmd_cwd and uv.fs_realpath(root_dir) then new_config.cmd_cwd = root_dir end -- cgit v1.2.3-70-g09d2