Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: deprecate util.path.path_separator #3521

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/lspconfig/configs/glint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/lspconfig/configs/relay_lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)()

Expand Down Expand Up @@ -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])
Expand Down
Loading