From 19626a3a4484de12c3d8c0833bb49ecb3dcd5c76 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 28 Nov 2024 18:11:56 +0100 Subject: refactor: deprecate util.find_node_modules_ancestor Work on https://github.com/neovim/nvim-lspconfig/issues/2079. --- doc/lspconfig.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/lspconfig.txt b/doc/lspconfig.txt index eb476e62..7ae15890 100644 --- a/doc/lspconfig.txt +++ b/doc/lspconfig.txt @@ -297,9 +297,14 @@ below returns a function that takes as its argument the current buffer path. - `util.find_git_ancestor`: a function that locates the first parent directory containing a `.git` directory. > root_dir = util.find_git_ancestor -- `util.find_node_modules_ancestor`: a function that locates the first parent - directory containing a `node_modules` directory. > - root_dir = util.find_node_modules_ancestor +- Locate the first parent dir containing a "node_modules" dir: >lua + vim.fs.find('node_modules', { path = root_dir, upward = true })[1] +< + If you have Nvim 0.10 or newer then >lua + vim.fs.root(root_dir, "node_modules") +< + can be used instead. + - Note: The old `util.find_node_modules_ancestor` API is deprecated and will be removed. - `util.find_package_json_ancestor`: a function that locates the first parent directory containing a `package.json`. > root_dir = util.find_package_json_ancestor -- cgit v1.2.3-70-g09d2