mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 11:55:22 +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
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ in {
|
||||||
{
|
{
|
||||||
type = "injections";
|
type = "injections";
|
||||||
filetypes = ["gotmpl"];
|
filetypes = ["gotmpl"];
|
||||||
content = ''
|
query = ''
|
||||||
;; extends
|
;; extends
|
||||||
|
|
||||||
((text) @injection.content
|
((text) @injection.content
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ in {
|
||||||
{
|
{
|
||||||
type = "injections";
|
type = "injections";
|
||||||
filetypes = ["tera"];
|
filetypes = ["tera"];
|
||||||
content = ''
|
query = ''
|
||||||
;; extends
|
;; extends
|
||||||
|
|
||||||
((content) @injection.content
|
((content) @injection.content
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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.";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue