add biome and two lsp at once

This commit is contained in:
2026-05-28 02:03:38 +03:00
parent 2c52feaeaa
commit b3fad1fd25
4 changed files with 121 additions and 7 deletions

23
lua/lspconfig/util.lua Normal file
View File

@@ -0,0 +1,23 @@
local M = {}
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 })
for _, f in ipairs(found or {}) do
for line in io.lines(f) do
if line:find(field) then
root_files[#root_files + 1] = vim.fs.basename(f)
break
end
end
end
return root_files
end
function M.insert_package_json(root_files, field, fname)
return M.root_markers_with_field(root_files, { 'package.json', 'package.json5' }, field, fname)
end
return M