mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 03:47:37 +00:00
treesitter: rename queries content to query
This commit is contained in:
parent
95adf36ef5
commit
27b4dc9fb0
5 changed files with 10 additions and 10 deletions
|
|
@ -287,7 +287,7 @@ in {
|
|||
{
|
||||
type = "injections";
|
||||
filetypes = ["gotmpl"];
|
||||
content = ''
|
||||
query = ''
|
||||
;; extends
|
||||
|
||||
((text) @injection.content
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ in {
|
|||
{
|
||||
type = "injections";
|
||||
filetypes = ["tera"];
|
||||
content = ''
|
||||
query = ''
|
||||
;; extends
|
||||
|
||||
((content) @injection.content
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue