From ded2d9a7b3aa8f087c3c27bc9b65187221edc5b7 Mon Sep 17 00:00:00 2001 From: Bruno Carlin Date: Tue, 11 Feb 2025 15:23:05 +0100 Subject: [PATCH] fix(nvim): fix the way diagnostics are configured --- nvim/.config/nvim/lua/settings/lsp.lua | 35 +++++++++++--------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/nvim/.config/nvim/lua/settings/lsp.lua b/nvim/.config/nvim/lua/settings/lsp.lua index 95fd08e..66deef8 100644 --- a/nvim/.config/nvim/lua/settings/lsp.lua +++ b/nvim/.config/nvim/lua/settings/lsp.lua @@ -7,32 +7,25 @@ vim.diagnostic.config({ source = "always", -- Or "if_many" border = "rounded", }, --- signs = { --- text = { --- [vim.diagnostic.severity.HINT] = '💡', --- [vim.diagnostic.severity.INFO] = '', --- [vim.diagnostic.severity.WARN] = '', --- [vim.diagnostic.severity.ERROR] = '', --- }, --- numhl = { --- [vim.diagnostic.severity.HINT] = 'DiagnosticSignHint', --- [vim.diagnostic.severity.INFO] = 'DiagnosticSignInfo', --- [vim.diagnostic.severity.WARN] = 'DiagnosticSignWarn', --- [vim.diagnostic.severity.ERROR] = 'DiagnosticSignError', --- }, --- }, - signs = true, + signs = { + text = { + [vim.diagnostic.severity.HINT] = '💡', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.ERROR] = '', + }, + numhl = { + [vim.diagnostic.severity.HINT] = 'DiagnosticSignHint', + [vim.diagnostic.severity.INFO] = 'DiagnosticSignInfo', + [vim.diagnostic.severity.WARN] = 'DiagnosticSignWarn', + [vim.diagnostic.severity.ERROR] = 'DiagnosticSignError', + }, + }, underline = true, update_in_insert = true, severity_sort = true, }) -local signs = { Error = "", Warn = "", Hint = "💡", Info = "" } -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) -end - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" })