feat(lsp): Add trouble
NOTE: I have put trouble here as it is mainly used for lsp diagnostics
This commit is contained in:
parent
e581acb652
commit
25a9d2ba11
|
|
@ -1,3 +1,5 @@
|
|||
---@module "lazy.nvim"
|
||||
---@type LazySpec[]
|
||||
return {
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
|
|
@ -7,7 +9,9 @@ return {
|
|||
},
|
||||
},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
{
|
||||
"mason-org/mason.nvim", opts = {}
|
||||
},
|
||||
"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
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user