diff options
| author | dundargoc <gocdundar@gmail.com> | 2024-11-28 18:11:56 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-11-29 12:17:35 +0100 |
| commit | e869c7e6af0a3c40a2b344a9765779d74dd12720 (patch) | |
| tree | 89d36087d70d26105d032274275c5c7796211a18 /lua | |
| parent | refactor: deprecate util.path.is_dir #3475 (diff) | |
| download | nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.tar nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.tar.gz nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.tar.bz2 nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.tar.lz nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.tar.xz nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.tar.zst nvim-lspconfig-e869c7e6af0a3c40a2b344a9765779d74dd12720.zip | |
refactor: deprecate util.find_mercurial_ancestor
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index f8ffe57e..06718eb2 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -247,15 +247,6 @@ function M.find_git_ancestor(startpath) end) end -function M.find_mercurial_ancestor(startpath) - return M.search_ancestors(startpath, function(path) - -- Support Mercurial directories - if vim.fn.isdirectory(M.path.join(path, '.hg')) == 1 then - return path - end - end) -end - function M.find_node_modules_ancestor(startpath) return M.search_ancestors(startpath, function(path) if vim.fn.isdirectory(M.path.join(path, 'node_modules')) == 1 then @@ -405,4 +396,9 @@ function M.path.exists(filename) return stat and stat.type or false end +--- @deprecated use `vim.fs.find('.hg', { path = startpath, upward = true })` instead +function M.find_mercurial_ancestor(startpath) + return vim.fs.find('.hg', { path = startpath, upward = true }) +end + return M |
