aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lspconfig')
-rw-r--r--lua/lspconfig/julials.lua3
-rw-r--r--lua/lspconfig/util.lua6
2 files changed, 4 insertions, 5 deletions
diff --git a/lua/lspconfig/julials.lua b/lua/lspconfig/julials.lua
index 98ca2931..e2aa5d4f 100644
--- a/lua/lspconfig/julials.lua
+++ b/lua/lspconfig/julials.lua
@@ -44,9 +44,6 @@ local cmd = {
configs.julials = {
default_config = {
cmd = cmd,
- on_new_config = function(new_config, root_dir)
- new_config.cmd_cwd = root_dir
- end,
filetypes = { 'julia' },
root_dir = function(fname)
return util.root_pattern 'Project.toml'(fname) or util.find_git_ancestor(fname)
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