From 0a6431139a3d19c859ed5ee94ff43c5f0943ee69 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Thu, 18 Sep 2025 13:41:41 +0100 Subject: [PATCH] wip --- lua/configs/lspconfig.lua | 46 ++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index 4bcb4a4..b2c961f 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -11,12 +11,6 @@ M.defaults = function() local servers = { "html", "lua_ls", "biome", "solidity_ls_nomicfoundation", "tinymist" } vim.lsp.inlay_hint.enable() - -- vim.lsp.handlers["textDocument/codeAction"] = vim.lsp.handlers.code_action - -- border = "rounded", -- You can also use 'single', 'double', 'solid', etc. - -- }) - -- vim.diagnostic.config { virtual_text = true } - -- vim.lsp.handlers["textDocument/publishDiagnostics"] = - -- vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false }) for _, lsp in ipairs(servers) do lspconfig(lsp, { @@ -28,7 +22,26 @@ M.defaults = function() end vim.diagnostic.config { + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "", + [vim.diagnostic.severity.WARN] = "", + [vim.diagnostic.severity.HINT] = "", + [vim.diagnostic.severity.INFO] = "", + }, + }, + update_in_insert = true, + underline = true, + severity_sort = true, virtual_text = false, + float = { + focusable = false, + style = "minimal", + border = "single", + header = "", + prefix = "", + suffix = "", + }, } end @@ -54,18 +67,15 @@ end M.rustacean = { server = { - -- cmd = function() - -- return { "ra-multiplex" } - -- end, - on_init = nvlsp.on_init, - capabilities = nvlsp.capabilities, + -- on_init = nvlsp.on_init, + -- capabilities = nvlsp.capabilities, default_settings = { ["rust-analyzer"] = { check = { command = "clippy" }, checkOnSave = true, cargo = { targetDir = true, - extraArgs = { "--edition=2024" }, + -- extraArgs = { "--edition=2024" }, }, diagnostics = { disabled = { "inactive-code", "macro-error" }, @@ -75,13 +85,9 @@ M.rustacean = { on_attach = function(client, bufnr) M.on_attach(client, bufnr) - local function opts(desc) - return { buffer = bufnr, desc = "LSP " .. desc } - end - map("n", "ga", function() vim.cmd.RustLsp "codeAction" - end, opts "Rust Code Actions") + end, { buffer = bufnr }) end, }, tools = { @@ -107,9 +113,9 @@ M.typescript = { client.server_capabilities.documentFormattingProvider = false end, }, - handlers = { - ["textDocument/publishDiagnostics"] = vim.diagnostic.config { virtual_text = false }, - }, + -- handlers = { + -- ["textDocument/publishDiagnostics"] = vim.diagnostic.config { virtual_text = false }, + -- }, } return M