From 1281601cb40b71a47c5b30866bd4968fd0d20fb3 Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Sun, 4 Jun 2023 13:28:41 +0900 Subject: feat: add indents for annotation defs (#4828) - Add indent for `@interface` and `@Annotation(...)` - Add notes for indent queries --- queries/java/indents.scm | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'queries/java') diff --git a/queries/java/indents.scm b/queries/java/indents.scm index 017646e5b..73fb386e3 100644 --- a/queries/java/indents.scm +++ b/queries/java/indents.scm @@ -1,13 +1,17 @@ [ - (class_body) - (enum_body) - (interface_body) - (constructor_body) - (block) - (switch_block) - (array_initializer) - (argument_list) - (formal_parameters) + ; ... refers to the portion that this indent query will have effects on + (class_body) ; { ... } of `class X` + (enum_body) ; { ... } of `enum X` + (interface_body) ; { ... } of `interface X` + (constructor_body) ; { `modifier` X() {...} } inside `class X` + (annotation_type_body) ; { ... } of `@interface X` + (block) ; { ... } that's not mentioned in this scope + (switch_block) ; { ... } in `switch X` + (array_initializer) ; [1, 2] + (argument_list) ; foo(...) + (formal_parameters) ; method foo(...) + (annotation_argument_list) ; @Annotation(...) + (element_value_array_initializer) ; { a, b } inside @Annotation() ] @indent.begin (expression_statement (method_invocation) @indent.begin) @@ -21,6 +25,7 @@ "]" ] @indent.branch +(annotation_argument_list ")" @indent.end) ; This should be a special cased as `()` here doesn't have ending `;` "}" @indent.end (line_comment) @indent.ignore -- cgit v1.2.3-70-g09d2