From 8373a1b7a7ab7a9972b55182073be5ac2f3bec0a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 21 Aug 2025 21:31:43 -0400 Subject: fix(ts/js): support older Nvim 0.11.x fix #4023 --- lsp/vtsls.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lsp/vtsls.lua') diff --git a/lsp/vtsls.lua b/lsp/vtsls.lua index 5c17746a..258e8eaa 100644 --- a/lsp/vtsls.lua +++ b/lsp/vtsls.lua @@ -81,9 +81,10 @@ return { -- As stated in the documentation above, this LSP supports monorepos and simple projects. -- 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 root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } -- Give the root markers equal priority by wrapping them in a table - local project_root = vim.fs.root(bufnr, { project_root_markers }) + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers } or root_markers + local project_root = vim.fs.root(bufnr, root_markers) if not project_root then return end -- cgit v1.2.3-70-g09d2