more diag stuff

This commit is contained in:
Christian Nieves
2024-01-12 01:37:20 -06:00
parent 2e22f0fe46
commit 3021fa292c

View File

@ -1,47 +1,49 @@
return { return {
"Maan2003/lsp_lines.nvim", {
event = "VimEnter", "Maan2003/lsp_lines.nvim",
name = "lsp_lines.nvim", event = { "LspAttach" },
config = function() name = "lsp_lines.nvim",
local signs = { config = function()
Error = "", local signs = {
Warning = " ", Error = " ",
Hint = " ", Warning = " ",
Info = " ", Hint = " ",
Other = " ", Info = " ",
} Other = "",
for type, icon in pairs(signs) do }
local hl = "DiagnosticSign" .. type for type, icon in pairs(signs) do
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) local hl = "DiagnosticSign" .. type
end vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
require("lsp_lines").setup() require("lsp_lines").setup()
vim.schedule(function() vim.schedule(function()
vim.diagnostic.config({
virtual_text = false,
virtual_improved = {
current_line = "hide",
},
virtual_lines = { highlight_whole_line = false, only_current_line = true },
})
end)
end,
keys = {
{
"<leader>l",
function()
local new_value = not vim.diagnostic.config().virtual_lines.only_current_line
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = not new_value, severity_sort = true,
virtual_text = false,
virtual_improved = { virtual_improved = {
current_line = new_value and "hide" or "show", current_line = "hide",
}, },
virtual_lines = { only_current_line = new_value }, virtual_lines = { highlight_whole_line = false, only_current_line = true },
}) })
return new_value end)
end, end,
desc = "Toggle LSP Lines", keys = {
{
"<leader>l",
function()
local new_value = not vim.diagnostic.config().virtual_lines.only_current_line
vim.diagnostic.config({
virtual_improved = {
current_line = new_value and "default" or "hide",
},
virtual_lines = { only_current_line = new_value },
})
return new_value
end,
desc = "Toggle LSP Lines",
},
}, },
}, },
{ {
@ -51,15 +53,9 @@ return {
require("lsp-virtual-improved").setup() require("lsp-virtual-improved").setup()
end, end,
}, },
{
"dgagn/diagflow.nvim",
opts = {
toggle_event = { "InsertEnter" },
},
},
{ {
"folke/trouble.nvim", "folke/trouble.nvim",
event = "VimEnter", event = { "LspAttach" },
config = function() config = function()
-- Diagnostics -- Diagnostics
require("trouble").setup({ require("trouble").setup({