improved diag

This commit is contained in:
Bryan Ramos 2026-03-11 06:35:31 -04:00
parent 9860b8f0ab
commit cf44106133
2 changed files with 37 additions and 0 deletions

View file

@ -141,6 +141,39 @@ return {
config = function()
local lspconfig = require('lspconfig')
-- Diagnostic display configuration
vim.diagnostic.config({
virtual_text = {
prefix = '',
spacing = 2,
},
float = {
border = 'rounded',
source = true,
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = '',
[vim.diagnostic.severity.WARN] = '',
[vim.diagnostic.severity.INFO] = '',
[vim.diagnostic.severity.HINT] = '',
},
},
underline = true,
update_in_insert = false,
severity_sort = true,
})
-- Add border to hover and signature help windows
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' }
)
-- Get all known server names by scanning lspconfig's lsp directory
local function get_all_servers()
local servers = {}

View file

@ -50,6 +50,10 @@ return {
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action" },
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename Variable" },
{ "<leader>ch", vim.lsp.buf.hover, desc = "Hover Info" },
{ "<leader>ce", vim.diagnostic.open_float, desc = "Show Diagnostic" },
{ "]d", vim.diagnostic.goto_next, desc = "Next Diagnostic" },
{ "[d", vim.diagnostic.goto_prev, desc = "Prev Diagnostic" },
{ "<leader>G", group = "Git"},
{ "<leader>f", group = "Files"},