aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md16
-rw-r--r--doc/nvim-treesitter.txt58
-rw-r--r--lua/nvim-treesitter/indent.lua80
-rw-r--r--lua/nvim-treesitter/query.lua44
-rw-r--r--queries/bass/indents.scm12
-rw-r--r--queries/bibtex/indents.scm6
-rw-r--r--queries/bicep/indents.scm12
-rw-r--r--queries/c/indents.scm61
-rw-r--r--queries/capnp/indents.scm22
-rw-r--r--queries/chatito/indents.scm4
-rw-r--r--queries/cpon/indents.scm12
-rw-r--r--queries/cpp/indents.scm9
-rw-r--r--queries/css/indents.scm8
-rw-r--r--queries/cue/indents.scm12
-rw-r--r--queries/d/indents.scm6
-rw-r--r--queries/dart/indents.scm10
-rw-r--r--queries/devicetree/indents.scm6
-rw-r--r--queries/ecma/indents.scm32
-rw-r--r--queries/elixir/indents.scm6
-rw-r--r--queries/elsa/indents.scm4
-rw-r--r--queries/fish/indents.scm6
-rw-r--r--queries/foam/indents.scm6
-rw-r--r--queries/fortran/indents.scm4
-rw-r--r--queries/fusion/indents.scm14
-rw-r--r--queries/gdscript/indents.scm30
-rw-r--r--queries/gleam/indents.scm6
-rw-r--r--queries/go/indents.scm16
-rw-r--r--queries/graphql/indents.scm4
-rw-r--r--queries/hare/indents.scm14
-rw-r--r--queries/hcl/indents.scm8
-rw-r--r--queries/heex/indents.scm6
-rw-r--r--queries/hjson/indents.scm2
-rw-r--r--queries/html_tags/indents.scm14
-rw-r--r--queries/htmldjango/indents.scm6
-rw-r--r--queries/java/indents.scm13
-rw-r--r--queries/json/indents.scm4
-rw-r--r--queries/jsonc/indents.scm2
-rw-r--r--queries/jsx/indents.scm12
-rw-r--r--queries/julia/indents.scm6
-rw-r--r--queries/kdl/indents.scm8
-rw-r--r--queries/ledger/indents.scm2
-rw-r--r--queries/lua/indents.scm13
-rw-r--r--queries/ninja/indents.scm2
-rw-r--r--queries/pascal/indents.scm6
-rw-r--r--queries/php/indents.scm10
-rw-r--r--queries/poe_filter/indents.scm6
-rw-r--r--queries/python/indents.scm126
-rw-r--r--queries/ql/indents.scm8
-rw-r--r--queries/query/indents.scm4
-rw-r--r--queries/r/indents.scm16
-rw-r--r--queries/rasi/indents.scm6
-rw-r--r--queries/ron/indents.scm8
-rw-r--r--queries/ruby/indents.scm8
-rw-r--r--queries/rust/indents.scm31
-rw-r--r--queries/scss/indents.scm2
-rw-r--r--queries/slint/indents.scm8
-rw-r--r--queries/smali/indents.scm8
-rw-r--r--queries/sparql/indents.scm4
-rw-r--r--queries/squirrel/indents.scm24
-rw-r--r--queries/starlark/indents.scm42
-rw-r--r--queries/supercollider/indents.scm6
-rw-r--r--queries/surface/indents.scm4
-rw-r--r--queries/svelte/indents.scm6
-rw-r--r--queries/tablegen/indents.scm12
-rw-r--r--queries/teal/indents.scm4
-rw-r--r--queries/thrift/indents.scm16
-rw-r--r--queries/tiger/indents.scm80
-rw-r--r--queries/toml/indents.scm4
-rw-r--r--queries/turtle/indents.scm4
-rw-r--r--queries/typescript/indents.scm2
-rw-r--r--queries/ungrammar/indents.scm4
-rw-r--r--queries/uxntal/indents.scm12
-rw-r--r--queries/v/indents.scm8
-rw-r--r--queries/vue/indents.scm4
-rw-r--r--queries/wgsl/indents.scm14
-rw-r--r--queries/wgsl_bevy/indents.scm2
-rw-r--r--queries/yaml/indents.scm4
-rw-r--r--queries/yang/indents.scm20
-rw-r--r--queries/yuck/indents.scm18
-rw-r--r--queries/zig/indents.scm8
80 files changed, 592 insertions, 575 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cea14ac53..d809bc784 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -315,14 +315,14 @@ the node describing the language and `@content` to describe the injection region
### Indents
```scheme
-@indent ; indent children when matching this node
-@indent_end ; marks the end of indented block
-@aligned_indent ; behaves like python aligned/hanging indent
-@dedent ; dedent children when matching this node
-@branch ; dedent itself when matching this node
-@ignore ; do not indent in this node
-@auto ; behaves like 'autoindent' buffer option
-@zero_indent ; sets this node at position 0 (no indent)
+@indent.begin ; indent children when matching this node
+@indent.end ; marks the end of indented block
+@indent.align ; behaves like python aligned/hanging indent
+@indent.dedent ; dedent children when matching this node
+@indent.branch ; dedent itself when matching this node
+@indent.ignore ; do not indent in this node
+@indent.auto ; behaves like 'autoindent' buffer option
+@indent.zero ; sets this node at position 0 (no indent)
```
[Matrix channel]: https://matrix.to/#/#nvim-treesitter:matrix.org
diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt
index 5509dc8af..f7a91b849 100644
--- a/doc/nvim-treesitter.txt
+++ b/doc/nvim-treesitter.txt
@@ -224,29 +224,29 @@ Supported options:
}
`@indent` *nvim-treesitter-indentation-queries*
-Queries can use the following captures: `@indent` and `@dedent`,
-`@branch`, `@indent_end` or `@aligned_indent`. An `@ignore` capture tells
-treesitter to ignore indentation and a `@zero_indent` capture sets
+Queries can use the following captures: `@indent.begin` and `@indent.dedent`,
+`@indent.branch`, `@indent.end` or `@indent.align`. An `@indent.ignore` capture tells
+treesitter to ignore indentation and a `@indent.zero` capture sets
the indentation to 0.
-`@indent` *nvim-treesitter-indentation-indent*
-The `@indent` specifies that the next line should be indented. Multiple
+`@indent.begin` *nvim-treesitter-indentation-indent.begin*
+The `@indent.begin` specifies that the next line should be indented. Multiple
indents on the same line get collapsed. Eg.
>
(
(if_statement)
- (ERROR "else") @indent
+ (ERROR "else") @indent.begin
)
<
-Indent can also have `immediate_indent` set using a `#set!` directive, which
+Indent can also have `indent.immediate` set using a `#set!` directive, which
permits the next line to indent even when the block intended to be indented
has no content yet, improving interactive typing.
eg for python:
>
- ((if_statement) @indent
- (#set! "immediate_indent" 1))
+ ((if_statement) @indent.begin
+ (#set! indent.immediate 1))
<
Will allow:
@@ -254,19 +254,19 @@ Will allow:
if True:<CR>
# Auto indent to here
-`@indent_end` *nvim-treesitter-indentation-indent_end*
-An `@indent_end` capture is used to specify that the indented region ends and
+`@indent.end` *nvim-treesitter-indentation-indent.end*
+An `@indent.end` capture is used to specify that the indented region ends and
any text subsequent to the capture should be dedented.
-`@branch` *nvim-treesitter-indentation-branch*
-An `@branch` capture is used to specify that a dedented region starts
+`@indent.branch` *nvim-treesitter-indentation-indent.branch*
+An `@indent.branch` capture is used to specify that a dedented region starts
at the line including the captured nodes.
-`@dedent` *nvim-treesitter-indentation-dedent*
-A `@dedent` capture specifies dedenting starting on the next line.
+`@indent.dedent` *nvim-treesitter-indentation-indent.dedent*
+A `@indent.dedent` capture specifies dedenting starting on the next line.
>
-`@aligned_indent` *nvim-treesitter-indentation-aligned_indent*
-Aligned indent blocks may be specified with the `@aligned_indent` capture.
+`@indent.align` *nvim-treesitter-indentation-aligned_indent.align*
+Aligned indent blocks may be specified with the `@indent.align` capture.
This permits
>
@@ -289,15 +289,15 @@ and finally
c
)
<
-To specify the delimiters to use `open_delimiter` and `close_delimiter`
-should be used. Eg.
+To specify the delimiters to use `indent.open_delimiter` and
+`indent.close_delimiter` should be used. Eg.
>
- ((argument_list) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+ ((argument_list) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
<
-For some languages the last line of an `aligned_indent` block must not be
+For some languages the last line of an `indent.align` block must not be
the same indent as the natural next line.
For example in python:
@@ -314,17 +314,17 @@ Is not correct, whereas
pass
Would be correctly indented. This behavior may be chosen using
-`avoid_last_matching_next`. Eg.
+`indent.avoid_last_matching_next`. Eg.
>
(if_statement
- condition: (parenthesized_expression) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")")
- (#set! "avoid_last_matching_next" 1)
+ condition: (parenthesized_expression) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")")
+ (#set! indent.avoid_last_matching_next 1)
)
<
-Could be used to specify that the last line of an `@aligned_indent` capture
+Could be used to specify that the last line of an `@indent.align` capture
should be additionally indented to avoid clashing with the indent of the first
line of the block inside an if.
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua
index 932fa17ff..7290b3148 100644
--- a/lua/nvim-treesitter/indent.lua
+++ b/lua/nvim-treesitter/indent.lua
@@ -52,18 +52,31 @@ end
local get_indents = tsutils.memoize_by_buf_tick(function(bufnr, root, lang)
local map = {
- auto = {},
- indent = {},
- indent_end = {},
- dedent = {},
- branch = {},
- ignore = {},
- aligned_indent = {},
- zero_indent = {},
+ indent = {
+ auto = {},
+ begin = {},
+ ["end"] = {},
+ dedent = {},
+ branch = {},
+ ignore = {},
+ align = {},
+ zero = {},
+ },
}
+ local function split(to_split)
+ local t = {}
+ for str in string.gmatch(to_split, "([^.]+)") do
+ table.insert(t, str)
+ end
+ return t
+ end
+
for name, node, metadata in queries.iter_captures(bufnr, "indents", root, lang) do
- map[name][node:id()] = metadata or {}
+ local path = split(name)
+ -- node may contain a period so append directly.
+ table.insert(path, node:id())
+ queries.insert_to_path(map, path, metadata or {})
end
return map
@@ -116,7 +129,7 @@ function M.get_indent(lnum)
if is_empty_line then
local prevlnum = vim.fn.prevnonblank(lnum)
node = get_last_node_at_line(root, prevlnum)
- if q.indent_end[node:id()] then
+ if q.indent["end"][node:id()] then
node = get_first_node_at_line(root, lnum)
end
else
@@ -134,16 +147,16 @@ function M.get_indent(lnum)
-- tracks to ensure multiple indent levels are not applied for same line
local is_processed_by_row = {}
- if q.zero_indent[node:id()] then
+ if q.indent.zero[node:id()] then
return 0
end
while node do
-- do 'autoindent' if not marked as @indent
if
- not q.indent[node:id()]
- and not q.aligned_indent[node:id()]
- and q.auto[node:id()]
+ not q.indent.begin[node:id()]
+ and not q.indent.align[node:id()]
+ and q.indent.auto[node:id()]
and node:start() < lnum - 1
and lnum - 1 <= node:end_()
then
@@ -153,7 +166,12 @@ function M.get_indent(lnum)
-- Do not indent if we are inside an @ignore block.
-- If a node spans from L1,C1 to L2,C2, we know that lines where L1 < line <= L2 would
-- have their indentations contained by the node.
- if not q.indent[node:id()] and q.ignore[node:id()] and node:start() < lnum - 1 and lnum - 1 <= node:end_() then
+ if
+ not q.indent.begin[node:id()]
+ and q.indent.ignore[node:id()]
+ and node:start() < lnum - 1
+ and lnum - 1 <= node:end_()
+ then
return 0
end
@@ -163,7 +181,7 @@ function M.get_indent(lnum)
if
not is_processed_by_row[srow]
- and ((q.branch[node:id()] and srow == lnum - 1) or (q.dedent[node:id()] and srow ~= lnum - 1))
+ and ((q.indent.branch[node:id()] and srow == lnum - 1) or (q.indent.dedent[node:id()] and srow ~= lnum - 1))
then
indent = indent - indent_size
is_processed = true
@@ -179,16 +197,16 @@ function M.get_indent(lnum)
if
should_process
and (
- q.indent[node:id()]
- and (srow ~= erow or is_in_err or q.indent[node:id()].immediate_indent)
- and (srow ~= lnum - 1 or q.indent[node:id()].start_at_same_line)
+ q.indent.begin[node:id()]
+ and (srow ~= erow or is_in_err or q.indent.begin[node:id()]["indent.immediate"])
+ and (srow ~= lnum - 1 or q.indent.begin[node:id()]["indent.start_at_same_line"])
)
then
indent = indent + indent_size
is_processed = true
end
- if is_in_err and not q.aligned_indent[node:id()] then
+ if is_in_err and not q.indent.align[node:id()] then
-- only when the node is in error, promote the
-- first child's aligned indent to the error node
-- to work around ((ERROR "X" . (_)) @aligned_indent (#set! "delimeter" "AB"))
@@ -196,25 +214,25 @@ function M.get_indent(lnum)
-- (ERROR "X" @aligned_indent (#set! "delimeter" "AB") . (_))
-- and we will fish it out here.
for c in node:iter_children() do
- if q.aligned_indent[c:id()] then
- q.aligned_indent[node:id()] = q.aligned_indent[c:id()]
+ if q.indent.align[c:id()] then
+ q.indent.align[node:id()] = q.indent.align[c:id()]
break
end
end
end
-- do not indent for nodes that starts-and-ends on same line and starts on target line (lnum)
- if should_process and q.aligned_indent[node:id()] and (srow ~= erow or is_in_err) and (srow ~= lnum - 1) then
- local metadata = q.aligned_indent[node:id()]
+ if should_process and q.indent.align[node:id()] and (srow ~= erow or is_in_err) and (srow ~= lnum - 1) then
+ local metadata = q.indent.align[node:id()]
local o_delim_node, o_is_last_in_line ---@type TSNode|nil, boolean|nil
local c_delim_node, c_is_last_in_line ---@type TSNode|nil, boolean|nil, boolean|nil
local indent_is_absolute = false
- if metadata.open_delimiter then
- o_delim_node, o_is_last_in_line = find_delimiter(bufnr, node, metadata.open_delimiter)
+ if metadata["indent.open_delimiter"] then
+ o_delim_node, o_is_last_in_line = find_delimiter(bufnr, node, metadata["indent.open_delimiter"])
else
o_delim_node = node
end
- if metadata.close_delimiter then
- c_delim_node, c_is_last_in_line = find_delimiter(bufnr, node, metadata.close_delimiter)
+ if metadata["indent.close_delimiter"] then
+ c_delim_node, c_is_last_in_line = find_delimiter(bufnr, node, metadata["indent.close_delimiter"])
else
c_delim_node = node
end
@@ -245,7 +263,7 @@ function M.get_indent(lnum)
-- Then its indent level shouldn't be affected by `@aligned_indent` node
indent = math.max(indent - indent_size, 0)
else
- indent = o_scol + (metadata.increment or 1)
+ indent = o_scol + (metadata["indent.increment"] or 1)
indent_is_absolute = true
end
end
@@ -254,9 +272,9 @@ function M.get_indent(lnum)
if c_srow and c_srow ~= o_srow and c_srow == lnum - 1 then
-- delims end on current line, and are not open and closed same line.
-- then this last line may need additional indent to avoid clashes
- -- with the next. `avoid_last_matching_next` controls this behavior,
+ -- with the next. `indent.avoid_last_matching_next` controls this behavior,
-- for example this is needed for function parameters.
- avoid_last_matching_next = metadata.avoid_last_matching_next or false
+ avoid_last_matching_next = metadata["indent.avoid_last_matching_next"] or false
end
if avoid_last_matching_next then
-- last line must be indented more in cases where
diff --git a/lua/nvim-treesitter/query.lua b/lua/nvim-treesitter/query.lua
index 18c416a38..51310545b 100644
--- a/lua/nvim-treesitter/query.lua
+++ b/lua/nvim-treesitter/query.lua
@@ -213,6 +213,24 @@ local function prepare_query(bufnr, query_name, root, root_lang)
}
end
+-- Given a path (i.e. a List(String)) this functions inserts value at path
+---@param object any
+---@param path string[]
+---@param value any
+function M.insert_to_path(object, path, value)
+ local curr_obj = object
+
+ for index = 1, (#path - 1) do
+ if curr_obj[path[index]] == nil then
+ curr_obj[path[index]] = {}
+ end
+
+ curr_obj = curr_obj[path[index]]
+ end
+
+ curr_obj[path[#path]] = value
+end
+
---@param query Query
---@param bufnr integer
---@param start_row integer
@@ -230,24 +248,6 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
return t
end
- -- Given a path (i.e. a List(String)) this functions inserts value at path
- ---@param object any
- ---@param path string[]
- ---@param value any
- local function insert_to_path(object, path, value)
- local curr_obj = object
-
- for index = 1, (#path - 1) do
- if curr_obj[path[index]] == nil then
- curr_obj[path[index]] = {}
- end
-
- curr_obj = curr_obj[path[index]]
- end
-
- curr_obj[path[#path]] = value
- end
-
local matches = query:iter_matches(qnode, bufnr, start_row, end_row)
local function iterator()
@@ -260,9 +260,9 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
local name = query.captures[id] -- name of the capture in the query
if name ~= nil then
local path = split(name .. ".node")
- insert_to_path(prepared_match, path, node)
+ M.insert_to_path(prepared_match, path, node)
local metadata_path = split(name .. ".metadata")
- insert_to_path(prepared_match, metadata_path, metadata[id])
+ M.insert_to_path(prepared_match, metadata_path, metadata[id])
end
end
@@ -273,10 +273,10 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
for _, pred in pairs(preds) do
-- functions
if pred[1] == "set!" and type(pred[2]) == "string" then
- insert_to_path(prepared_match, split(pred[2]), pred[3])
+ M.insert_to_path(prepared_match, split(pred[2]), pred[3])
end
if pred[1] == "make-range!" and type(pred[2]) == "string" and #pred == 4 then
- insert_to_path(
+ M.insert_to_path(
prepared_match,
split(pred[2] .. ".node"),
tsrange.TSRange.from_nodes(bufnr, match[pred[3]], match[pred[4]])
diff --git a/queries/bass/indents.scm b/queries/bass/indents.scm
index f1f4e0ecf..60c5df4eb 100644
--- a/queries/bass/indents.scm
+++ b/queries/bass/indents.scm
@@ -2,21 +2,21 @@
(list)
(scope)
(cons)
-] @indent
+] @indent.begin
[
")"
"}"
"]"
-] @indent_end
+] @indent.end
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/bibtex/indents.scm b/queries/bibtex/indents.scm
index af652160e..1ba3e6b47 100644
--- a/queries/bibtex/indents.scm
+++ b/queries/bibtex/indents.scm
@@ -1,10 +1,10 @@
[
(entry)
-] @indent
+] @indent.begin
[
"{"
"}"
-] @branch
+] @indent.branch
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/bicep/indents.scm b/queries/bicep/indents.scm
index 7fcf7ffb9..cf2e6e1c2 100644
--- a/queries/bicep/indents.scm
+++ b/queries/bicep/indents.scm
@@ -1,18 +1,18 @@
[
(array)
(object)
-] @indent
+] @indent.begin
-"}" @indent_end
+"}" @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
[
(ERROR)
(comment)
(diagnostic_comment)
-] @auto
+] @indent.auto
diff --git a/queries/c/indents.scm b/queries/c/indents.scm
index bb8903d3d..71f47ced1 100644
--- a/queries/c/indents.scm
+++ b/queries/c/indents.scm
@@ -7,66 +7,66 @@
(initializer_list)
(init_declarator)
(expression_statement)
-] @indent
+] @indent.begin
(
ERROR
- "for" "(" @indent ";" ";" ")" @indent_end)
+ "for" "(" @indent.begin ";" ";" ")" @indent.end)
(
(for_statement
body: (_) @_body
- ) @indent
+ ) @indent.begin
(#not-has-type? @_body compound_statement)
)
(
while_statement
- condition: (_) @indent
+ condition: (_) @indent.begin
)
(
(while_statement
body: (_) @_body
- ) @indent
+ ) @indent.begin
(#not-has-type? @_body compound_statement)
)
(
(if_statement)
- (ERROR "else") @indent
+ (ERROR "else") @indent.begin
)
(
if_statement
- condition: (_) @indent
+ condition: (_) @indent.begin
)
-;; Make sure all cases of if-else are tagged with @indent
+;; Make sure all cases of if-else are tagged with @indent.begin
;; So we will offset the indents for the else case
(
(if_statement
consequence: (compound_statement)
- "else" @branch
+ "else" @indent.branch
alternative:
[
- [ "{" "}" ] @branch
- (compound_statement ["{" "}"] @branch)
+ [ "{" "}" ] @indent.branch
+ (compound_statement ["{" "}"] @indent.branch)
(_)
]
- ) @indent
+ ) @indent.begin
)
(
(if_statement
- consequence: (_ ";" @indent_end) @_consequence
- ) @indent
+ consequence: (_ ";" @indent.end) @_consequence
+ ) @indent.begin
(#not-has-type? @_consequence compound_statement)
)
(
(if_statement
consequence: (_) @_consequence
- "else" @branch
+ "else" @indent.branch
alternative:
[
- [ "{" "}" ] @branch
- (compound_statement ["{" "}"] @branch)
+ [ "{" "}" ] @indent.branch
+ (compound_statement ["{" "}"] @indent.branch)
(_)
]
)
@@ -83,19 +83,19 @@
consequence: (_)
alternative:
[
- (if_statement consequence: (compound_statement) @dedent)
+ (if_statement consequence: (compound_statement) @indent.dedent)
(_)
- ] @dedent
+ ] @indent.dedent
)
)
-(compound_statement "}" @indent_end)
+(compound_statement "}" @indent.end)
[
")"
"}"
(statement_identifier)
-] @branch
+] @indent.branch
[
"#define"
@@ -105,18 +105,19 @@
"#if"
"#else"
"#endif"
-] @zero_indent
+] @indent.zero
[
(preproc_arg)
(string_literal)
-] @ignore
+] @indent.ignore
-((ERROR (parameter_declaration)) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
-([(argument_list) (parameter_list)] @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+((ERROR (parameter_declaration)) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+([(argument_list) (parameter_list)] @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+
+(comment) @indent.auto
-(comment) @auto
diff --git a/queries/capnp/indents.scm b/queries/capnp/indents.scm
index 601862d9d..e54ca9566 100644
--- a/queries/capnp/indents.scm
+++ b/queries/capnp/indents.scm
@@ -11,26 +11,26 @@
(struct)
(struct_shorthand)
(union)
-] @indent
+] @indent.begin
-((struct_shorthand (property)) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+((struct_shorthand (property)) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
-((const_list (const_value)) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+((const_list (const_value)) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
[
"}"
")"
-] @indent_end
+] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/chatito/indents.scm b/queries/chatito/indents.scm
index 849abadfc..64b4674b7 100644
--- a/queries/chatito/indents.scm
+++ b/queries/chatito/indents.scm
@@ -2,6 +2,6 @@
(intent_def)
(slot_def)
(alias_def)
-] @indent
+] @indent.begin
-(ERROR "]") @indent
+(ERROR "]") @indent.begin
diff --git a/queries/cpon/indents.scm b/queries/cpon/indents.scm
index 477ea83b5..5f52ea6a1 100644
--- a/queries/cpon/indents.scm
+++ b/queries/cpon/indents.scm
@@ -3,21 +3,21 @@
(map)
(imap)
(array)
-] @indent
+] @indent.begin
[
"]"
"}"
">"
-] @indent_end
+] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
-[ "<" ">" ] @branch
+[ "<" ">" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/cpp/indents.scm b/queries/cpp/indents.scm
index f1007dd28..7df9aea0c 100644
--- a/queries/cpp/indents.scm
+++ b/queries/cpp/indents.scm
@@ -3,8 +3,9 @@
[
(class_specifier)
(condition_clause)
-] @indent
+] @indent.begin
+
+((field_initializer_list) @indent.begin
+ (#set! indent.start_at_same_line 1))
+(access_specifier) @indent.branch
-((field_initializer_list) @indent
- (#set! "start_at_same_line" 1))
-(access_specifier) @branch
diff --git a/queries/css/indents.scm b/queries/css/indents.scm
index 1ea8a336f..cd22ed66c 100644
--- a/queries/css/indents.scm
+++ b/queries/css/indents.scm
@@ -1,9 +1,9 @@
[
(block)
(declaration)
-] @indent
+] @indent.begin
-(block ("}") @branch)
-("}") @dedent
+(block ("}") @indent.branch)
+("}") @indent.dedent
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/cue/indents.scm b/queries/cue/indents.scm
index 731e69b79..71a03a778 100644
--- a/queries/cue/indents.scm
+++ b/queries/cue/indents.scm
@@ -1,21 +1,21 @@
[
(import_spec_list)
(field)
-] @indent
+] @indent.begin
[
"}"
"]"
")"
-] @indent_end
+] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/d/indents.scm b/queries/d/indents.scm
index 7a6df759c..9ced7527d 100644
--- a/queries/d/indents.scm
+++ b/queries/d/indents.scm
@@ -2,16 +2,16 @@
(block_statement)
(case_statement)
(token_string)
-] @indent
+] @indent.begin
[
"(" ")"
"{" "}"
"[" "]"
-] @branch
+] @indent.branch
[
(line_comment)
(block_comment)
(nesting_block_comment)
-] @ignore
+] @indent.ignore
diff --git a/queries/dart/indents.scm b/queries/dart/indents.scm
index ad0ba389e..0c7bfe92d 100644
--- a/queries/dart/indents.scm
+++ b/queries/dart/indents.scm
@@ -10,7 +10,7 @@
(list_literal)
(return_statement)
(arguments)
-] @indent
+] @indent.begin
[
"("
@@ -19,13 +19,13 @@
"}"
"["
"]"
-] @branch
+] @indent.branch
[
"}"
-] @indent_end
+] @indent.end
; this one is for dedenting the else block
-(if_statement (block) @branch)
+(if_statement (block) @indent.branch)
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/devicetree/indents.scm b/queries/devicetree/indents.scm
index cd7c8fcd6..6cfc81cf2 100644
--- a/queries/devicetree/indents.scm
+++ b/queries/devicetree/indents.scm
@@ -2,13 +2,13 @@
(node)
(property)
(integer_cells)
-] @indent
+] @indent.begin
[
"}"
">"
-] @branch
+] @indent.branch
[
(comment)
-] @ignore
+] @indent.ignore
diff --git a/queries/ecma/indents.scm b/queries/ecma/indents.scm
index 1a5520e52..602b8d901 100644
--- a/queries/ecma/indents.scm
+++ b/queries/ecma/indents.scm
@@ -16,42 +16,42 @@
(switch_statement)
(template_substitution)
(ternary_expression)
-] @indent
+] @indent.begin
-(arguments (call_expression) @indent)
-(binary_expression (call_expression) @indent)
-(expression_statement (call_expression) @indent)
+(arguments (call_expression) @indent.begin)
+(binary_expression (call_expression) @indent.begin)
+(expression_statement (call_expression) @indent.begin)
(arrow_function
body: (_) @_body
(#not-has-type? @_body statement_block)
-) @indent
+) @indent.begin
(assignment_expression
right: (_) @_right
(#not-has-type? @_right arrow_function function)
-) @indent
+) @indent.begin
(variable_declarator
value: (_) @_value
(#not-has-type? @_value arrow_function call_expression function)
-) @indent
+) @indent.begin
-(arguments ")" @indent_end)
-(object "}" @indent_end)
-(statement_block "}" @indent_end)
+(arguments ")" @indent.end)
+(object "}" @indent.end)
+(statement_block "}" @indent.end)
[
(arguments (object))
")"
"}"
"]"
-] @branch
-(statement_block "{" @branch)
+] @indent.branch
+(statement_block "{" @indent.branch)
-(parenthesized_expression ("(" (_) ")" @indent_end))
-["}" "]"] @indent_end
+(parenthesized_expression ("(" (_) ")" @indent.end))
+["}" "]"] @indent.end
[
(comment)
(template_string)
-] @ignore
+] @indent.ignore
-(ERROR) @auto
+(ERROR) @indent.auto
diff --git a/queries/elixir/indents.scm b/queries/elixir/indents.scm
index 517f66940..0ba8fd442 100644
--- a/queries/elixir/indents.scm
+++ b/queries/elixir/indents.scm
@@ -6,7 +6,7 @@
(stab_clause)
(tuple)
(arguments)
-] @indent
+] @indent.begin
[
")"
@@ -17,7 +17,7 @@
"rescue"
"}"
"end"
-] @indent_end @branch
+] @indent.end @indent.branch
; Elixir pipelines are not indented, but other binary operator chains are
-((binary_operator operator: _ @_operator) @indent (#not-eq? @_operator "|>"))
+((binary_operator operator: _ @_operator) @indent.begin (#not-eq? @_operator "|>"))
diff --git a/queries/elsa/indents.scm b/queries/elsa/indents.scm
index fa51b1cf0..6ddd1aa64 100644
--- a/queries/elsa/indents.scm
+++ b/queries/elsa/indents.scm
@@ -1,6 +1,6 @@
-(reduction) @indent
+(reduction) @indent.begin
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/fish/indents.scm b/queries/fish/indents.scm
index cf8d62658..0a825a13f 100644
--- a/queries/fish/indents.scm
+++ b/queries/fish/indents.scm
@@ -5,12 +5,12 @@
(if_statement)
(begin_statement)
(switch_statement)
-] @indent
+] @indent.begin
[
(else_if_clause)
(else_clause)
"end"
-] @branch
+] @indent.branch
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/foam/indents.scm b/queries/foam/indents.scm
index 033700c17..a52cafea6 100644
--- a/queries/foam/indents.scm
+++ b/queries/foam/indents.scm
@@ -1,11 +1,11 @@
[
"{"
"}"
-] @branch
+] @indent.branch
-[(dict) (key_value)] @indent
+[(dict) (key_value)] @indent.begin
[
(comment)
-] @ignore
+] @indent.ignore
diff --git a/queries/fortran/indents.scm b/queries/fortran/indents.scm
index 67fa046de..86704c4f4 100644
--- a/queries/fortran/indents.scm
+++ b/queries/fortran/indents.scm
@@ -9,7 +9,7 @@
(where_statement)
(derived_type_definition)
(enum)
-] @indent
+] @indent.begin
[
(end_module_statement)
@@ -24,4 +24,4 @@
(end_type_statement)
(end_enum_statement)
(end_where_statement)
-] @branch
+] @indent.branch
diff --git a/queries/fusion/indents.scm b/queries/fusion/indents.scm
index 68c57d528..73133191b 100644
--- a/queries/fusion/indents.scm
+++ b/queries/fusion/indents.scm
@@ -5,15 +5,15 @@
(afx_element_self_closing)
(eel_array)
(eel_object)
-] @indent
+] @indent.begin
-(block end: _ @branch)
-(value_dsl end: _ @branch)
-(eel_array end: _ @branch)
-(eel_object end: _ @branch)
+(block end: _ @indent.branch)
+(value_dsl end: _ @indent.branch)
+(eel_array end: _ @indent.branch)
+(eel_object end: _ @indent.branch)
[
(afx_closing_element)
-] @branch
+] @indent.branch
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/gdscript/indents.scm b/queries/gdscript/indents.scm
index b7c0ac836..4eb579b22 100644
--- a/queries/gdscript/indents.scm
+++ b/queries/gdscript/indents.scm
@@ -12,12 +12,12 @@
(match_body)
(set_body)
(get_body)
-] @indent
+] @indent.begin
[
(elif_clause)
(else_clause)
-] @branch
+] @indent.branch
[
(string)
@@ -26,46 +26,46 @@
(dictionary)
(parenthesized_expression)
(ERROR)
-] @auto
+] @indent.auto
[
(pass_statement)
(continue_statement)
(break_statement)
(return_statement)
-] @dedent
+] @indent.dedent
[
(ERROR "[")
(ERROR "(")
(ERROR "{")
-] @indent
+] @indent.begin
;; This only works with expanded tabs.
-; ((parameters) @aligned_indent (#set! "open_delimiter" "(") (#set! "close_delimiter" ")"))
-; ((arguments) @aligned_indent (#set! "open_delimiter" "(") (#set! "close_delimiter" ")"))
+; ((parameters) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")"))
+; ((arguments) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")"))
;; The following queries either do not agree with the current body parsing or are
;; attempted workarounds. Specifically as the last statement of a body. Opening
;; a new line in between statements works well.
;;
-;; The overall experience is poor, so I've opted for @auto.
+;; The overall experience is poor, so I've opted for @indent.auto.
;;
;; The gdscript parser will need to be patched to accommodate more interactive
;; edits. As far as I can tell the parser greedily consumes whitespace
;; as a zero-width token which causes trouble when inserting indents.
;; This indents correctly with tabs.
-; (arguments) @indent
-; (parameters) @indent
-; (array) @indent
-; (dictionary) @indent
-; (parenthesized_expression) @indent
+; (arguments) @indent.begin
+; (parameters) @indent.begin
+; (array) @indent.begin
+; (dictionary) @indent.begin
+; (parenthesized_expression) @indent.begin
;; Partial workaround for when the cursor is on the bracket character and a newline
;; is created with <o>. Without this the newline is opened with extra
;; indentation.
-; (body (_ (array "]" @indent_end) ) _)
+; (body (_ (array "]" @indent.end) ) _)
;; Problematic behaviors occur at the last statement of a body.
;; with @dedent:
;; - [ | ] i<CR> will dedent ] to 0.
@@ -75,4 +75,4 @@
;; - [ | ] i<CR> same
;; - [
;; ]| o will open new line with extra indent.
-;(body (_ (array "]" @auto) ) .)
+;(body (_ (array "]" @indent.auto) ) .)
diff --git a/queries/gleam/indents.scm b/queries/gleam/indents.scm
index 61986b26f..f19e28318 100644
--- a/queries/gleam/indents.scm
+++ b/queries/gleam/indents.scm
@@ -18,13 +18,13 @@
(todo)
(try)
(tuple)
-] @indent
+] @indent.begin
[
")"
"]"
"}"
-] @indent_end @branch
+] @indent.end @indent.branch
; Gleam pipelines are not indented, but other binary expression chains are
-((binary_expression operator: _ @_operator) @indent (#not-eq? @_operator "|>"))
+((binary_expression operator: _ @_operator) @indent.begin (#not-eq? @_operator "|>"))
diff --git a/queries/go/indents.scm b/queries/go/indents.scm
index fe6e447eb..5f0039ac4 100644
--- a/queries/go/indents.scm
+++ b/queries/go/indents.scm
@@ -13,21 +13,21 @@
(call_expression)
(parameter_list)
(struct_type)
-] @indent
+] @indent.begin
[
"}"
-] @branch
+] @indent.branch
-(const_declaration ")" @branch)
-(import_spec_list ")" @branch)
-(var_declaration ")" @branch)
+(const_declaration ")" @indent.branch)
+(import_spec_list ")" @indent.branch)
+(var_declaration ")" @indent.branch)
[
"}"
")"
-] @indent_end
+] @indent.end
-(parameter_list ")" @branch)
+(parameter_list ")" @indent.branch)
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/graphql/indents.scm b/queries/graphql/indents.scm
index 0f222b6d4..df47aff88 100644
--- a/queries/graphql/indents.scm
+++ b/queries/graphql/indents.scm
@@ -1,9 +1,9 @@
[
(definition)
(selection)
-] @indent
+] @indent.begin
[
"{"
"}"
-] @branch
+] @indent.branch
diff --git a/queries/hare/indents.scm b/queries/hare/indents.scm
index 0324f09c6..b3aadcd6e 100644
--- a/queries/hare/indents.scm
+++ b/queries/hare/indents.scm
@@ -12,25 +12,25 @@
(array_literal)
(struct_literal)
(tuple_literal)
-] @indent
+] @indent.begin
(if_statement
- ("(" condition: (_) ")") @indent)
+ ("(" condition: (_) ")") @indent.begin)
[
"}"
"]"
")"
-] @indent_end
+] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
[
(ERROR)
(comment)
(concatenated_string)
-] @auto
+] @indent.auto
diff --git a/queries/hcl/indents.scm b/queries/hcl/indents.scm
index d68ec3081..93264de9d 100644
--- a/queries/hcl/indents.scm
+++ b/queries/hcl/indents.scm
@@ -3,13 +3,13 @@
(object)
(tuple)
(function_call)
-] @indent
+] @indent.begin
[
"]"
")"
"}"
-] @branch @indent_end
+] @indent.branch @indent.end
-(comment) @auto
-(ERROR) @auto
+(comment) @indent.auto
+(ERROR) @indent.auto
diff --git a/queries/heex/indents.scm b/queries/heex/indents.scm
index 99fc693dc..82a2f8912 100644
--- a/queries/heex/indents.scm
+++ b/queries/heex/indents.scm
@@ -3,18 +3,18 @@
(component)
(slot)
(tag)
-] @indent
+] @indent.begin
; Dedent at the end of each tag, component, and slot
[
(end_component)
(end_slot)
(end_tag)
-] @branch @dedent
+] @indent.branch @indent.dedent
; Self-closing tags and components should not change
; indentation level of sibling nodes
[
(self_closing_component)
(self_closing_tag)
-] @auto
+] @indent.auto
diff --git a/queries/hjson/indents.scm b/queries/hjson/indents.scm
index 26a42eeda..3b01ca999 100644
--- a/queries/hjson/indents.scm
+++ b/queries/hjson/indents.scm
@@ -1,3 +1,3 @@
; inherits: json
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/html_tags/indents.scm b/queries/html_tags/indents.scm
index 1e4d4707f..2d9fd3864 100644
--- a/queries/html_tags/indents.scm
+++ b/queries/html_tags/indents.scm
@@ -7,7 +7,7 @@
(#not-any-of? @_not_special "meta" "link")
)
(element (self_closing_tag))
-] @indent
+] @indent.begin
; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them
; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined
@@ -15,20 +15,20 @@
(start_tag
(tag_name) @_special)
(#any-of? @_special "meta" "link")
-) @indent
+) @indent.begin
; These are the nodes that will be captured when we do `normal o`
; But last element has already been ended, so capturing this
; to mark end of last element
-(element (end_tag [">"] @indent_end))
-(element (self_closing_tag "/>" @indent_end))
+(element (end_tag [">"] @indent.end))
+(element (self_closing_tag "/>" @indent.end))
; Script/style elements aren't indented, so only branch the end tag of other elements
-(element (end_tag) @branch)
+(element (end_tag) @indent.branch)
[
">"
"/>"
-] @branch
+] @indent.branch
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/htmldjango/indents.scm b/queries/htmldjango/indents.scm
index 8fa0a456c..fd3d86502 100644
--- a/queries/htmldjango/indents.scm
+++ b/queries/htmldjango/indents.scm
@@ -1,3 +1,3 @@
-(paired_statement) @indent
-(end_paired_statement) @indent_end
-(branch_statement) @branch
+(paired_statement) @indent.begin
+(end_paired_statement) @indent.end
+(branch_statement) @indent.branch
diff --git a/queries/java/indents.scm b/queries/java/indents.scm
index 033c314ec..017646e5b 100644
--- a/queries/java/indents.scm
+++ b/queries/java/indents.scm
@@ -8,9 +8,9 @@
(array_initializer)
(argument_list)
(formal_parameters)
-] @indent
+] @indent.begin
-(expression_statement (method_invocation) @indent)
+(expression_statement (method_invocation) @indent.begin)
[
"("
@@ -19,13 +19,14 @@
"}"
"["
"]"
-] @branch
+] @indent.branch
-"}" @indent_end
+"}" @indent.end
-(line_comment) @ignore
+(line_comment) @indent.ignore
[
(ERROR)
(block_comment)
-] @auto
+] @indent.auto
+
diff --git a/queries/json/indents.scm b/queries/json/indents.scm
index 0345b945b..8274ee3d5 100644
--- a/queries/json/indents.scm
+++ b/queries/json/indents.scm
@@ -1,9 +1,9 @@
[
(object)
(array)
-] @indent
+] @indent.begin
[
"}"
"]"
-] @branch
+] @indent.branch
diff --git a/queries/jsonc/indents.scm b/queries/jsonc/indents.scm
index 26a42eeda..3b01ca999 100644
--- a/queries/jsonc/indents.scm
+++ b/queries/jsonc/indents.scm
@@ -1,3 +1,3 @@
; inherits: json
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/jsx/indents.scm b/queries/jsx/indents.scm
index 81ef8b238..3355061e1 100644
--- a/queries/jsx/indents.scm
+++ b/queries/jsx/indents.scm
@@ -3,19 +3,19 @@
(jsx_element)
(jsx_self_closing_element)
(jsx_expression)
-] @indent
+] @indent.begin
(jsx_fragment
- ("<" ">" (_) "<" @branch "/" ">" @indent_end)
+ ("<" ">" (_) "<" @indent.branch "/" ">" @indent.end)
)
-(jsx_closing_element (">" @indent_end))
-(jsx_self_closing_element ">" @indent_end)
+(jsx_closing_element (">" @indent.end))
+(jsx_self_closing_element ">" @indent.end)
[
(jsx_closing_element)
">"
-] @branch
+] @indent.branch
; <button
; />
-(jsx_self_closing_element "/" @branch)
+(jsx_self_closing_element "/" @indent.branch)
diff --git a/queries/julia/indents.scm b/queries/julia/indents.scm
index 5e88c697c..142dee473 100644
--- a/queries/julia/indents.scm
+++ b/queries/julia/indents.scm
@@ -22,7 +22,7 @@
(comprehension_expression)
(matrix_expression)
(vector_expression)
-] @indent
+] @indent.begin
[
"end"
@@ -34,10 +34,10 @@
(elseif_clause)
(catch_clause)
(finally_clause)
-] @branch
+] @indent.branch
[
(line_comment)
(block_comment)
-] @ignore
+] @indent.ignore
diff --git a/queries/kdl/indents.scm b/queries/kdl/indents.scm
index 3bb1ee66d..c14fec5cb 100644
--- a/queries/kdl/indents.scm
+++ b/queries/kdl/indents.scm
@@ -1,7 +1,7 @@
-(node (node_children) @indent)
+(node (node_children) @indent.begin)
-"}" @indent_end
+"}" @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
diff --git a/queries/ledger/indents.scm b/queries/ledger/indents.scm
index af74b1d41..31e7f56df 100644
--- a/queries/ledger/indents.scm
+++ b/queries/ledger/indents.scm
@@ -1,3 +1,3 @@
[
(journal_item)
-] @indent
+] @indent.begin
diff --git a/queries/lua/indents.scm b/queries/lua/indents.scm
index f23e7cc99..1125e6485 100644
--- a/queries/lua/indents.scm
+++ b/queries/lua/indents.scm
@@ -13,17 +13,17 @@
(table_constructor)
(arguments)
(return_statement)
-] @indent
+] @indent.begin
[
"end"
")"
"}"
-] @indent_end
+] @indent.end
(return_statement
(expression_list
- (function_call))) @dedent
+ (function_call))) @indent.dedent
[
"end"
@@ -35,8 +35,9 @@
(elseif_statement)
"else"
(else_statement)
-] @branch
+] @indent.branch
-(comment) @auto
+(comment) @indent.auto
+
+(string) @indent.auto
-(string) @auto
diff --git a/queries/ninja/indents.scm b/queries/ninja/indents.scm
index 088dec2cd..19f20dff5 100644
--- a/queries/ninja/indents.scm
+++ b/queries/ninja/indents.scm
@@ -2,5 +2,5 @@
(pool)
(rule)
(build)
-] @indent
+] @indent.begin
diff --git a/queries/pascal/indents.scm b/queries/pascal/indents.scm
index 829054ddb..bbeea0089 100644
--- a/queries/pascal/indents.scm
+++ b/queries/pascal/indents.scm
@@ -14,9 +14,9 @@
(recInitializer)
(arrInitializer)
(defaultValue)
-] @indent
+] @indent.begin
-(defProc (block) @indent)
+(defProc (block) @indent.begin)
[
(kEnd)
@@ -29,4 +29,4 @@
(declSection)
"]"
")"
-] @branch
+] @indent.branch
diff --git a/queries/php/indents.scm b/queries/php/indents.scm
index 1a2bb9017..c490ad77f 100644
--- a/queries/php/indents.scm
+++ b/queries/php/indents.scm
@@ -11,18 +11,18 @@
(match_block)
(case_statement)
"["
-] @indent
+] @indent.begin
[
")"
"}"
"]"
-] @branch
+] @indent.branch
[
(comment)
-] @auto
+] @indent.auto
-(compound_statement "}" @indent_end)
+(compound_statement "}" @indent.end)
-(ERROR) @auto
+(ERROR) @indent.auto
diff --git a/queries/poe_filter/indents.scm b/queries/poe_filter/indents.scm
index c096da418..78b7a2ed1 100644
--- a/queries/poe_filter/indents.scm
+++ b/queries/poe_filter/indents.scm
@@ -1,5 +1,5 @@
-(block) @indent
+(block) @indent.begin
-(ERROR) @auto
+(ERROR) @indent.auto
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/python/indents.scm b/queries/python/indents.scm
index 166787f28..01933641b 100644
--- a/queries/python/indents.scm
+++ b/queries/python/indents.scm
@@ -14,97 +14,91 @@
(lambda)
(concatenated_string)
-] @indent
+] @indent.begin
-((list) @aligned_indent
- (#set! "open_delimiter" "[")
- (#set! "close_delimiter" "]")
- (#set! "dedent_lone_close_delimiter" 1)
+((list) @indent.align
+ (#set! indent.open_delimiter "[")
+ (#set! indent.close_delimiter "]")
)
-((dictionary) @aligned_indent
- (#set! "open_delimiter" "{")
- (#set! "close_delimiter" "}")
- (#set! "dedent_lone_close_delimiter" 1)
+((dictionary) @indent.align
+ (#set! indent.open_delimiter "{")
+ (#set! indent.close_delimiter "}")
)
-((set) @aligned_indent
- (#set! "open_delimiter" "{")
- (#set! "close_delimiter" "}")
- (#set! "dedent_lone_close_delimiter" 1)
+((set) @indent.align
+ (#set! indent.open_delimiter "{")
+ (#set! indent.close_delimiter "}")
)
-((for_statement) @indent
- (#set! "immediate_indent" 1))
-((if_statement) @indent
- (#set! "immediate_indent" 1))
-((while_statement) @indent
- (#set! "immediate_indent" 1))
-((try_statement) @indent
- (#set! "immediate_indent" 1))
-(ERROR "try" ":" @indent (#set! "immediate_indent" 1))
-((function_definition) @indent
- (#set! "immediate_indent" 1))
-((class_definition) @indent
- (#set! "immediate_indent" 1))
-((with_statement) @indent
- (#set! "immediate_indent" 1))
+((for_statement) @indent.begin
+ (#set! indent.immediate 1))
+((if_statement) @indent.begin
+ (#set! indent.immediate 1))
+((while_statement) @indent.begin
+ (#set! indent.immediate 1))
+((try_statement) @indent.begin
+ (#set! indent.immediate 1))
+(ERROR "try" ":" @indent.begin (#set! indent.immediate 1))
+((function_definition) @indent.begin
+ (#set! indent.immediate 1))
+((class_definition) @indent.begin
+ (#set! indent.immediate 1))
+((with_statement) @indent.begin
+ (#set! indent.immediate 1))
(if_statement
- condition: (parenthesized_expression) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")")
- (#set! "avoid_last_matching_next" 1)
+ condition: (parenthesized_expression) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")")
+ (#set! indent.avoid_last_matching_next 1)
)
(while_statement
- condition: (parenthesized_expression) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")")
- (#set! "avoid_last_matching_next" 1)
+ condition: (parenthesized_expression) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")")
+ (#set! indent.avoid_last_matching_next 1)
)
-(ERROR "(" @aligned_indent (#set! "open_delimiter" "(") (#set! "close_delimiter" ")") . (_))
-((argument_list) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
-((parameters) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")")
- (#set! "avoid_last_matching_next" 1))
-((tuple) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+(ERROR "(" @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")") . (_))
+((argument_list) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+((parameters) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")")
+ (#set! indent.avoid_last_matching_next 1))
+((tuple) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
-(ERROR "[" @aligned_indent (#set! "open_delimiter" "[") (#set! "close_delimiter" "]") . (_))
-(list "]" @indent_end)
+(ERROR "[" @indent.align (#set! indent.open_delimiter "[") (#set! indent.close_delimiter "]") . (_))
-(ERROR "{" @aligned_indent (#set! "open_delimiter" "{") (#set! "close_delimiter" "}") . (_))
-(dictionary "}" @indent_end)
-(set "}" @indent_end)
+(ERROR "{" @indent.align (#set! indent.open_delimiter "{") (#set! indent.close_delimiter "}") . (_))
-(parenthesized_expression ")" @indent_end)
-(generator_expression ")" @indent_end)
-(list_comprehension "]" @indent_end)
-(set_comprehension "}" @indent_end)
-(dictionary_comprehension "}" @indent_end)
+(parenthesized_expression ")" @indent.end)
+(generator_expression ")" @indent.end)
+(list_comprehension "]" @indent.end)
+(set_comprehension "}" @indent.end)
+(dictionary_comprehension "}" @indent.end)
-(tuple_pattern ")" @indent_end)
-(list_pattern "]" @indent_end)
+(tuple_pattern ")" @indent.end)
+(list_pattern "]" @indent.end)
(return_statement
[
- (_) @indent_end
+ (_) @indent.end
(_
[
(_)
")"
"}"
"]"
- ] @indent_end .)
+ ] @indent.end .)
(attribute
- attribute: (_) @indent_end)
+ attribute: (_) @indent.end)
(call
- arguments: (_ ")" @indent_end))
- "return" @indent_end
+ arguments: (_ ")" @indent.end))
+ "return" @indent.end
] .)
[
@@ -115,7 +109,7 @@
(else_clause)
(except_clause)
(finally_clause)
-] @branch
+] @indent.branch
-(string) @auto
+(string) @indent.auto
diff --git a/queries/ql/indents.scm b/queries/ql/indents.scm
index 8e5831738..1a4a1bdea 100644
--- a/queries/ql/indents.scm
+++ b/queries/ql/indents.scm
@@ -4,20 +4,20 @@
(classMember)
(classlessPredicate)
(quantified)
-] @indent
+] @indent.begin
[
")"
"}"
-] @indent_end
+] @indent.end
[
")"
"}"
-] @branch
+] @indent.branch
[
(block_comment)
(line_comment)
(qldoc)
-] @ignore
+] @indent.ignore
diff --git a/queries/query/indents.scm b/queries/query/indents.scm
index 0df23706f..7c53fa1ad 100644
--- a/queries/query/indents.scm
+++ b/queries/query/indents.scm
@@ -1,8 +1,8 @@
[
(list)
-] @indent
+] @indent.begin
[
"["
"]"
-] @branch
+] @indent.begin
diff --git a/queries/r/indents.scm b/queries/r/indents.scm
index c0551eaea..3b9e495ad 100644
--- a/queries/r/indents.scm
+++ b/queries/r/indents.scm
@@ -10,24 +10,24 @@
"while"
"repeat"
"for"
-] @indent
+] @indent.begin
-((binary operator: (special)) @indent)
+((binary operator: (special)) @indent.begin)
[
"}"
")"
-] @branch
+] @indent.branch
-((formal_parameters (identifier)) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+((formal_parameters (identifier)) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
[
")"
"}"
-] @indent_end
+] @indent.end
[
(comment)
-] @ignore
+] @indent.ignore
diff --git a/queries/rasi/indents.scm b/queries/rasi/indents.scm
index ad8fe49bf..398cf8b8f 100644
--- a/queries/rasi/indents.scm
+++ b/queries/rasi/indents.scm
@@ -1,5 +1,5 @@
-(rule_set) @indent
+(rule_set) @indent.begin
-(block "}" @branch)
+(block "}" @indent.branch)
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/ron/indents.scm b/queries/ron/indents.scm
index 84701a7e9..7fd9a5ff2 100644
--- a/queries/ron/indents.scm
+++ b/queries/ron/indents.scm
@@ -3,10 +3,10 @@
(map)
(tuple)
(struct)
-] @indent
+] @indent.begin
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
diff --git a/queries/ruby/indents.scm b/queries/ruby/indents.scm
index 8101b1ab7..b76732922 100644
--- a/queries/ruby/indents.scm
+++ b/queries/ruby/indents.scm
@@ -19,14 +19,14 @@
(unless)
(assignment)
(parenthesized_statements)
-] @indent
+] @indent.begin
[
"end"
")"
"}"
"]"
-] @indent_end
+] @indent.end
[
"end"
@@ -38,6 +38,6 @@
(else)
(rescue)
(ensure)
-] @branch
+] @indent.branch
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/rust/indents.scm b/queries/rust/indents.scm
index 7eb1539e0..0546efd25 100644
--- a/queries/rust/indents.scm
+++ b/queries/rust/indents.scm
@@ -22,38 +22,39 @@
(parameters)
(token_tree)
(macro_definition)
-] @indent
-(trait_item body: (_) @indent)
-(string_literal (escape_sequence)) @indent
+] @indent.begin
+(trait_item body: (_) @indent.begin)
+(string_literal (escape_sequence)) @indent.begin
-(block "}" @indent_end)
+(block "}" @indent.end)
(enum_item
- body: (enum_variant_list "}" @indent_end))
+ body: (enum_variant_list "}" @indent.end))
(impl_item
- body: (declaration_list "}" @indent_end))
+ body: (declaration_list "}" @indent.end))
(match_expression
- body: (match_block "}" @indent_end))
+ body: (match_block "}" @indent.end))
(mod_item
- body: (declaration_list "}" @indent_end))
+ body: (declaration_list "}" @indent.end))
(struct_item
- body: (field_declaration_list "}" @indent_end))
+ body: (field_declaration_list "}" @indent.end))
(trait_item
- body: (declaration_list "}" @indent_end))
+ body: (declaration_list "}" @indent.end))
-(impl_item (where_clause) @dedent)
+(impl_item (where_clause) @indent.dedent)
[
"where"
")"
"]"
"}"
-] @branch
-(impl_item (declaration_list) @branch)
+] @indent.branch
+(impl_item (declaration_list) @indent.branch)
[
(line_comment)
(string_literal)
-] @ignore
+] @indent.ignore
-(raw_string_literal) @auto
+(raw_string_literal) @indent.auto
+
diff --git a/queries/scss/indents.scm b/queries/scss/indents.scm
index 2889ddca7..902eee7bb 100644
--- a/queries/scss/indents.scm
+++ b/queries/scss/indents.scm
@@ -4,4 +4,4 @@
(mixin_statement)
(while_statement)
(each_statement)
-] @indent
+] @indent.begin
diff --git a/queries/slint/indents.scm b/queries/slint/indents.scm
index 44e426493..db79aa0d5 100644
--- a/queries/slint/indents.scm
+++ b/queries/slint/indents.scm
@@ -5,10 +5,10 @@
(handler_body)
(consequence_body)
(global_single)
-] @indent
+] @indent.begin
-"}" @indent_end
+"}" @indent.end
-(comment) @auto
+(comment) @indent.auto
-(string_literal) @auto
+(string_literal) @indent.auto
diff --git a/queries/smali/indents.scm b/queries/smali/indents.scm
index 871362cbd..cdfd9081e 100644
--- a/queries/smali/indents.scm
+++ b/queries/smali/indents.scm
@@ -9,7 +9,7 @@
(sparse_switch_directive)
(subannotation_directive)
(list)
-] @indent
+] @indent.begin
[
".end annotation"
@@ -22,11 +22,11 @@
".end sparse-switch"
".end subannotation"
"}"
-] @indent_end
+] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/sparql/indents.scm b/queries/sparql/indents.scm
index a154522a5..a0cee376c 100644
--- a/queries/sparql/indents.scm
+++ b/queries/sparql/indents.scm
@@ -8,10 +8,10 @@
(data_block)
(blank_node_property_list)
(collection)
-] @indent
+] @indent.begin
[
"}"
"]"
")"
(triples_same_subject)
-] @branch
+] @indent.branch
diff --git a/queries/squirrel/indents.scm b/queries/squirrel/indents.scm
index 6649b732b..0dbbab416 100644
--- a/queries/squirrel/indents.scm
+++ b/queries/squirrel/indents.scm
@@ -15,39 +15,39 @@
(foreach_statement)
; (try_statement)
(catch_statement)
-] @indent
+] @indent.begin
(
(if_statement)
- (ERROR "else") @indent
+ (ERROR "else") @indent.begin
)
(if_statement
- condition: (_) @indent)
+ condition: (_) @indent.begin)
(if_statement
consequence: (_)
- (else_statement) @indent)
+ (else_statement) @indent.begin)
(do_while_statement
"do"
- (_) @indent)
+ (_) @indent.begin)
(try_statement
- (_) @indent
- (catch_statement) @indent)
+ (_) @indent.begin
+ (catch_statement) @indent.begin)
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
[
"}"
")"
"]"
-] @indent_end
+] @indent.end
[
(ERROR)
@@ -55,4 +55,4 @@
(string)
(verbatim_string)
-] @auto
+] @indent.auto
diff --git a/queries/starlark/indents.scm b/queries/starlark/indents.scm
index 1b18664c5..d87a8bc7f 100644
--- a/queries/starlark/indents.scm
+++ b/queries/starlark/indents.scm
@@ -19,28 +19,28 @@
(lambda)
(function_definition)
-] @indent
+] @indent.begin
(if_statement
- condition: (parenthesized_expression) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")")
+ condition: (parenthesized_expression) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")")
)
-((ERROR "(" . (_)) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
-((argument_list) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
-((argument_list) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
-((parameters) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
-((tuple) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+((ERROR "(" . (_)) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+((argument_list) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+((argument_list) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+((parameters) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+((tuple) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
[
")"
@@ -48,6 +48,6 @@
"}"
(elif_clause)
(else_clause)
-] @branch
+] @indent.branch
-(string) @auto
+(string) @indent.auto
diff --git a/queries/supercollider/indents.scm b/queries/supercollider/indents.scm
index c0be0cbaa..41241c6ec 100644
--- a/queries/supercollider/indents.scm
+++ b/queries/supercollider/indents.scm
@@ -13,7 +13,7 @@
(variable_definition_sequence (variable_definition))
(control_structure)
(return_statement)
-] @indent
+] @indent.begin
[
(parameter_call_list (argument_calls))
@@ -23,9 +23,9 @@
"}"
"["
"]"
-] @branch
+] @indent.branch
[
(block_comment)
(line_comment)
-] @ignore
+] @indent.ignore
diff --git a/queries/surface/indents.scm b/queries/surface/indents.scm
index dceea9c7e..b9321b7ca 100644
--- a/queries/surface/indents.scm
+++ b/queries/surface/indents.scm
@@ -3,7 +3,7 @@
(component)
(tag)
(block)
-] @indent
+] @indent.begin
; Dedent at the end of each tag, as well as a subblock
[
@@ -11,4 +11,4 @@
(end_component)
(end_block)
(subblock)
-] @branch
+] @indent.branch
diff --git a/queries/svelte/indents.scm b/queries/svelte/indents.scm
index 2f6f5c32e..6000c5900 100644
--- a/queries/svelte/indents.scm
+++ b/queries/svelte/indents.scm
@@ -5,7 +5,7 @@
(await_statement)
(script_element)
(style_element)
-] @indent
+] @indent.begin
[
(end_tag)
@@ -15,6 +15,6 @@
(await_end_expr)
">"
"/>"
-] @branch
+] @indent.branch
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/tablegen/indents.scm b/queries/tablegen/indents.scm
index 74287b02f..5d73f8848 100644
--- a/queries/tablegen/indents.scm
+++ b/queries/tablegen/indents.scm
@@ -9,19 +9,19 @@
(if)
(let)
(value_suffix)
-] @indent
+] @indent.begin
[
"}"
"]"
")"
">"
-] @indent_end
+] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
-[ "<" ">" ] @branch
+[ "<" ">" ] @indent.branch
diff --git a/queries/teal/indents.scm b/queries/teal/indents.scm
index b199015a6..77b269cd9 100644
--- a/queries/teal/indents.scm
+++ b/queries/teal/indents.scm
@@ -6,7 +6,7 @@
(if_statement)
(return_statement)
(while_statement)
-] @indent
+] @indent.begin
[
"{"
@@ -15,4 +15,4 @@
")"
"end"
"then"
-] @branch
+] @indent.branch
diff --git a/queries/thrift/indents.scm b/queries/thrift/indents.scm
index 73ceff342..32c6a2e9f 100644
--- a/queries/thrift/indents.scm
+++ b/queries/thrift/indents.scm
@@ -1,16 +1,16 @@
-(definition) @indent
+(definition) @indent.begin
-((parameters (parameter)) @aligned_indent
- (#set! "open_delimiter" "(")
- (#set! "close_delimiter" ")"))
+((parameters (parameter)) @indent.align
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
-"}" @indent_end
+"}" @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/tiger/indents.scm b/queries/tiger/indents.scm
index 4ac8d2452..0cb45d391 100644
--- a/queries/tiger/indents.scm
+++ b/queries/tiger/indents.scm
@@ -1,69 +1,69 @@
; Control flow {{{
-(if_expression) @indent
-"then" @branch
-"else" @branch
+(if_expression) @indent.begin
+"then" @indent.branch
+"else" @indent.branch
-(while_expression) @indent
-"do" @branch
+(while_expression) @indent.begin
+"do" @indent.branch
-(for_expression) @indent
-"to" @branch
+(for_expression) @indent.begin
+"to" @indent.branch
; }}}
; Class {{{
-(class_declaration) @indent
-(class_declaration "}" @indent_end)
+(class_declaration) @indent.begin
+(class_declaration "}" @indent.end)
-(class_type) @indent
-(class_type "}" @indent_end)
+(class_type) @indent.begin
+(class_type "}" @indent.end)
; }}}
; Groups {{{
-(let_expression) @indent
-"in" @branch
-"end" @branch
-(let_expression "end" @indent_end)
+(let_expression) @indent.begin
+"in" @indent.branch
+"end" @indent.branch
+(let_expression "end" @indent.end)
-(sequence_expression) @indent
-")" @branch
-(sequence_expression ")" @indent_end)
+(sequence_expression) @indent.begin
+")" @indent.branch
+(sequence_expression ")" @indent.end)
; }}}
; Functions and methods {{{
-(parameters) @indent
-(parameters ")" @indent_end)
+(parameters) @indent.begin
+(parameters ")" @indent.end)
-(function_call) @indent
-(method_call) @indent
-")" @branch
+(function_call) @indent.begin
+(method_call) @indent.begin
+")" @indent.branch
-(function_declaration) @indent
-(primitive_declaration) @indent
-(method_declaration) @indent
+(function_declaration) @indent.begin
+(primitive_declaration) @indent.begin
+(method_declaration) @indent.begin
; }}}
; Values and expressions {{{
-(array_value) @indent
-"]" @branch
-(array_value "]" @indent_end)
+(array_value) @indent.begin
+"]" @indent.branch
+(array_value "]" @indent.end)
-(array_expression) @indent
-"of" @branch
+(array_expression) @indent.begin
+"of" @indent.branch
-(record_expression) @indent
-"}" @branch
-(record_expression "}" @indent_end)
+(record_expression) @indent.begin
+"}" @indent.branch
+(record_expression "}" @indent.end)
-(record_type) @indent
-"}" @branch
-(record_type "}" @indent_end)
+(record_type) @indent.begin
+"}" @indent.branch
+(record_type "}" @indent.end)
-(variable_declaration) @indent
+(variable_declaration) @indent.begin
; }}}
; Misc{{{
-(comment) @ignore
-(string_literal) @ignore
+(comment) @indent.ignore
+(string_literal) @indent.ignore
; }}}
; vim: sw=2 foldmethod=marker
diff --git a/queries/toml/indents.scm b/queries/toml/indents.scm
index ae5a84344..a2391a4bd 100644
--- a/queries/toml/indents.scm
+++ b/queries/toml/indents.scm
@@ -1,11 +1,11 @@
[
(array)
(inline_table)
-] @indent
+] @indent.begin
[
"["
"]"
"{"
"}"
-] @branch
+] @indent.branch
diff --git a/queries/turtle/indents.scm b/queries/turtle/indents.scm
index 839f50c71..4d40b3cbe 100644
--- a/queries/turtle/indents.scm
+++ b/queries/turtle/indents.scm
@@ -2,9 +2,9 @@
(statement)
(blank_node_property_list)
(collection)
-] @indent
+] @indent.begin
[
"]"
")"
-] @branch
+] @indent.branch
diff --git a/queries/typescript/indents.scm b/queries/typescript/indents.scm
index d7f9cbc2a..9a269ba75 100644
--- a/queries/typescript/indents.scm
+++ b/queries/typescript/indents.scm
@@ -4,4 +4,4 @@
(enum_declaration)
(interface_declaration)
(object_type)
-] @indent
+] @indent.begin
diff --git a/queries/ungrammar/indents.scm b/queries/ungrammar/indents.scm
index d4b7c085d..a5ececdbe 100644
--- a/queries/ungrammar/indents.scm
+++ b/queries/ungrammar/indents.scm
@@ -1,6 +1,6 @@
-(node) @indent
+(node) @indent.begin
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/uxntal/indents.scm b/queries/uxntal/indents.scm
index 2802cfd1f..cb07a52ee 100644
--- a/queries/uxntal/indents.scm
+++ b/queries/uxntal/indents.scm
@@ -1,17 +1,17 @@
-(memory_execution) @auto
+(memory_execution) @indent.auto
[
(subroutine)
(brackets)
-] @indent
+] @indent.begin
-"}" @indent_end
+"}" @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/v/indents.scm b/queries/v/indents.scm
index febd3786e..afcf6d8c6 100644
--- a/queries/v/indents.scm
+++ b/queries/v/indents.scm
@@ -7,11 +7,11 @@
(map)
(call_expression)
(parameter_list)]
-@indent
+@indent.begin
[ "}"]
-@branch
+@indent.branch
-(parameter_list ")" @branch)
+(parameter_list ")" @indent.branch)
-(comment) @ignore
+(comment) @indent.ignore
diff --git a/queries/vue/indents.scm b/queries/vue/indents.scm
index ab8375a23..39355b020 100644
--- a/queries/vue/indents.scm
+++ b/queries/vue/indents.scm
@@ -2,6 +2,6 @@
[
(template_element)
-] @indent
+] @indent.begin
-(template_element (end_tag ">" @indent_end) @branch)
+(template_element (end_tag ">" @indent.end) @indent.branch)
diff --git a/queries/wgsl/indents.scm b/queries/wgsl/indents.scm
index a764122c3..08be2255e 100644
--- a/queries/wgsl/indents.scm
+++ b/queries/wgsl/indents.scm
@@ -3,17 +3,17 @@
(compound_statement)
(loop_statement)
(struct_declaration)
-] @indent
+] @indent.begin
-(compound_statement "}" @indent_end)
-(loop_statement "}" @indent_end)
-(function_declaration ")" @indent_end)
-(struct_declaration "}" @indent_end)
+(compound_statement "}" @indent.end)
+(loop_statement "}" @indent.end)
+(function_declaration ")" @indent.end)
+(struct_declaration "}" @indent.end)
[
"else"
")"
"}"
-] @branch
+] @indent.branch
-[(line_comment) (block_comment)] @auto
+[(line_comment) (block_comment)] @indent.auto
diff --git a/queries/wgsl_bevy/indents.scm b/queries/wgsl_bevy/indents.scm
index 84d1845c0..381321877 100644
--- a/queries/wgsl_bevy/indents.scm
+++ b/queries/wgsl_bevy/indents.scm
@@ -4,4 +4,4 @@
"#ifndef"
"#else"
"#endif"
-] @zero_indent
+] @indent.zero
diff --git a/queries/yaml/indents.scm b/queries/yaml/indents.scm
index 5820c62e4..f168bcc5a 100644
--- a/queries/yaml/indents.scm
+++ b/queries/yaml/indents.scm
@@ -1,6 +1,6 @@
[
(block_mapping_pair value: (block_node))
(block_sequence_item)
-] @indent
+] @indent.begin
-(ERROR) @auto
+(ERROR) @indent.auto
diff --git a/queries/yang/indents.scm b/queries/yang/indents.scm
index 73e743789..d8782f955 100644
--- a/queries/yang/indents.scm
+++ b/queries/yang/indents.scm
@@ -1,11 +1,11 @@
-(module) @indent
-(submodule) @indent
-(statement) @indent
-(extension_statement) @indent
-(statement ";" @indent_end)
-(extension_statement ";" @indent_end)
-(block "}" @indent_end @branch)
+(module) @indent.begin
+(submodule) @indent.begin
+(statement) @indent.begin
+(extension_statement) @indent.begin
+(statement ";" @indent.end)
+(extension_statement ";" @indent.end)
+(block "}" @indent.end @indent.branch)
-((string) @aligned_indent
- (#set! "open_delimiter" "\"")
- (#set! "close_delimiter" "\""))
+((string) @indent.align
+ (#set! indent.open_delimiter "\"")
+ (#set! indent.close_delimiter "\""))
diff --git a/queries/yuck/indents.scm b/queries/yuck/indents.scm
index 9551a6061..bcf028ce4 100644
--- a/queries/yuck/indents.scm
+++ b/queries/yuck/indents.scm
@@ -5,22 +5,22 @@
(json_array)
(json_object)
(parenthesized_expression)
-] @indent
+] @indent.begin
; TODO: can't get this to work, goal is to indent at the property ":" prefix
-; ((list (identifier) (property)) @aligned_indent
-; (#set! "open_delimiter" "(")
-; (#set! "close_delimiter" ")"))
+; ((list (identifier) (property)) @indent.align
+; (#set! indent.open_delimiter "(")
+; (#set! indent.close_delimiter ")"))
-[")" "}" "]"] @indent_end
+[")" "}" "]"] @indent.end
-[ "{" "}" ] @branch
+[ "{" "}" ] @indent.branch
-[ "(" ")" ] @branch
+[ "(" ")" ] @indent.branch
-[ "[" "]" ] @branch
+[ "[" "]" ] @indent.branch
[
(ERROR)
(comment)
-] @auto
+] @indent.auto
diff --git a/queries/zig/indents.scm b/queries/zig/indents.scm
index f3afdfb48..fdf7b183b 100644
--- a/queries/zig/indents.scm
+++ b/queries/zig/indents.scm
@@ -3,9 +3,9 @@
(ContainerDecl)
(SwitchExpr)
(InitList)
-] @indent
+] @indent.begin
-(Block "}" @indent_end)
+(Block "}" @indent.end)
[
"("
@@ -14,11 +14,11 @@
"]"
"{"
"}"
-] @branch
+] @indent.branch
[
(line_comment)
(container_doc_comment)
(doc_comment)
(LINESTRING)
-] @ignore
+] @indent.ignore