diff options
| author | dundargoc <gocdundar@gmail.com> | 2024-12-21 14:08:47 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-12-21 16:10:35 +0100 |
| commit | 45c5095097702e8316f9409b39b2721db8534db2 (patch) | |
| tree | 6004d82c4560500b2ac384deab84d1ef778dd5dc /lua/lspconfig/util.lua | |
| parent | refactor: fix luals warnings (diff) | |
| download | nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.tar nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.tar.gz nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.tar.bz2 nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.tar.lz nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.tar.xz nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.tar.zst nvim-lspconfig-45c5095097702e8316f9409b39b2721db8534db2.zip | |
refactor: deprecate util.path.join
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 213e87f3..c1ad0128 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -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) @@ -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, @@ -204,7 +199,7 @@ function M.root_pattern(...) startpath = M.strip_archive_subpath(startpath) for _, pattern in ipairs(patterns) do local match = M.search_ancestors(startpath, function(path) - for _, p in ipairs(vim.fn.glob(M.path.join(escape_wildcards(path), pattern), true, true)) do + for _, p in ipairs(vim.fn.glob(table.concat({ escape_wildcards(path), pattern }, '/'), true, true)) do if vim.loop.fs_stat(p) then return path end @@ -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]) |
