2023-02-01 20:11:37 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2024-11-04 16:50:50 +01:00
|
|
|
options,
|
2023-02-01 20:11:37 +01:00
|
|
|
...
|
2023-11-08 03:16:46 +01:00
|
|
|
}: let
|
2024-11-04 16:50:50 +01:00
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLznBinding pushDownDefault;
|
2023-11-08 03:16:46 +01:00
|
|
|
|
2023-02-01 20:11:37 +01:00
|
|
|
cfg = config.vim.lsp;
|
2023-05-02 23:28:40 +02:00
|
|
|
|
2024-11-04 16:50:50 +01:00
|
|
|
mappingDefinitions = options.vim.lsp.trouble.mappings;
|
2023-05-02 23:28:40 +02:00
|
|
|
mappings = addDescriptionsToMappings cfg.trouble.mappings mappingDefinitions;
|
2023-02-01 20:11:37 +01:00
|
|
|
in {
|
|
|
|
config = mkIf (cfg.enable && cfg.trouble.enable) {
|
2024-03-12 01:46:29 +01:00
|
|
|
vim = {
|
2024-11-04 16:50:50 +01:00
|
|
|
lazy.plugins.trouble = {
|
|
|
|
package = "trouble";
|
|
|
|
setupModule = "trouble";
|
|
|
|
inherit (cfg.trouble) setupOpts;
|
2023-02-01 20:11:37 +01:00
|
|
|
|
2024-11-04 16:50:50 +01:00
|
|
|
cmd = "Trouble";
|
|
|
|
keys = [
|
2024-11-11 01:06:09 +01:00
|
|
|
(mkSetLznBinding "n" mappings.toggle "<cmd>TroubleToggle<CR>")
|
|
|
|
(mkSetLznBinding "n" mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>")
|
|
|
|
(mkSetLznBinding "n" mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>")
|
|
|
|
(mkSetLznBinding "n" mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>")
|
|
|
|
(mkSetLznBinding "n" mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
|
|
|
|
(mkSetLznBinding "n" mappings.locList "<cmd>TroubleToggle loclist<CR>")
|
2024-11-04 16:50:50 +01:00
|
|
|
];
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
|
2024-03-12 01:46:29 +01:00
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
|
|
"<leader>l" = "Trouble";
|
|
|
|
"<leader>x" = "+Trouble";
|
|
|
|
"<leader>lw" = "Workspace";
|
|
|
|
};
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
};
|
|
|
|
}
|