feat(lsp): Add trouble

NOTE: I have put trouble here as it is mainly used for lsp diagnostics
This commit is contained in:
Robert Morrison 2026-04-10 02:47:19 +01:00
parent e581acb652
commit 25a9d2ba11

View File

@ -1,3 +1,5 @@
---@module "lazy.nvim"
---@type LazySpec[]
return { return {
{ {
"mason-org/mason-lspconfig.nvim", "mason-org/mason-lspconfig.nvim",
@ -7,7 +9,9 @@ return {
}, },
}, },
dependencies = { dependencies = {
{ "mason-org/mason.nvim", opts = {} }, {
"mason-org/mason.nvim", opts = {}
},
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
}, },
}, },
@ -20,4 +24,69 @@ return {
}, },
}, },
}, },
{
"folke/trouble.nvim",
opts = {},
cmd = "Trouble",
keys = function (_, _)
local tr = require("trouble")
---@type LazyKeysSpec[]
return {
{"<leader>xx",
function ()
tr.toggle(
---@diagnostic disable-next-line: missing-fields
{
mode = "diagnostics",
focus = false}
)
end,
desc = "Trouble Diagnostics",
mode = "n"
},
{"<leader>xX",
function ()
tr.toggle(
---@diagnostic disable-next-line: missing-fields
{
mode = "diagnostics",
filter = {
buf = 0,
},
focus = false
}
)
end,
desc = "Buffer Diagnostics (Trouble)"
},
{"<leader>xQ",
function ()
tr.toggle(
---@diagnostic disable-next-line: missing-fields
{
mode = "qflist",
focus = false
}
)
end,
desc = "Quickfix List (Trouble)"
},
{"<leader>cs",
function ()
tr.toggle(
---@diagnostic disable-next-line: missing-fields
{
mode = "symbols",
focus = false
}
)
end,
desc = "Symbols (Trouble)"
}
}
end
}
} }