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