plugins/ts-context-commentstring: init + test

This commit is contained in:
Gaetan Lepage 2023-06-01 10:39:33 +02:00 committed by Gaétan Lepage
parent eb6b49b396
commit 8f00594b25
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
in {
options.plugins.ts-context-commentstring =
helpers.extraOptionsOptions
// {
enable = mkEnableOption "nvim-ts-context-commentstring";
package =
helpers.mkPackageOption
"ts-context-commentstring"
pkgs.vimPlugins.nvim-ts-context-commentstring;
};
config = let
cfg = config.plugins.ts-context-commentstring;
in
mkIf cfg.enable {
warnings = mkIf (!config.plugins.treesitter.enable) [
"Nixvim: ts-context-commentstring needs treesitter to function as intended"
];
extraPlugins = [cfg.package];
plugins.treesitter.moduleConfig.context_commentstring =
{
enable = true;
}
// cfg.extraOptions;
};
}