aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGuilherme Soares <48023091+guilhas07@users.noreply.github.com>2024-12-14 01:06:28 +0100
committerGitHub <noreply@github.com>2024-12-13 16:06:28 -0800
commit3cb6c05779459eb5fe9cddbb47675593594f0415 (patch)
tree2fd0dadfc8222bdc8db02e082bcc6e698bfc067d /doc
parentfix(regression): fix for vim.fs.find regression not returning parent director... (diff)
downloadnvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.tar
nvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.tar.gz
nvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.tar.bz2
nvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.tar.lz
nvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.tar.xz
nvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.tar.zst
nvim-lspconfig-3cb6c05779459eb5fe9cddbb47675593594f0415.zip
docs: how to get package.json parent dir #3506
Diffstat (limited to 'doc')
-rw-r--r--doc/lspconfig.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/lspconfig.txt b/doc/lspconfig.txt
index f9ba9bfb..e8e9ecec 100644
--- a/doc/lspconfig.txt
+++ b/doc/lspconfig.txt
@@ -298,7 +298,7 @@ below returns a function that takes as its argument the current buffer path.
containing a `.git` directory. >
root_dir = util.find_git_ancestor
- Locate the first parent dir containing a "node_modules" dir: >lua
- vim.fs.find('node_modules', { path = root_dir, upward = true })[1]
+ vim.fs.dirname(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")
@@ -308,7 +308,7 @@ below returns a function that takes as its argument the current buffer path.
be removed.
- Locate the first parent dir containing a "package.json" dir: >lua
- vim.fs.find('package.json', { path = root_dir, upward = true })[1]
+ vim.fs.dirname(vim.fs.find('package.json', { path = root_dir, upward = true })[1])
<
If you have Nvim 0.10 or newer then >lua
vim.fs.root(root_dir, "package.json")