diff options
| author | Oskar Haarklou Veileborg <ohv1020@hotmail.com> | 2025-08-20 18:31:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-20 09:31:19 -0700 |
| commit | 99748c019f214d2f4372094fe5766a616f27e124 (patch) | |
| tree | 67b5a446f3dd442569e12e93fa6c0dbd0779e782 | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.tar nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.tar.gz nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.tar.bz2 nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.tar.lz nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.tar.xz nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.tar.zst nvim-lspconfig-99748c019f214d2f4372094fe5766a616f27e124.zip | |
fix(ts/js): give lockfiles equal priority when finding root #4013
| -rw-r--r-- | lsp/biome.lua | 3 | ||||
| -rw-r--r-- | lsp/eslint.lua | 7 | ||||
| -rw-r--r-- | lsp/ts_ls.lua | 3 | ||||
| -rw-r--r-- | lsp/tsgo.lua | 3 | ||||
| -rw-r--r-- | lsp/vtsls.lua | 3 |
5 files changed, 12 insertions, 7 deletions
diff --git a/lsp/biome.lua b/lsp/biome.lua index 88faa714..b2f6cfea 100644 --- a/lsp/biome.lua +++ b/lsp/biome.lua @@ -45,7 +45,8 @@ return { -- We select then from the project root, which is identified by the presence of a package -- manager lock file. local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } - local project_root = vim.fs.root(bufnr, project_root_markers) + -- Give the root markers equal priority by wrapping them in a table + local project_root = vim.fs.root(bufnr, { project_root_markers }) if not project_root then return end diff --git a/lsp/eslint.lua b/lsp/eslint.lua index d54bd65b..36b9780a 100644 --- a/lsp/eslint.lua +++ b/lsp/eslint.lua @@ -92,9 +92,10 @@ return { -- We select then from the project root, which is identified by the presence of a package -- manager lock file. local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } - local project_root = vim.fs.root(bufnr, project_root_markers) + -- Give the root markers equal priority by wrapping them in a table + local project_root = vim.fs.root(bufnr, { project_root_markers }) if not project_root then - return nil + return end -- We know that the buffer is using ESLint if it has a config file @@ -113,7 +114,7 @@ return { stop = vim.fs.dirname(project_root), })[1] if not is_buffer_using_eslint then - return nil + return end on_dir(project_root) diff --git a/lsp/ts_ls.lua b/lsp/ts_ls.lua index 256b1132..29d36c1c 100644 --- a/lsp/ts_ls.lua +++ b/lsp/ts_ls.lua @@ -59,7 +59,8 @@ return { -- We select then from the project root, which is identified by the presence of a package -- manager lock file. local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } - local project_root = vim.fs.root(bufnr, project_root_markers) + -- Give the root markers equal priority by wrapping them in a table + local project_root = vim.fs.root(bufnr, { project_root_markers }) if not project_root then return end diff --git a/lsp/tsgo.lua b/lsp/tsgo.lua index 9409b4e3..d7b493e4 100644 --- a/lsp/tsgo.lua +++ b/lsp/tsgo.lua @@ -31,7 +31,8 @@ return { -- We select then from the project root, which is identified by the presence of a package -- manager lock file. local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } - local project_root = vim.fs.root(bufnr, project_root_markers) + -- Give the root markers equal priority by wrapping them in a table + local project_root = vim.fs.root(bufnr, { project_root_markers }) if not project_root then return end diff --git a/lsp/vtsls.lua b/lsp/vtsls.lua index 3f89d77e..5c17746a 100644 --- a/lsp/vtsls.lua +++ b/lsp/vtsls.lua @@ -82,7 +82,8 @@ return { -- We select then from the project root, which is identified by the presence of a package -- manager lock file. local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } - local project_root = vim.fs.root(bufnr, project_root_markers) + -- Give the root markers equal priority by wrapping them in a table + local project_root = vim.fs.root(bufnr, { project_root_markers }) if not project_root then return end |
