aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-06-01 13:37:08 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-06-02 12:07:58 +0200
commita80fe081b4c5890980561e0de2458f64aaffbfc7 (patch)
tree0dcd1c72c83e3860e0880a3d7fcba88c0160e9a3 /scripts
parentbot(lockfile): update styled (diff)
downloadnvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.tar
nvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.tar.gz
nvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.tar.bz2
nvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.tar.lz
nvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.tar.xz
nvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.tar.zst
nvim-treesitter-a80fe081b4c5890980561e0de2458f64aaffbfc7.zip
feat(predicates)!: rename `has-type` to `kind-eq` to align with Helix
No point in having a different name for the same predicate.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/format-queries.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua
index ec0e81a57..f241fa819 100755
--- a/scripts/format-queries.lua
+++ b/scripts/format-queries.lua
@@ -13,7 +13,7 @@ else
files = vim.fn.split(vim.fn.glob(arg .. "/**/*.scm"))
end
-ts.query.add_predicate("has-type?", function(match, _, _, pred)
+ts.query.add_predicate("kind-eq?", function(match, _, _, pred)
local node = match[pred[2]]
if not node then
return true
@@ -132,7 +132,7 @@ local format_queries = [[
;; Append newlines for nodes inside the list
(list
(_) @format.append-newline
- (#not-has-type? @format.append-newline capture quantifier))
+ (#not-kind-eq? @format.append-newline "capture" "quantifier"))
;; (_), "_" and _ handler
;; Start indents if it's one of these patterns
@@ -194,7 +194,7 @@ local format_queries = [[
] @format.cancel-append
.
")"
- (#not-has-type? @format.cancel-append comment))
+ (#not-kind-eq? @format.cancel-append "comment"))
;; All captures should be separated with a space
(capture) @format.prepend-space
@@ -233,7 +233,7 @@ local format_queries = [[
;; Collapsing closing parens
(grouping
(_) @format.cancel-append . ")"
- (#not-has-type? @format.cancel-append comment))
+ (#not-kind-eq? @format.cancel-append "comment"))
(grouping
(capture) @format.prepend-space)
;; Remove unnecessary parens