Skip to content

Commit

Permalink
refactor: deprecate util.path.join
Browse files Browse the repository at this point in the history
Work on neovim#2079.
  • Loading branch information
dundargoc committed Dec 21, 2024
1 parent 040001d commit 161b48f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ M.path = (function()
end
end

local function path_join(...)
return table.concat(M.tbl_flatten { ... }, '/')
end

-- Traverse the path calling cb along the way.
local function traverse_parents(path, cb)
path = vim.loop.fs_realpath(path)
Expand Down Expand Up @@ -165,7 +161,6 @@ M.path = (function()
local path_separator = iswin and ';' or ':'

return {
join = path_join,
traverse_parents = traverse_parents,
iterate_parents = iterate_parents,
is_descendant = is_descendant,
Expand Down Expand Up @@ -363,6 +358,11 @@ function M.path.exists(filename)
return stat and stat.type or false
end

--- @deprecated use `table.concat({"path1", "path2"})` or regular string concatenation instead
function M.path.join(...)
return table.concat({ ... }, '/')
end

--- @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

0 comments on commit 161b48f

Please sign in to comment.