aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-11-28 18:11:56 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-12-08 18:32:42 +0100
commit19626a3a4484de12c3d8c0833bb49ecb3dcd5c76 (patch)
treef6a62d730ce925591d57b83a70a73b3c58029eb6 /lua/lspconfig/util.lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.tar
nvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.tar.gz
nvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.tar.bz2
nvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.tar.lz
nvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.tar.xz
nvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.tar.zst
nvim-lspconfig-19626a3a4484de12c3d8c0833bb49ecb3dcd5c76.zip
refactor: deprecate util.find_node_modules_ancestor
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua13
1 files changed, 5 insertions, 8 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 1b186e85..7b894ee3 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -246,14 +246,6 @@ function M.find_git_ancestor(startpath)
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
- return path
- end
- end)
-end
-
function M.find_package_json_ancestor(startpath)
return M.search_ancestors(startpath, function(path)
local jsonpath = M.path.join(path, 'package.json')
@@ -400,4 +392,9 @@ function M.find_mercurial_ancestor(startpath)
return vim.fs.find('.hg', { path = startpath, upward = true })[1]
end
+--- @deprecated use `vim.fs.find('node_modules', { path = startpath, upward = true })[1]` instead
+function M.find_node_modules_ancestor(startpath)
+ return vim.fs.find('node_modules', { path = startpath, upward = true })[1]
+end
+
return M