mirror of
https://github.com/zoriya/flake.git
synced 2026-05-30 01:38:11 +00:00
Fully use biome as an lsp
This commit is contained in:
@@ -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,
|
||||
}
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user