aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorVI0L3TF0X <73484028+V1OL3TF0X@users.noreply.github.com>2026-05-18 11:39:16 +0200
committerGitHub <noreply@github.com>2026-05-18 05:39:16 -0400
commit5853b2872f44889732c4816b5c78125ea44f5630 (patch)
tree67b2cc26c1ea7da97d11ff7a9628691ca88f0f17 /lua
parentdocs: update generated annotations (diff)
downloadnvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.tar
nvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.tar.gz
nvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.tar.bz2
nvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.tar.lz
nvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.tar.xz
nvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.tar.zst
nvim-lspconfig-5853b2872f44889732c4816b5c78125ea44f5630.zip
feat: update oxfmt, oxlint to detect vite plus #4395
Problem: oxfmt and oxlint have the ability to use vite plus config, as mentioned here: https://github.com/voidzero-dev/vite-plus/issues/629 Solution: update the configs to reflect that.
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/util.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 2282e3e2..7c1afed6 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -55,17 +55,20 @@ end
---
--- @param root_files string[] List of root-marker files to append to.
--- @param new_names string[] Potential root-marker filenames (e.g. `{ 'package.json', 'package.json5' }`) to inspect for the given `field`.
---- @param field string Field to search for in the given `new_names` files.
+--- @param field string | string[] Field(s) to search for in the given `new_names` files.
--- @param fname string Full path of the current buffer name to start searching upwards from.
function M.root_markers_with_field(root_files, new_names, field, fname)
local path = vim.fn.fnamemodify(fname, ':h')
local found = vim.fs.find(new_names, { path = path, upward = true, type = 'file' })
+ local fields = type(field) == 'string' and { field } or field
for _, f in ipairs(found or {}) do
-- Match the given `field`.
local file = assert(io.open(f, 'r'))
for line in file:lines() do
- if line:find(field) then
+ if vim.iter(fields):any(function(s)
+ return line:find(s)
+ end) then
root_files[#root_files + 1] = vim.fs.basename(f)
break
end