diff options
| author | Julian Berman <Julian@GrayVines.com> | 2021-11-25 10:22:26 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-25 13:22:26 -0500 |
| commit | 09af0c0be575fc3b177b406c8bbcd34c6ab9ae40 (patch) | |
| tree | 63a464e7ba8cba7d78a3ac6fa9d4d3a0e4a3258f /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.tar nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.tar.gz nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.tar.bz2 nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.tar.lz nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.tar.xz nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.tar.zst nvim-lspconfig-09af0c0be575fc3b177b406c8bbcd34c6ab9ae40.zip | |
fix: set correct cwd config key when unset (#1483)
pass `cmd_cwd` instead of `cwd` in `config` to start_client
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/julials.lua | 3 | ||||
| -rw-r--r-- | lua/lspconfig/util.lua | 6 |
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 |
