mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
plugins/ts-context-commentstring: init + test
This commit is contained in:
parent
eb6b49b396
commit
8f00594b25
3 changed files with 48 additions and 0 deletions
37
plugins/languages/treesitter/ts-context-commentstring.nix
Normal file
37
plugins/languages/treesitter/ts-context-commentstring.nix
Normal 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;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue