aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-12-21 16:16:04 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-12-21 18:15:15 +0100
commitf1405c1ea5d7a1051a8ced3110d7cf3b8524041b (patch)
treead427de2c3d627476120c22b0187fbd0662a3a21
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.tar
nvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.tar.gz
nvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.tar.bz2
nvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.tar.lz
nvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.tar.xz
nvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.tar.zst
nvim-lspconfig-f1405c1ea5d7a1051a8ced3110d7cf3b8524041b.zip
refactor: deprecate util.path.path_separator
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
-rw-r--r--lua/lspconfig/configs/glint.lua2
-rw-r--r--lua/lspconfig/configs/relay_lsp.lua2
-rw-r--r--lua/lspconfig/util.lua6
3 files changed, 5 insertions, 5 deletions
diff --git a/lua/lspconfig/configs/glint.lua b/lua/lspconfig/configs/glint.lua
index 8baa7256..5c3c97c6 100644
--- a/lua/lspconfig/configs/glint.lua
+++ b/lua/lspconfig/configs/glint.lua
@@ -7,7 +7,7 @@ return {
local project_root = vim.fs.find('node_modules', { path = new_root_dir, upward = true })[1]
-- Glint should not be installed globally.
local node_bin_path = project_root .. '/node_modules/.bin'
- local path = node_bin_path .. util.path.path_separator .. vim.env.PATH
+ local path = node_bin_path .. (vim.fn.has('win32') == 1 and ';' or ':') .. vim.env.PATH
if config.cmd_env then
config.cmd_env.PATH = path
else
diff --git a/lua/lspconfig/configs/relay_lsp.lua b/lua/lspconfig/configs/relay_lsp.lua
index baf5578c..78ec20a0 100644
--- a/lua/lspconfig/configs/relay_lsp.lua
+++ b/lua/lspconfig/configs/relay_lsp.lua
@@ -26,7 +26,7 @@ return {
local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1]
local node_bin_path = project_root .. '/node_modules/.bin'
local compiler_cmd = { node_bin_path .. '/relay-compiler', '--watch' }
- local path = node_bin_path .. util.path.path_separator .. vim.env.PATH
+ local path = node_bin_path .. (vim.fn.has('win32') == 1 and ';' or ':') .. vim.env.PATH
if config.cmd_env then
config.cmd_env.PATH = path
else
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index c1ad0128..7a47d722 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -158,13 +158,10 @@ M.path = (function()
return dir == root
end
- local path_separator = iswin and ';' or ':'
-
return {
traverse_parents = traverse_parents,
iterate_parents = iterate_parents,
is_descendant = is_descendant,
- path_separator = path_separator,
}
end)()
@@ -363,6 +360,9 @@ function M.path.join(...)
return table.concat({ ... }, '/')
end
+--- @deprecated use `vim.fn.has('win32') == 1 and ';' or ':'` instead
+M.path.path_separator = vim.fn.has('win32') == 1 and ';' or ':'
+
--- @deprecated use `vim.fs.dirname(vim.fs.find('.hg', { path = startpath, upward = true })[1])` instead
function M.find_mercurial_ancestor(startpath)
return vim.fs.dirname(vim.fs.find('.hg', { path = startpath, upward = true })[1])