From 98dc1ba7f2539efe32b233bb014afc0a37e75d79 Mon Sep 17 00:00:00 2001 From: naps62 Date: Mon, 17 Aug 2026 13:00:47 +0000 Subject: [PATCH] fix(lsp): drop hand-rolled biome config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit root_dir was computed once, at startup, against whatever buffer happened to be current — freezing one path for the session and breaking lspconfig's local-binary lookup, which reads config.root_dir. Everything overridden here is already handled better upstream: cmd prefers the project-local biome, root_dir is monorepo-aware and resolved per buffer, the filetypes list is wider, and the server only attaches where a biome config applies. Only the formatting opt-out stays, since conform owns that. Also adds virtual_lines for the line under the cursor, which pairs with the existing virtual_text = false. Co-Authored-By: Claude Opus 5 --- lua/configs/lspconfig.lua | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index db220e1..e4c97f3 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -9,18 +9,11 @@ M.defaults = function() vim.lsp.inlay_hint.enable() + -- lspconfig's own biome config already prefers the project-local binary, detects + -- monorepo roots per buffer, and only attaches where a biome config applies. + -- Formatting is the one thing overridden here: conform owns it. vim.lsp.config("biome", { - cmd = { - -- prefer local binary if exists - vim.fn.filereadable "./node_modules/.bin/biome" == 1 and "./node_modules/.bin/biome" or "biome", - "lsp-proxy", - }, - filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "jsonc" }, - root_dir = vim.fs.root(0, { "biome.json", "biome.jsonc", "biome.config.ts", "package.json", ".git" }), - settings = {}, -- add Biome-specific settings if needed - ---@diagnostic disable-next-line: unused-local - on_attach = function(client, _bufnr) - -- disable formatting if you want Conform or another tool to handle formatting + on_attach = function(client) client.server_capabilities.documentFormattingProvider = false end, }) @@ -53,6 +46,7 @@ M.defaults = function() underline = true, severity_sort = true, virtual_text = false, + virtual_lines = { current_line = true }, float = { focusable = false, style = "minimal",