plugins/nvim-treesitter: add extraQueries
This commit is contained in:
parent
328ed67299
commit
3f9d0584c2
1 changed files with 21 additions and 0 deletions
|
@ -34,6 +34,15 @@ let
|
|||
fi
|
||||
''
|
||||
))
|
||||
++ lib.flatten (lib.flip lib.mapAttrsToList cfg.extraQueries (
|
||||
lang:
|
||||
lib.mapAttrsToList (queryKind: queries:
|
||||
''
|
||||
mkdir -p queries/${lang}
|
||||
echo "${queries}" >> queries/${lang}/${queryKind}.scm
|
||||
''
|
||||
)
|
||||
))
|
||||
);
|
||||
});
|
||||
in
|
||||
|
@ -62,6 +71,18 @@ in
|
|||
default = { };
|
||||
};
|
||||
|
||||
extraQueries = mkOption {
|
||||
type = with types; attrsOf (submodule {
|
||||
injections = mkOption {
|
||||
type = either str (arrayOf str);
|
||||
default = [ ];
|
||||
};
|
||||
});
|
||||
example = {
|
||||
javascript.injections = ''(comment) @comment'';
|
||||
};
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
|
|
Loading…
Reference in a new issue