aboutsummaryrefslogtreecommitdiffstats
path: root/.tsqueryrc.json
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2025-07-21 18:44:11 -0700
committerChristian Clason <ch.clason+github@icloud.com>2025-08-12 10:25:50 +0200
commit4d43480167512deb7eed798147355d7f09e56d5c (patch)
tree225c120eb3a6bbf066aaf78d5436963ce99a1d84 /.tsqueryrc.json
parentfix(fennel): highlight $ in multi-symbol context properly (diff)
downloadnvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.tar
nvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.tar.gz
nvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.tar.bz2
nvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.tar.lz
nvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.tar.xz
nvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.tar.zst
nvim-treesitter-4d43480167512deb7eed798147355d7f09e56d5c.zip
ci: validate predicate/directive string parameters
Diffstat (limited to '.tsqueryrc.json')
-rw-r--r--.tsqueryrc.json54
1 files changed, 38 insertions, 16 deletions
diff --git a/.tsqueryrc.json b/.tsqueryrc.json
index e8e7fd920..cd3a692d5 100644
--- a/.tsqueryrc.json
+++ b/.tsqueryrc.json
@@ -246,11 +246,13 @@
},
{
"type": "string",
- "arity": "required"
+ "arity": "required",
+ "constraint": "named_node"
},
{
"type": "string",
- "arity": "variadic"
+ "arity": "variadic",
+ "constraint": "named_node"
}
],
"description": "match any of the given node types against all ancestors of a node"
@@ -262,12 +264,14 @@
"arity": "required"
},
{
- "type": "any",
- "arity": "required"
+ "type": "string",
+ "arity": "required",
+ "constraint": "named_node"
},
{
- "type": "any",
- "arity": "variadic"
+ "type": "string",
+ "arity": "variadic",
+ "constraint": "named_node"
}
],
"description": "match any of the given node types against the direct ancestor of a node"
@@ -280,11 +284,13 @@
},
{
"type": "string",
- "arity": "required"
+ "arity": "required",
+ "constraint": "named_node"
},
{
"type": "string",
- "arity": "variadic"
+ "arity": "variadic",
+ "constraint": "named_node"
}
],
"description": "checks whether a capture corresponds to a given set of nodes"
@@ -316,19 +322,23 @@
},
{
"type": "string",
- "arity": "required"
+ "arity": "required",
+ "constraint": "integer"
},
{
"type": "string",
- "arity": "required"
+ "arity": "required",
+ "constraint": "integer"
},
{
"type": "string",
- "arity": "required"
+ "arity": "required",
+ "constraint": "integer"
},
{
"type": "string",
- "arity": "required"
+ "arity": "required",
+ "constraint": "integer"
}
],
"description": "Takes the range of the captured node and applies an offset. This will set a new range in the form of a list like { {start_row}, {start_col}, {end_row}, {end_col} } for the captured node with `capture_id` as `metadata[capture_id].range`."
@@ -358,19 +368,31 @@
},
{
"type": "string",
- "arity": "optional"
+ "arity": "optional",
+ "constraint": {
+ "enum": ["0", "1"]
+ }
},
{
"type": "string",
- "arity": "optional"
+ "arity": "optional",
+ "constraint": {
+ "enum": ["0", "1"]
+ }
},
{
"type": "string",
- "arity": "optional"
+ "arity": "optional",
+ "constraint": {
+ "enum": ["0", "1"]
+ }
},
{
"type": "string",
- "arity": "optional"
+ "arity": "optional",
+ "constraint": {
+ "enum": ["0", "1"]
+ }
}
],
"description": "Trims whitespace from the node. Sets a new `metadata[capture_id].range`. Takes a capture ID and, optionally, four integers to customize trimming behavior (`1` meaning trim, `0` meaning don't trim). When only given a capture ID, trims blank lines (lines that contain only whitespace, or are empty) from the end of the node (for backwards compatibility). Can trim all whitespace from both sides of the node if parameters are given."