diff options
| -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 |
