diff options
| author | Jacob Reed <jacob.russell.reed@gmail.com> | 2024-12-13 14:30:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-13 20:30:45 +0100 |
| commit | 4761665b4be82c46612cdfb4ea9c90de25875c4f (patch) | |
| tree | 020de8b61d569ccf10191e1936c3dd38cbcd149b /lua/lspconfig/util.lua | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.tar nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.tar.gz nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.tar.bz2 nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.tar.lz nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.tar.xz nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.tar.zst nvim-lspconfig-4761665b4be82c46612cdfb4ea9c90de25875c4f.zip | |
fix(regression): fix for vim.fs.find regression not returning parent directory (#3505)
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index a5cf67fd..cc97867f 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -248,7 +248,7 @@ end function M.insert_package_json(config_files, field, fname) local path = vim.fn.fnamemodify(fname, ':h') - local root_with_package = vim.fs.find('package.json', { path = path, upward = true })[1] + local root_with_package = vim.fs.dirname(vim.fs.find('package.json', { path = path, upward = true })[1]) if root_with_package then -- only add package.json if it contains field parameter @@ -380,17 +380,17 @@ end --- @deprecated use `vim.fs.find('.hg', { path = startpath, upward = true })[1]` instead function M.find_mercurial_ancestor(startpath) - return vim.fs.find('.hg', { path = startpath, upward = true })[1] + return vim.fs.dirname(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] + return vim.fs.dirname(vim.fs.find('node_modules', { path = startpath, upward = true })[1]) end --- @deprecated use `vim.fs.find('package.json', { path = startpath, upward = true })[1]` instead function M.find_package_json_ancestor(startpath) - return vim.fs.find('package.json', { path = startpath, upward = true })[1] + return vim.fs.dirname(vim.fs.find('package.json', { path = startpath, upward = true })[1]) end return M |
