2023-10-26 12:03:58 +00:00
|
|
|
{lib, ...}: let
|
2024-03-12 00:46:29 +00:00
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2024-02-17 15:10:45 +00:00
|
|
|
inherit (lib) types mkRenamedOptionModule;
|
2023-10-26 12:03:58 +00:00
|
|
|
in {
|
2024-02-17 15:10:45 +00:00
|
|
|
imports = let
|
|
|
|
renamedSetupOption = oldPath: newPath:
|
|
|
|
mkRenamedOptionModule
|
|
|
|
(["vim" "lsp" "nvim-docs-view"] ++ oldPath)
|
|
|
|
(["vim" "lsp" "nvim-docs-view" "setupOpts"] ++ newPath);
|
|
|
|
in [
|
|
|
|
(renamedSetupOption ["position"] ["position"])
|
|
|
|
(renamedSetupOption ["width"] ["width"])
|
|
|
|
(renamedSetupOption ["height"] ["height"])
|
|
|
|
(renamedSetupOption ["updateMode"] ["update_mode"])
|
|
|
|
];
|
|
|
|
|
2023-10-26 12:03:58 +00:00
|
|
|
options.vim.lsp.nvim-docs-view = {
|
|
|
|
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
|
|
|
|
|
2024-02-17 15:10:45 +00:00
|
|
|
setupOpts = lib.nvim.types.mkPluginSetupOption "nvim-docs-view" {
|
|
|
|
position = mkOption {
|
|
|
|
type = types.enum ["left" "right" "top" "bottom"];
|
|
|
|
default = "right";
|
|
|
|
description = ''
|
|
|
|
Where to open the docs view panel
|
|
|
|
'';
|
|
|
|
};
|
2023-10-26 12:03:58 +00:00
|
|
|
|
2024-02-17 15:10:45 +00:00
|
|
|
height = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 10;
|
|
|
|
description = ''
|
|
|
|
Height of the docs view panel if the position is set to either top or bottom
|
|
|
|
'';
|
|
|
|
};
|
2023-10-26 12:03:58 +00:00
|
|
|
|
2024-02-17 15:10:45 +00:00
|
|
|
width = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 60;
|
|
|
|
description = ''
|
|
|
|
Width of the docs view panel if the position is set to either left or right
|
|
|
|
'';
|
|
|
|
};
|
2024-03-12 00:46:29 +00:00
|
|
|
|
2024-02-17 15:10:45 +00:00
|
|
|
update_mode = mkOption {
|
|
|
|
type = types.enum ["auto" "manual"];
|
|
|
|
default = "auto";
|
|
|
|
description = ''
|
|
|
|
Determines the mechanism used to update the docs view panel content.
|
|
|
|
- If auto, the content will update upon cursor move.
|
|
|
|
- If manual, the content will only update once :DocsViewUpdate is called
|
|
|
|
'';
|
|
|
|
};
|
2023-10-26 12:03:58 +00:00
|
|
|
};
|
2023-10-27 06:30:20 +00:00
|
|
|
|
|
|
|
mappings = {
|
|
|
|
viewToggle = mkMappingOption "Open or close the docs view panel" "lvt";
|
|
|
|
viewUpdate = mkMappingOption "Manually update the docs view panel" "lvu";
|
|
|
|
};
|
2023-10-26 12:03:58 +00:00
|
|
|
};
|
|
|
|
}
|