From 09af0c0be575fc3b177b406c8bbcd34c6ab9ae40 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Thu, 25 Nov 2021 10:22:26 -0800 Subject: fix: set correct cwd config key when unset (#1483) pass `cmd_cwd` instead of `cwd` in `config` to start_client --- lua/lspconfig/util.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua/lspconfig/util.lua') diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index aaba4db2..72035748 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -271,8 +271,10 @@ function M.server_per_root_dir_manager(_make_config) single_file_clients[root_dir] = nil end) - -- Launch the server in the root directory used internally by lspconfig, if applicable - new_config.cwd = root_dir + -- Launch the server in the root directory used internally by lspconfig, if otherwise unset + if not new_config.cmd_cwd then + new_config.cmd_cwd = root_dir + end -- Sending rootDirectory and workspaceFolders as null is not explicitly -- codified in the spec. Certain servers crash if initialized with a NULL -- cgit v1.2.3-70-g09d2