Fully use biome as an lsp

This commit is contained in:
2025-08-04 16:58:41 +02:00
parent 19da9716a9
commit 3db690d653
4 changed files with 25 additions and 12 deletions
+13
View File
@@ -0,0 +1,13 @@
return {
-- Disable lunching from node_modules (no nix binary)
cmd = { "biome", "lsp-proxy" },
-- Inline package.json (remove check for biome installed)
root_dir = function(_, on_dir)
-- To support monorepos, biome recommends starting the search for the root from cwd
-- https://biomejs.dev/guides/big-projects/#use-multiple-configuration-files
local cwd = vim.fn.getcwd()
local root_files = { 'biome.json', 'biome.jsonc', 'package.json', 'package.json5' }
local root_dir = vim.fs.dirname(vim.fs.find(root_files, { path = cwd, upward = true })[1])
on_dir(root_dir)
end,
}
+11
View File
@@ -0,0 +1,11 @@
-- use biome for formatting
return {
---@param client vim.lsp.Client
on_init = function(client, _)
if client.server_capabilities then
client.server_capabilities["documentFormattingProvider"] = false
client.server_capabilities["documentRangeFormattingProvider"] = false
client.server_capabilities["documentOnTypeFormattingProvider"] = false
end
end,
}
+1 -1
View File
@@ -140,6 +140,7 @@ in
lua-language-server
bash-language-server
sqls
biome
# gopls also needs go /shame
gopls
@@ -154,7 +155,6 @@ in
alejandra
pgformatter
csharpier
biome
ruff
# repl
-11
View File
@@ -15,13 +15,6 @@ return {
default_format_opts = { async = true },
formatters_by_ft = {
python = { "ruff_format", "ruff_organize_imports" },
javascript = { "biome-check", "prettierd", "prettier", stop_after_first = true },
typescript = { "biome-check", "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "biome-check", "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "biome-check", "prettierd", "prettier", stop_after_first = true },
json = { "biome-check", "prettierd", "prettier", stop_after_first = true },
css = { "biome-check", "prettierd", "prettier", stop_after_first = true },
html = { "biome-check", "prettierd", "prettier", stop_after_first = true },
sql = { "pg_format" },
cs = { "csharpier" },
nix = { "alejandra" },
@@ -29,10 +22,6 @@ return {
["_"] = { "injected", lsp_format = "last" },
},
formatters = {
["biome-check"] = {
-- disable node module search since native binaries can't be run from nix
command = "biome",
},
csharpier = function()
return {
command = "csharpier",