treesitter: rename queries content to query

This commit is contained in:
Snoweuph 2026-04-23 22:48:23 +02:00 committed by Ching Pei Yang
commit 27b4dc9fb0
5 changed files with 10 additions and 10 deletions

View file

@ -22,7 +22,7 @@ foo = mkLuaInline ''
vim.treesitter.queries = [{
type = "injections";
filetypes = ["nix"];
content = ''
query = ''
;; extends
((apply_expression

View file

@ -287,7 +287,7 @@ in {
{
type = "injections";
filetypes = ["gotmpl"];
content = ''
query = ''
;; extends
((text) @injection.content

View file

@ -57,7 +57,7 @@ in {
{
type = "injections";
filetypes = ["tera"];
content = ''
query = ''
;; extends
((content) @injection.content

View file

@ -73,29 +73,29 @@ in {
grouped =
foldl'
(
acc: query:
acc: entry:
foldl'
(
inner: filetype: let
path = "queries/${filetype}/${query.type}.scm";
path = "queries/${filetype}/${entry.type}.scm";
prev = inner.${path} or "";
in
inner
// {
${path} = prev + query.content;
${path} = prev + entry.query;
}
)
acc
query.filetypes
entry.filetypes
)
{}
cfg.queries;
files =
mapAttrsToList
(path: content: {
(path: query: {
name = path;
path = pkgs.writeText path content;
path = pkgs.writeText path query;
})
grouped;
in

View file

@ -17,7 +17,7 @@
default = [];
description = "The filetypes for which the query should be registered.";
};
content = mkOption {
query = mkOption {
type = lines;
description = "The queries scm script.";
};