diff options
| author | Florin Iucha <florin@signbit.net> | 2022-06-28 06:00:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-28 03:00:37 -0700 |
| commit | 05f138a27a40c3dafa7eeb505573404db1c03188 (patch) | |
| tree | ee1ce1ad70c3b04626eedc4251a579039e62aaa0 /lua/lspconfig/util.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.tar nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.tar.gz nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.tar.bz2 nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.tar.lz nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.tar.xz nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.tar.zst nvim-lspconfig-05f138a27a40c3dafa7eeb505573404db1c03188.zip | |
feat: root finder for Mercurial repo #1847
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 88ba42f9..09a22163 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -352,6 +352,14 @@ function M.find_git_ancestor(startpath) end end) end +function M.find_mercurial_ancestor(startpath) + return M.search_ancestors(startpath, function(path) + -- Support Mercurial directories + if M.path.is_dir(M.path.join(path, '.hg')) then + return path + end + end) +end function M.find_node_modules_ancestor(startpath) return M.search_ancestors(startpath, function(path) if M.path.is_dir(M.path.join(path, 'node_modules')) then |
