aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/c/indents.scm33
-rw-r--r--runtime/queries/c/indents.toml16
-rw-r--r--runtime/queries/cmake/indents.scm10
-rw-r--r--runtime/queries/cmake/indents.toml12
-rw-r--r--runtime/queries/cpp/indents.scm3
-rw-r--r--runtime/queries/cpp/indents.toml17
-rw-r--r--runtime/queries/dart/indents.scm20
-rw-r--r--runtime/queries/dart/indents.toml20
-rw-r--r--runtime/queries/fish/indents.scm12
-rw-r--r--runtime/queries/fish/indents.toml12
-rw-r--r--runtime/queries/glsl/indents.scm19
-rw-r--r--runtime/queries/glsl/indents.toml19
-rw-r--r--runtime/queries/go/indents.scm26
-rw-r--r--runtime/queries/go/indents.toml30
-rw-r--r--runtime/queries/hcl/indents.scm13
-rw-r--r--runtime/queries/hcl/indents.toml13
-rw-r--r--runtime/queries/javascript/indents.scm22
-rw-r--r--runtime/queries/javascript/indents.toml28
-rw-r--r--runtime/queries/json/indents.scm9
-rw-r--r--runtime/queries/json/indents.toml9
-rw-r--r--runtime/queries/llvm-mir-yaml/indents.scm2
-rw-r--r--runtime/queries/llvm-mir-yaml/indents.toml3
-rw-r--r--runtime/queries/llvm-mir/indents.scm3
-rw-r--r--runtime/queries/llvm-mir/indents.toml7
-rw-r--r--runtime/queries/llvm/indents.scm6
-rw-r--r--runtime/queries/llvm/indents.toml8
-rw-r--r--runtime/queries/lua/indents.scm24
-rw-r--r--runtime/queries/lua/indents.toml24
-rw-r--r--runtime/queries/nix/indents.scm18
-rw-r--r--runtime/queries/nix/indents.toml18
-rw-r--r--runtime/queries/ocaml/indents.scm12
-rw-r--r--runtime/queries/ocaml/indents.toml13
-rw-r--r--runtime/queries/perl/indents.scm15
-rw-r--r--runtime/queries/perl/indents.toml17
-rw-r--r--runtime/queries/php/indents.scm17
-rw-r--r--runtime/queries/php/indents.toml17
-rw-r--r--runtime/queries/protobuf/indents.scm11
-rw-r--r--runtime/queries/protobuf/indents.toml12
-rw-r--r--runtime/queries/python/indents.scm38
-rw-r--r--runtime/queries/python/indents.toml39
-rw-r--r--runtime/queries/ruby/indents.scm25
-rw-r--r--runtime/queries/ruby/indents.toml25
-rw-r--r--runtime/queries/rust/indents.scm80
-rw-r--r--runtime/queries/rust/indents.toml28
-rw-r--r--runtime/queries/scala/indents.scm22
-rw-r--r--runtime/queries/scala/indents.toml23
-rw-r--r--runtime/queries/svelte/indents.scm17
-rw-r--r--runtime/queries/svelte/indents.toml18
-rw-r--r--runtime/queries/tablegen/indents.scm3
-rw-r--r--runtime/queries/tablegen/indents.toml7
-rw-r--r--runtime/queries/typescript/indents.scm7
l---------runtime/queries/typescript/indents.toml1
-rw-r--r--runtime/queries/yaml/indents.scm2
-rw-r--r--runtime/queries/yaml/indents.toml3
-rw-r--r--runtime/queries/zig/indents.scm16
-rw-r--r--runtime/queries/zig/indents.toml16
56 files changed, 485 insertions, 455 deletions
diff --git a/runtime/queries/c/indents.scm b/runtime/queries/c/indents.scm
new file mode 100644
index 00000000..353ea81b
--- /dev/null
+++ b/runtime/queries/c/indents.scm
@@ -0,0 +1,33 @@
+[
+ (compound_statement)
+ (field_declaration_list)
+ (enumerator_list)
+ (parameter_list)
+ (init_declarator)
+ (case_statement)
+ (expression_statement)
+] @indent
+
+[
+ "case"
+ "}"
+ "]"
+] @outdent
+
+(if_statement
+ consequence: (_) @indent
+ (#not-kind-eq? @indent "compound_statement")
+ (#set! "scope" "all"))
+(while_statement
+ body: (_) @indent
+ (#not-kind-eq? @indent "compound_statement")
+ (#set! "scope" "all"))
+(do_statement
+ body: (_) @indent
+ (#not-kind-eq? @indent "compound_statement")
+ (#set! "scope" "all"))
+(for_statement
+ ")"
+ (_) @indent
+ (#not-kind-eq? @indent "compound_statement")
+ (#set! "scope" "all"))
diff --git a/runtime/queries/c/indents.toml b/runtime/queries/c/indents.toml
deleted file mode 100644
index f4076e17..00000000
--- a/runtime/queries/c/indents.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-indent = [
- "compound_statement",
- "field_declaration_list",
- "enumerator_list",
- "parameter_list",
- "init_declarator",
- "case_statement",
- "condition_clause",
- "expression_statement",
-]
-
-outdent = [
- "case",
- "}",
- "]",
-]
diff --git a/runtime/queries/cmake/indents.scm b/runtime/queries/cmake/indents.scm
new file mode 100644
index 00000000..199b1031
--- /dev/null
+++ b/runtime/queries/cmake/indents.scm
@@ -0,0 +1,10 @@
+[
+ (if_condition)
+ (foreach_loop)
+ (while_loop)
+ (function_def)
+ (macro_def)
+ (normal_command)
+] @indent
+
+")" @outdent
diff --git a/runtime/queries/cmake/indents.toml b/runtime/queries/cmake/indents.toml
deleted file mode 100644
index 8b886a4f..00000000
--- a/runtime/queries/cmake/indents.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-indent = [
- "if_condition",
- "foreach_loop",
- "while_loop",
- "function_def",
- "macro_def",
- "normal_command",
-]
-
-outdent = [
- ")"
-]
diff --git a/runtime/queries/cpp/indents.scm b/runtime/queries/cpp/indents.scm
new file mode 100644
index 00000000..36876f94
--- /dev/null
+++ b/runtime/queries/cpp/indents.scm
@@ -0,0 +1,3 @@
+; inherits: c
+
+(access_specifier) @outdent
diff --git a/runtime/queries/cpp/indents.toml b/runtime/queries/cpp/indents.toml
deleted file mode 100644
index 0ca2ed8b..00000000
--- a/runtime/queries/cpp/indents.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-indent = [
- "compound_statement",
- "field_declaration_list",
- "enumerator_list",
- "parameter_list",
- "init_declarator",
- "case_statement",
- "condition_clause",
- "expression_statement",
-]
-
-outdent = [
- "case",
- "access_specifier",
- "}",
- "]",
-]
diff --git a/runtime/queries/dart/indents.scm b/runtime/queries/dart/indents.scm
new file mode 100644
index 00000000..14c6a375
--- /dev/null
+++ b/runtime/queries/dart/indents.scm
@@ -0,0 +1,20 @@
+[
+ (class_body)
+ (function_body)
+ (function_expression_body)
+ (declaration)
+ (initializers)
+ (switch_block)
+ (if_statement)
+ (formal_parameter_list)
+ (formal_parameter)
+ (list_literal)
+ (return_statement)
+ (arguments)
+] @indent
+
+[
+ "}"
+ "]"
+ ")"
+] @outdent
diff --git a/runtime/queries/dart/indents.toml b/runtime/queries/dart/indents.toml
deleted file mode 100644
index 5c11e05d..00000000
--- a/runtime/queries/dart/indents.toml
+++ /dev/null
@@ -1,20 +0,0 @@
-indent = [
- "class_body",
- "function_body",
- "function_expression_body",
- "declaration",
- "initializers",
- "switch_block",
- "if_statement",
- "formal_parameter_list",
- "formal_parameter",
- "list_literal",
- "return_statement",
- "arguments"
-]
-
-outdent = [
- "}",
- "]",
- ")"
-]
diff --git a/runtime/queries/fish/indents.scm b/runtime/queries/fish/indents.scm
new file mode 100644
index 00000000..ba7c65ea
--- /dev/null
+++ b/runtime/queries/fish/indents.scm
@@ -0,0 +1,12 @@
+[
+ (function_definition)
+ (while_statement)
+ (for_statement)
+ (if_statement)
+ (begin_statement)
+ (switch_statement)
+] @indent
+
+[
+ "end"
+] @outdent
diff --git a/runtime/queries/fish/indents.toml b/runtime/queries/fish/indents.toml
deleted file mode 100644
index 6f1e563a..00000000
--- a/runtime/queries/fish/indents.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-indent = [
- "function_definition",
- "while_statement",
- "for_statement",
- "if_statement",
- "begin_statement",
- "switch_statement",
-]
-
-outdent = [
- "end"
-]
diff --git a/runtime/queries/glsl/indents.scm b/runtime/queries/glsl/indents.scm
new file mode 100644
index 00000000..a8b55a42
--- /dev/null
+++ b/runtime/queries/glsl/indents.scm
@@ -0,0 +1,19 @@
+[
+ (init_declarator)
+ (compound_statement)
+ (preproc_arg)
+ (field_declaration_list)
+ (case_statement)
+ (conditional_expression)
+ (enumerator_list)
+ (struct_specifier)
+ (compound_literal_expression)
+] @indent
+
+[
+ "#define"
+ "#ifdef"
+ "#endif"
+ "{"
+ "}"
+] @outdent
diff --git a/runtime/queries/glsl/indents.toml b/runtime/queries/glsl/indents.toml
deleted file mode 100644
index a7fd499a..00000000
--- a/runtime/queries/glsl/indents.toml
+++ /dev/null
@@ -1,19 +0,0 @@
-indent = [
- "init_declarator",
- "compound_statement",
- "preproc_arg",
- "field_declaration_list",
- "case_statement",
- "conditional_expression",
- "enumerator_list",
- "struct_specifier",
- "compound_literal_expression"
-]
-
-outdent = [
- "#define",
- "#ifdef",
- "#endif",
- "{",
- "}"
-]
diff --git a/runtime/queries/go/indents.scm b/runtime/queries/go/indents.scm
new file mode 100644
index 00000000..d75417d9
--- /dev/null
+++ b/runtime/queries/go/indents.scm
@@ -0,0 +1,26 @@
+[
+ (import_declaration)
+ (const_declaration)
+ (type_declaration)
+ (type_spec)
+ (func_literal)
+ (literal_value)
+ (element)
+ (keyed_element)
+ (expression_case)
+ (default_case)
+ (type_case)
+ (communication_case)
+ (argument_list)
+ (field_declaration_list)
+ (block)
+ (type_switch_statement)
+ (expression_switch_statement)
+] @indent
+
+[
+ "case"
+ "}"
+ "]"
+ ")"
+] @outdent
diff --git a/runtime/queries/go/indents.toml b/runtime/queries/go/indents.toml
deleted file mode 100644
index 7929ff50..00000000
--- a/runtime/queries/go/indents.toml
+++ /dev/null
@@ -1,30 +0,0 @@
-indent = [
- "import_declaration",
- "const_declaration",
- #"var_declaration",
- #"short_var_declaration",
- "type_declaration",
- "type_spec",
- # simply block should be enough
- # "function_declaration",
- # "method_declaration",
- # "composite_literal",
- "func_literal",
- "literal_value",
- "element",
- "keyed_element",
- "expression_case",
- "default_case",
- "type_case",
- "communication_case",
- "argument_list",
- "field_declaration_list",
- "block",
-]
-
-outdent = [
- "case",
- "}",
- "]",
- ")"
-]
diff --git a/runtime/queries/hcl/indents.scm b/runtime/queries/hcl/indents.scm
new file mode 100644
index 00000000..3625641b
--- /dev/null
+++ b/runtime/queries/hcl/indents.scm
@@ -0,0 +1,13 @@
+[
+ (object)
+ (block)
+ (tuple)
+ (for_tuple_expr)
+ (for_object_expr)
+] @indent
+
+[
+ (object_end)
+ (block_end)
+ (tuple_end)
+] @outdent
diff --git a/runtime/queries/hcl/indents.toml b/runtime/queries/hcl/indents.toml
deleted file mode 100644
index b0d4a3f0..00000000
--- a/runtime/queries/hcl/indents.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-indent = [
- "object",
- "block",
- "tuple",
- "for_tuple_expr",
- "for_object_expr"
-]
-
-outdent = [
- "object_end",
- "block_end",
- "tuple_end"
-]
diff --git a/runtime/queries/javascript/indents.scm b/runtime/queries/javascript/indents.scm
new file mode 100644
index 00000000..a4237e59
--- /dev/null
+++ b/runtime/queries/javascript/indents.scm
@@ -0,0 +1,22 @@
+[
+ (array)
+ (object)
+ (arguments)
+ (formal_parameters)
+
+ (statement_block)
+ (object_pattern)
+ (class_body)
+ (named_imports)
+
+ (binary_expression)
+ (return_statement)
+ (template_substitution)
+ (export_clause)
+] @indent
+
+[
+ "}"
+ "]"
+ ")"
+] @outdent
diff --git a/runtime/queries/javascript/indents.toml b/runtime/queries/javascript/indents.toml
deleted file mode 100644
index 9d711ab2..00000000
--- a/runtime/queries/javascript/indents.toml
+++ /dev/null
@@ -1,28 +0,0 @@
-indent = [
- "array",
- "object",
- "arguments",
- "formal_parameters",
-
- "statement_block",
- "object_pattern",
- "class_body",
- "named_imports",
-
- "binary_expression",
- "return_statement",
- "template_substitution",
- # (expression_statement (call_expression))
- "export_clause",
-
- # typescript
- "enum_declaration",
- "interface_declaration",
- "object_type",
-]
-
-outdent = [
- "}",
- "]",
- ")"
-]
diff --git a/runtime/queries/json/indents.scm b/runtime/queries/json/indents.scm
new file mode 100644
index 00000000..f756e609
--- /dev/null
+++ b/runtime/queries/json/indents.scm
@@ -0,0 +1,9 @@
+[
+ (object)
+ (array)
+] @indent
+
+[
+ "]"
+ "}"
+] @outdent
diff --git a/runtime/queries/json/indents.toml b/runtime/queries/json/indents.toml
deleted file mode 100644
index 64a8d175..00000000
--- a/runtime/queries/json/indents.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-indent = [
- "object",
- "array"
-]
-
-outdent = [
- "]",
- "}"
-]
diff --git a/runtime/queries/llvm-mir-yaml/indents.scm b/runtime/queries/llvm-mir-yaml/indents.scm
new file mode 100644
index 00000000..70a00b69
--- /dev/null
+++ b/runtime/queries/llvm-mir-yaml/indents.scm
@@ -0,0 +1,2 @@
+(block_mapping_pair) @indent
+
diff --git a/runtime/queries/llvm-mir-yaml/indents.toml b/runtime/queries/llvm-mir-yaml/indents.toml
deleted file mode 100644
index ddc3578b..00000000
--- a/runtime/queries/llvm-mir-yaml/indents.toml
+++ /dev/null
@@ -1,3 +0,0 @@
-indent = [
- "block_mapping_pair",
-]
diff --git a/runtime/queries/llvm-mir/indents.scm b/runtime/queries/llvm-mir/indents.scm
new file mode 100644
index 00000000..12c86268
--- /dev/null
+++ b/runtime/queries/llvm-mir/indents.scm
@@ -0,0 +1,3 @@
+(basic_block) @indent
+
+(label) @outdent
diff --git a/runtime/queries/llvm-mir/indents.toml b/runtime/queries/llvm-mir/indents.toml
deleted file mode 100644
index 6a70e5ad..00000000
--- a/runtime/queries/llvm-mir/indents.toml
+++ /dev/null
@@ -1,7 +0,0 @@
-indent = [
- "basic_block",
-]
-
-outdent = [
- "label",
-]
diff --git a/runtime/queries/llvm/indents.scm b/runtime/queries/llvm/indents.scm
new file mode 100644
index 00000000..293eeebf
--- /dev/null
+++ b/runtime/queries/llvm/indents.scm
@@ -0,0 +1,6 @@
+[
+ (function_body)
+ (instruction)
+] @indent
+
+"}" @outdent
diff --git a/runtime/queries/llvm/indents.toml b/runtime/queries/llvm/indents.toml
deleted file mode 100644
index 8cd603c8..00000000
--- a/runtime/queries/llvm/indents.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-indent = [
- "function_body",
- "instruction",
-]
-
-outdent = [
- "}",
-]
diff --git a/runtime/queries/lua/indents.scm b/runtime/queries/lua/indents.scm
new file mode 100644
index 00000000..55a812c5
--- /dev/null
+++ b/runtime/queries/lua/indents.scm
@@ -0,0 +1,24 @@
+[
+ (function_definition)
+ (variable_declaration)
+ (local_variable_declaration)
+ (field)
+ (local_function)
+ (function)
+ (if_statement)
+ (for_statement)
+ (for_in_statement)
+ (repeat_statement)
+ (return_statement)
+ (while_statement)
+ (table)
+ (arguments)
+ (do_statement)
+] @indent
+
+[
+ "end"
+ "until"
+ "}"
+ ")"
+] @outdent
diff --git a/runtime/queries/lua/indents.toml b/runtime/queries/lua/indents.toml
deleted file mode 100644
index df1a9752..00000000
--- a/runtime/queries/lua/indents.toml
+++ /dev/null
@@ -1,24 +0,0 @@
-indent = [
- "function_definition",
- "variable_declaration",
- "local_variable_declaration",
- "field",
- "local_function",
- "function",
- "if_statement",
- "for_statement",
- "for_in_statement",
- "repeat_statement",
- "return_statement",
- "while_statement",
- "table",
- "arguments",
- "do_statement",
-]
-
-oudent = [
- "end",
- "until",
- "}",
- ")",
-]
diff --git a/runtime/queries/nix/indents.scm b/runtime/queries/nix/indents.scm
new file mode 100644
index 00000000..0790ce29
--- /dev/null
+++ b/runtime/queries/nix/indents.scm
@@ -0,0 +1,18 @@
+[
+ ; "function",
+ (bind)
+ (assert)
+ (with)
+ (let)
+ (if)
+
+ (attrset)
+ (list)
+ (indented_string)
+ (parenthesized)
+] @indent
+
+[
+ "}"
+ "]"
+] @outdent
diff --git a/runtime/queries/nix/indents.toml b/runtime/queries/nix/indents.toml
deleted file mode 100644
index b92ab752..00000000
--- a/runtime/queries/nix/indents.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-indent = [
- # "function",
- "bind",
- "assert",
- "with",
- "let",
- "if",
-
- "attrset",
- "list",
- "indented_string",
- "parenthesized",
-]
-
-outdent = [
- "}",
- "]",
-]
diff --git a/runtime/queries/ocaml/indents.scm b/runtime/queries/ocaml/indents.scm
new file mode 100644
index 00000000..dc4d591a
--- /dev/null
+++ b/runtime/queries/ocaml/indents.scm
@@ -0,0 +1,12 @@
+[
+ (let_binding)
+ (type_binding)
+ (structure)
+ (signature)
+ (record_declaration)
+ (function_expression)
+ (match_case)
+] @indent
+
+"}" @outdent
+
diff --git a/runtime/queries/ocaml/indents.toml b/runtime/queries/ocaml/indents.toml
deleted file mode 100644
index 7586b83a..00000000
--- a/runtime/queries/ocaml/indents.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-indent = [
- "let_binding",
- "type_binding",
- "structure",
- "signature",
- "record_declaration",
- "function_expression",
- "match_case",
-]
-
-outdent = [
- "}",
-]
diff --git a/runtime/queries/perl/indents.scm b/runtime/queries/perl/indents.scm
new file mode 100644
index 00000000..5ae34f5e
--- /dev/null
+++ b/runtime/queries/perl/indents.scm
@@ -0,0 +1,15 @@
+[
+ (function)
+ (identifier)
+ (method_invocation)
+ (if_statement)
+ (unless_statement)
+ (if_simple_statement)
+ (unless_simple_statement)
+ (variable_declaration)
+ (block)
+ (list_item)
+ (word_list_qw)
+] @indent
+
+"}" @outdent
diff --git a/runtime/queries/perl/indents.toml b/runtime/queries/perl/indents.toml
deleted file mode 100644
index 365e0663..00000000
--- a/runtime/queries/perl/indents.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-indent = [
- "function",
- "identifier",
- "method_invocation",
- "if_statement",
- "unless_statement",
- "if_simple_statement",
- "unless_simple_statement",
- "variable_declaration",
- "block",
- "list_item",
- "word_list_qw"
-]
-
-outdent = [
- "}"
-]
diff --git a/runtime/queries/php/indents.scm b/runtime/queries/php/indents.scm
new file mode 100644
index 00000000..b22393ed
--- /dev/null
+++ b/runtime/queries/php/indents.scm
@@ -0,0 +1,17 @@
+[
+ (array_creation_expression)
+ (arguments)
+ (formal_parameters)
+ (compound_statement)
+ (declaration_list)
+ (binary_expression)
+ (return_statement)
+ (expression_statement)
+ (switch_block)
+ (anonymous_function_use_clause)
+] @indent
+
+[
+ "}"
+ ")"
+] @outdent
diff --git a/runtime/queries/php/indents.toml b/runtime/queries/php/indents.toml
deleted file mode 100644
index 85c104db..00000000
--- a/runtime/queries/php/indents.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-indent = [
- "array_creation_expression",
- "arguments",
- "formal_parameters",
- "compound_statement",
- "declaration_list",
- "binary_expression",
- "return_statement",
- "expression_statement",
- "switch_block",
- "anonymous_function_use_clause",
-]
-
-oudent = [
- "}",
- ")",
-]
diff --git a/runtime/queries/protobuf/indents.scm b/runtime/queries/protobuf/indents.scm
new file mode 100644
index 00000000..d457d75f
--- /dev/null
+++ b/runtime/queries/protobuf/indents.scm
@@ -0,0 +1,11 @@
+[
+ (messageBody)
+ (enumBody)
+ (oneofBody)
+ (serviceBody)
+ (rpcBody)
+ (msgLit)
+] @indent
+
+"}" @outdent
+
diff --git a/runtime/queries/protobuf/indents.toml b/runtime/queries/protobuf/indents.toml
deleted file mode 100644
index e655f8db..00000000
--- a/runtime/queries/protobuf/indents.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-indent = [
- "messageBody",
- "enumBody",
- "oneofBody",
- "serviceBody",
- "rpcBody",
- "msgLit",
-]
-
-outdent = [
- "}",
-]
diff --git a/runtime/queries/python/indents.scm b/runtime/queries/python/indents.scm
new file mode 100644
index 00000000..810ff52f
--- /dev/null
+++ b/runtime/queries/python/indents.scm
@@ -0,0 +1,38 @@
+[
+ (list)
+ (tuple)
+ (dictionary)
+ (set)
+
+ (if_statement)
+ (for_statement)
+ (while_statement)
+ (with_statement)
+ (try_statement)
+ (import_from_statement)
+
+ (parenthesized_expression)
+ (generator_expression)
+ (list_comprehension)
+ (set_comprehension)
+ (dictionary_comprehension)
+
+ (tuple_pattern)
+ (list_pattern)
+ (argument_list)
+ (parameters)
+ (binary_operator)
+
+ (function_definition)
+ (class_definition)
+] @indent
+
+[
+ ")"
+ "]"
+ "}"
+ (return_statement)
+ (pass_statement)
+ (raise_statement)
+] @outdent
+
diff --git a/runtime/queries/python/indents.toml b/runtime/queries/python/indents.toml
deleted file mode 100644
index 6bc68486..00000000
--- a/runtime/queries/python/indents.toml
+++ /dev/null
@@ -1,39 +0,0 @@
-indent = [
- "list",
- "tuple",
- "dictionary",
- "set",
-
- "if_statement",
- "for_statement",
- "while_statement",
- "with_statement",
- "try_statement",
- "import_from_statement",
-
- "parenthesized_expression",
- "generator_expression",
- "list_comprehension",
- "set_comprehension",
- "dictionary_comprehension",
-
- "tuple_pattern",
- "list_pattern",
- "argument_list",
- "parameters",
- "binary_operator",
-
- "function_definition",
- "class_definition",
-]
-
-outdent = [
- ")",
- "]",
- "}",
- "return_statement",
- "pass_statement",
- "raise_statement",
-]
-
-ignore = ["string"]
diff --git a/runtime/queries/ruby/indents.scm b/runtime/queries/ruby/indents.scm
new file mode 100644
index 00000000..f5a6d19b
--- /dev/null
+++ b/runtime/queries/ruby/indents.scm
@@ -0,0 +1,25 @@
+[
+ (argument_list)
+ (array)
+ (begin)
+ (block)
+ (call)
+ (class)
+ (case)
+ (do_block)
+ (elsif)
+ (if)
+ (hash)
+ (method)
+ (module)
+ (singleton_class)
+ (singleton_method)
+] @indent
+
+[
+ ")"
+ "}"
+ "]"
+ "end"
+ "when"
+] @outdent
diff --git a/runtime/queries/ruby/indents.toml b/runtime/queries/ruby/indents.toml
deleted file mode 100644
index b417751f..00000000
--- a/runtime/queries/ruby/indents.toml
+++ /dev/null
@@ -1,25 +0,0 @@
-indent = [
- "argument_list",
- "array",
- "begin",
- "block",
- "call",
- "class",
- "case",
- "do_block",
- "elsif",
- "if",
- "hash",
- "method",
- "module",
- "singleton_class",
- "singleton_method",
-]
-
-outdent = [
- ")",
- "}",
- "]",
- "end",
- "when",
-]
diff --git a/runtime/queries/rust/indents.scm b/runtime/queries/rust/indents.scm
new file mode 100644
index 00000000..600c77a3
--- /dev/null
+++ b/runtime/queries/rust/indents.scm
@@ -0,0 +1,80 @@
+[
+ (use_list)
+ (block)
+ (match_block)
+ (arguments)
+ (parameters)
+ (declaration_list)
+ (field_declaration_list)
+ (field_initializer_list)
+ (struct_pattern)
+ (tuple_pattern)
+ (unit_expression)
+ (enum_variant_list)
+ (call_expression)
+ (binary_expression)
+ (field_expression)
+ (tuple_expression)
+ (array_expression)
+ (where_clause)
+
+ (token_tree)
+ (macro_definition)
+ (token_tree_pattern)
+ (token_repetition)
+] @indent
+
+[
+ "}"
+ "]"
+ ")"
+] @outdent
+
+; Indent the right side of assignments.
+; The #not-same-line? predicate is required to prevent an extra indent for e.g.
+; an else-clause where the previous if-clause starts on the same line as the assignment.
+(assignment_expression
+ .
+ (_) @expr-start
+ right: (_) @indent
+ (#not-same-line? @indent @expr-start)
+ (#set! "scope" "all")
+)
+(compound_assignment_expr
+ .
+ (_) @expr-start
+ right: (_) @indent
+ (#not-same-line? @indent @expr-start)
+ (#set! "scope" "all")
+)
+(let_declaration
+ .
+ (_) @expr-start
+ value: (_) @indent
+ (#not-same-line? @indent @expr-start)
+ (#set! "scope" "all")
+)
+(if_let_expression
+ .
+ (_) @expr-start
+ value: (_) @indent
+ (#not-same-line? @indent @expr-start)
+ (#set! "scope" "all")
+)
+(static_item
+ .
+ (_) @expr-start
+ value: (_) @indent
+ (#not-same-line? @indent @expr-start)
+ (#set! "scope" "all")
+)
+
+; Some field expressions where the left part is a multiline expression are not
+; indented by cargo fmt.
+; Because this multiline expression might be nested in an arbitrary number of
+; field expressions, this can only be matched using a Regex.
+(field_expression
+ value: (_) @val
+ "." @outdent
+ (#match? @val "(\\A[^\\n\\r]+\\([\\t ]*(\\n|\\r).*)|(\\A[^\\n\\r]*\\{[\\t ]*(\\n|\\r))")
+)
diff --git a/runtime/queries/rust/indents.toml b/runtime/queries/rust/indents.toml
deleted file mode 100644
index 51a0ceea..00000000
--- a/runtime/queries/rust/indents.toml
+++ /dev/null
@@ -1,28 +0,0 @@
-indent = [
- "use_list",
- "block",
- "match_block",
- "arguments",
- "parameters",
- "declaration_list",
- "field_declaration_list",
- "field_initializer_list",
- "struct_pattern",
- "tuple_pattern",
- "unit_expression",
- "enum_variant_list",
- "call_expression",
- "binary_expression",
- "field_expression",
- "tuple_expression",
- "array_expression",
- "where_clause",
- "macro_invocation"
-]
-
-outdent = [
- "where",
- "}",
- "]",
- ")"
-]
diff --git a/runtime/queries/scala/indents.scm b/runtime/queries/scala/indents.scm
new file mode 100644
index 00000000..3449cfa7
--- /dev/null
+++ b/runtime/queries/scala/indents.scm
@@ -0,0 +1,22 @@
+[
+ (block)
+ (arguments)
+ (parameter)
+ (class_definition)
+ (trait_definition)
+ (object_definition)
+ (function_definition)
+ (val_definition)
+ (import_declaration)
+ (while_expression)
+ (do_while_expression)
+ (for_expression)
+ (try_expression)
+ (match_expression)
+] @indent
+
+[
+ "}"
+ "]"
+ ")"
+] @outdent
diff --git a/runtime/queries/scala/indents.toml b/runtime/queries/scala/indents.toml
deleted file mode 100644
index 6de54844..00000000
--- a/runtime/queries/scala/indents.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-indent = [
- "block",
- "arguments",
- "parameter",
- "class_definition",
- "trait_definition",
- "object_definition",
- "function_definition",
- "val_definition",
- "import_declaration",
- "while_expression",
- "do_while_expression",
- "for_expression",
- "try_expression",
- "match_expression"
-]
-
-outdent = [
- "}",
- "]",
- ")"
-]
diff --git a/runtime/queries/svelte/indents.scm b/runtime/queries/svelte/indents.scm
new file mode 100644
index 00000000..02aaaa58
--- /dev/null
+++ b/runtime/queries/svelte/indents.scm
@@ -0,0 +1,17 @@
+[
+ (element)
+ (if_statement)
+ (each_statement)
+ (await_statement)
+] @indent
+
+[
+ (end_tag)
+ (else_statement)
+ (if_end_expr)
+ (each_end_expr)
+ (await_end_expr)
+ ">"
+ "/>"
+] @outdent
+
diff --git a/runtime/queries/svelte/indents.toml b/runtime/queries/svelte/indents.toml
deleted file mode 100644
index 693db8e3..00000000
--- a/runtime/queries/svelte/indents.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-indent = [
- "element"
- "if_statement"
- "each_statement"
- "await_statement"
-]
-
-outdent = [
- "end_tag"
- "else_statement"
- "if_end_expr"
- "each_end_expr"
- "await_end_expr"
- ">"
- "/>"
-]
-
-ignore = "comment"
diff --git a/runtime/queries/tablegen/indents.scm b/runtime/queries/tablegen/indents.scm
new file mode 100644
index 00000000..1c15d7db
--- /dev/null
+++ b/runtime/queries/tablegen/indents.scm
@@ -0,0 +1,3 @@
+(statement) @indent
+
+"}" @outdent
diff --git a/runtime/queries/tablegen/indents.toml b/runtime/queries/tablegen/indents.toml
deleted file mode 100644
index 43532f4d..00000000
--- a/runtime/queries/tablegen/indents.toml
+++ /dev/null
@@ -1,7 +0,0 @@
-indent = [
- "statement",
-]
-
-outdent = [
- "}",
-]
diff --git a/runtime/queries/typescript/indents.scm b/runtime/queries/typescript/indents.scm
new file mode 100644
index 00000000..055e170b
--- /dev/null
+++ b/runtime/queries/typescript/indents.scm
@@ -0,0 +1,7 @@
+; inherits: javascript
+
+[
+ (enum_declaration)
+ (interface_declaration)
+ (object_type)
+] @indent
diff --git a/runtime/queries/typescript/indents.toml b/runtime/queries/typescript/indents.toml
deleted file mode 120000
index 3a17f258..00000000
--- a/runtime/queries/typescript/indents.toml
+++ /dev/null
@@ -1 +0,0 @@
-../javascript/indents.toml \ No newline at end of file
diff --git a/runtime/queries/yaml/indents.scm b/runtime/queries/yaml/indents.scm
new file mode 100644
index 00000000..70a00b69
--- /dev/null
+++ b/runtime/queries/yaml/indents.scm
@@ -0,0 +1,2 @@
+(block_mapping_pair) @indent
+
diff --git a/runtime/queries/yaml/indents.toml b/runtime/queries/yaml/indents.toml
deleted file mode 100644
index ddc3578b..00000000
--- a/runtime/queries/yaml/indents.toml
+++ /dev/null
@@ -1,3 +0,0 @@
-indent = [
- "block_mapping_pair",
-]
diff --git a/runtime/queries/zig/indents.scm b/runtime/queries/zig/indents.scm
new file mode 100644
index 00000000..af25a9c3
--- /dev/null
+++ b/runtime/queries/zig/indents.scm
@@ -0,0 +1,16 @@
+[
+ (Block)
+ (BlockExpr)
+ (ContainerDecl)
+ (SwitchExpr)
+ (AssignExpr)
+ (ErrorUnionExpr)
+ (Statement)
+ (InitList)
+] @indent
+
+[
+ "}"
+ "]"
+ ")"
+] @outdent
diff --git a/runtime/queries/zig/indents.toml b/runtime/queries/zig/indents.toml
deleted file mode 100644
index 36ba8e55..00000000
--- a/runtime/queries/zig/indents.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-indent = [
- "Block",
- "BlockExpr",
- "ContainerDecl",
- "SwitchExpr",
- "AssignExpr",
- "ErrorUnionExpr",
- "Statement",
- "InitList"
-]
-
-outdent = [
- "}",
- "]",
- ")"
-]