feat: added more indent queries

This commit is contained in:
elianiva
2021-01-05 19:26:08 +07:00
committed by Thomas Vigouroux
parent 72656dcf3c
commit 9184cf3953
15 changed files with 188 additions and 0 deletions

16
queries/c/indents.scm Normal file
View File

@@ -0,0 +1,16 @@
[
(init_declarator)
(compound_statement)
(preproc_arg)
(field_declaration_list)
(case_statement)
] @indent
[
"#define"
"#ifdef"
"#endif"
"{"
"}"
] @branch

16
queries/cpp/indents.scm Normal file
View File

@@ -0,0 +1,16 @@
[
(enumerator_list)
(struct_specifier)
(compound_statement)
(case_statement)
(condition_clause)
(conditional_expression)
] @indent
[
(statement_identifier)
"#ifdef"
"#endif"
"{"
"}"
] @branch

17
queries/go/indents.scm Normal file
View File

@@ -0,0 +1,17 @@
[
(import_declaration)
(function_declaration)
(const_declaration)
(var_declaration)
(type_declaration)
(composite_literal)
(func_literal)
(block)
] @indent
[
"("
")"
"{"
"}"
] @branch

View File

@@ -0,0 +1,9 @@
[
(definition)
(selection)
] @indent
[
"{"
"}"
] @branch

9
queries/html/indents.scm Normal file
View File

@@ -0,0 +1,9 @@
[
(element)
] @indent
[
(end_tag)
">"
"/>"
] @branch

View File

@@ -0,0 +1,26 @@
; inherits: (jsx)
[
(object)
(array)
(arguments)
(statement_block)
(object_pattern)
(class_body)
(method_definition)
(named_imports)
(binary_expression)
(return_statement)
(template_substitution)
(expression_statement (call_expression))
(export_clause)
] @indent
[
"("
")"
"{"
"}"
"["
"]"
] @branch

9
queries/json/indents.scm Normal file
View File

@@ -0,0 +1,9 @@
[
(object)
(array)
] @indent
[
"}"
"]"
] @branch

10
queries/jsx/indents.scm Normal file
View File

@@ -0,0 +1,10 @@
[
(jsx_fragment)
(jsx_element)
(jsx_self_closing_element)
] @indent
[
(jsx_closing_element)
">"
] @branch

12
queries/ruby/indents.scm Normal file
View File

@@ -0,0 +1,12 @@
[
(class)
(method)
(module)
(call)
(if)
] @indent
[
(elsif)
"end"
] @branch

26
queries/rust/indents.scm Normal file
View File

@@ -0,0 +1,26 @@
[
(mod_item)
(struct_item)
(enum_item)
(impl_item)
(for_expression)
(struct_expression)
(match_expression)
(match_arm)
(if_let_expression)
(call_expression)
(assignment_expression)
(arguments)
(block)
(where_clause)
] @indent
[
"where"
"("
")"
"["
"]"
"{"
"}"
] @branch

20
queries/teal/indents.scm Normal file
View File

@@ -0,0 +1,20 @@
[
(record_declaration)
(record_entry)
(anon_function)
(function_body)
(table_constructor)
(if_statement)
(for_statement)
(return_statement)
(while_statement)
] @indent
[
"{"
"}"
"("
")"
"end"
"then"
] @branch

8
queries/toml/indents.scm Normal file
View File

@@ -0,0 +1,8 @@
[
(array)
(table_array_element)
] @indent
[
"]"
] @branch

1
queries/tsx/indents.scm Normal file
View File

@@ -0,0 +1 @@
; inherits: typescript,jsx

View File

@@ -0,0 +1,6 @@
; inherits: javascript
[
(interface_declaration)
(object_type)
] @indent

3
queries/yaml/indents.scm Normal file
View File

@@ -0,0 +1,3 @@
[
(block_mapping_pair)
] @indent