summaryrefslogtreecommitdiff
path: root/runtime/queries/rust
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-14 10:21:46 +0000
committerBlaž Hrastnik2021-05-14 10:21:46 +0000
commit4a9d1163e04ba0fc29f8532afd35381b7df55e48 (patch)
tree7b8413c60c267d0a06ddbfa18e1d367b4b6d2309 /runtime/queries/rust
parent726072085d019b1ce9e3cdf4e1557a1148723482 (diff)
Hacky way to specify indent scopes per language via toml configs.
Can't do it via a scm query nicely because it returns an iterator over all the matches, whereas we want to traverse the tree ourselves. Can't extract the pattern data from a parsed query either. Oh well, toml files for now.
Diffstat (limited to 'runtime/queries/rust')
-rw-r--r--runtime/queries/rust/indents.toml30
1 files changed, 30 insertions, 0 deletions
diff --git a/runtime/queries/rust/indents.toml b/runtime/queries/rust/indents.toml
new file mode 100644
index 00000000..49c2c15e
--- /dev/null
+++ b/runtime/queries/rust/indents.toml
@@ -0,0 +1,30 @@
+indent = [
+ "while_expression",
+ "for_expression",
+ "loop_expression",
+ "if_expression",
+ "if_let_expression",
+ "tuple_expression",
+ "array_expression",
+ "use_list",
+ "block",
+ "match_block",
+ "arguments",
+ "parameters",
+ "declaration_list",
+ "field_declaration_list",
+ "field_initializer_list",
+ "struct_pattern",
+ "tuple_pattern",
+ "enum_variant_list",
+ "binary_expression",
+ "field_expression",
+ "where_clause"
+]
+
+outdent = [
+ "where",
+ "}",
+ "]",
+ ")"
+]