Skip to content

Commit 16812ab

Browse files
authored
fix(biome): set lower priority for config files as root #4363
1 parent 9777401 commit 16812ab

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lsp/biome.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,19 @@ return {
5050
'bun.lockb',
5151
'bun.lock',
5252
'deno.lock',
53-
'biome.json',
54-
'biome.jsonc',
5553
}
54+
-- Set a lower priority to avoid spawning multiple servers on monorepos
55+
local biome_config_files = { 'biome.json', 'biome.jsonc' }
5656
-- Give the root markers equal priority by wrapping them in a table
57-
root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, { '.git' } }
58-
or vim.list_extend(root_markers, { '.git' })
57+
root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, biome_config_files, { '.git' } }
58+
or vim.list_extend(root_markers, vim.list_extend(biome_config_files, { '.git' }))
5959

6060
-- We fallback to the current working directory if no project root is found
6161
local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd()
6262

6363
-- We know that the buffer is using Biome if it has a config file
6464
-- in its directory tree.
6565
local filename = vim.api.nvim_buf_get_name(bufnr)
66-
local biome_config_files = { 'biome.json', 'biome.jsonc' }
6766
biome_config_files = util.insert_package_json(biome_config_files, 'biomejs', filename)
6867
local is_buffer_using_biome = vim.fs.find(biome_config_files, {
6968
path = filename,

0 commit comments

Comments
 (0)