diff --git a/lua/plugins/spec/lsp.lua b/lua/plugins/spec/lsp.lua index 053d5ba..4e0c20f 100644 --- a/lua/plugins/spec/lsp.lua +++ b/lua/plugins/spec/lsp.lua @@ -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 { + + {"xx", + function () + tr.toggle( + ---@diagnostic disable-next-line: missing-fields + { + mode = "diagnostics", + focus = false} + ) + end, + desc = "Trouble Diagnostics", + mode = "n" + }, + {"xX", + function () + tr.toggle( + ---@diagnostic disable-next-line: missing-fields + { + mode = "diagnostics", + filter = { + buf = 0, + }, + focus = false + } + ) + end, + desc = "Buffer Diagnostics (Trouble)" + }, + {"xQ", + function () + tr.toggle( + ---@diagnostic disable-next-line: missing-fields + { + mode = "qflist", + focus = false + } + ) + end, + desc = "Quickfix List (Trouble)" + }, + {"cs", + function () + tr.toggle( + ---@diagnostic disable-next-line: missing-fields + { + mode = "symbols", + focus = false + } + ) + end, + desc = "Symbols (Trouble)" + } + } + end + + } }