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 = [{ vim.treesitter.queries = [{
type = "injections"; type = "injections";
filetypes = ["nix"]; filetypes = ["nix"];
content = '' query = ''
;; extends ;; extends
((apply_expression ((apply_expression

View file

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

View file

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

View file

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

View file

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