aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
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