aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-12-13 14:53:08 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-12-14 17:24:12 +0100
commit12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2 (patch)
tree0bfbfbd378ba61cde77f9132b6d0c3570805eb88 /doc
parentdocs: how to get package.json parent dir #3506 (diff)
downloadnvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.tar
nvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.tar.gz
nvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.tar.bz2
nvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.tar.lz
nvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.tar.xz
nvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.tar.zst
nvim-lspconfig-12d163c5c2b05e85431f2deef5d9d59a8fd8dfc2.zip
refactor: deprecate util.find_git_ancestor
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
Diffstat (limited to 'doc')
-rw-r--r--doc/lspconfig.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/lspconfig.txt b/doc/lspconfig.txt
index e8e9ecec..971f11e1 100644
--- a/doc/lspconfig.txt
+++ b/doc/lspconfig.txt
@@ -294,9 +294,17 @@ below returns a function that takes as its argument the current buffer path.
filesystem. Parent directories are traversed once per pattern, in the order
the patterns are specified. >
root_dir = util.root_pattern('pyproject.toml', 'requirements.txt')
-- `util.find_git_ancestor`: a function that locates the first parent directory
- containing a `.git` directory. >
- root_dir = util.find_git_ancestor
+
+- Locate the first parent dir containing a ".git" file or directory: >lua
+ vim.fs.dirname(vim.fs.find('.git', { path = root_dir, upward = true })[1])
+<
+ If you have Nvim 0.10 or newer then >lua
+ vim.fs.root(root_dir, ".git")
+<
+ can be used instead.
+ - Note: The old `util.find_git_ancestor` API is deprecated and will
+ be removed.
+<
- Locate the first parent dir containing a "node_modules" dir: >lua
vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
<