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 | |
| 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.
| -rw-r--r-- | .github/ci/run_sanitizer.sh | 2 | ||||
| -rw-r--r-- | lua/lspconfig/util.lua | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/.github/ci/run_sanitizer.sh b/.github/ci/run_sanitizer.sh index f2fadb9c..90a6b01a 100644 --- a/.github/ci/run_sanitizer.sh +++ b/.github/ci/run_sanitizer.sh @@ -15,7 +15,7 @@ if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANC exit 1 fi -SEARCH_PATTERN='(util\.path\.dirname|util\.path\.sanitize|util\.path\.exists|util\.path\.is_file|util\.path\.is_dir)' +SEARCH_PATTERN='(util\.path\.dirname|util\.path\.sanitize|util\.path\.exists|util\.path\.is_file|util\.path\.is_dir|util\.find_mercurial_ancestor)' if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANCH}" -- '*.lua' | grep -Ev '\.lua$' | grep -E "^\+.*${SEARCH_PATTERN}" ; then echo 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 |
