From bf96d7276fb0391f24b96eaa07f0e9d6bd536c81 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Thu, 11 Nov 2021 10:36:08 -0800 Subject: feat: spawn the language server in resolved root directory (#1407) --- lua/lspconfig/util.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lua') diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index dbac70fd..8fe94741 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -273,6 +273,10 @@ function M.server_per_root_dir_manager(_make_config) clients[root_dir] = nil 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 + -- Sending rootDirectory and workspaceFolders as null is not explicitly -- codified in the spec. Certain servers crash if initialized with a NULL -- root directory. -- cgit v1.2.3-70-g09d2