From fc9abb7b10029155870574c3c0b4f685968e68bc Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 2 Dec 2023 09:53:17 +0100 Subject: [PATCH] Fix incorrect indentation in scm files (#2079) ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet --- queries/java.scm | 232 +++++++++++++++++++++---------------------- queries/json.scm | 8 +- queries/markdown.scm | 10 +- 3 files changed, 125 insertions(+), 125 deletions(-) diff --git a/queries/java.scm b/queries/java.scm index a967dfd6a2..de254b317e 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -1,52 +1,52 @@ ;; Generated by the following command: ;; > curl https://raw.githubusercontent.com/tree-sitter/tree-sitter-java/master/src/node-types.json | jq '[.[] | select(.type == "statement" or .type == "declaration") | .subtypes[].type]' [ - (annotation_type_declaration) - (class_declaration) - (enum_declaration) - (import_declaration) - (interface_declaration) - (module_declaration) - (package_declaration) - (assert_statement) - (break_statement) - (continue_statement) - (declaration) - (do_statement) - (enhanced_for_statement) - (expression_statement) - (for_statement) - (if_statement) - (labeled_statement) - (local_variable_declaration) - (return_statement) - (switch_expression) - (synchronized_statement) - (throw_statement) - (try_statement) - (try_with_resources_statement) - (while_statement) - (yield_statement) - - ;; exceptions - ;; ";", - ;; "block", - (method_declaration) - (constructor_declaration) - (field_declaration) + (annotation_type_declaration) + (class_declaration) + (enum_declaration) + (import_declaration) + (interface_declaration) + (module_declaration) + (package_declaration) + (assert_statement) + (break_statement) + (continue_statement) + (declaration) + (do_statement) + (enhanced_for_statement) + (expression_statement) + (for_statement) + (if_statement) + (labeled_statement) + (local_variable_declaration) + (return_statement) + (switch_expression) + (synchronized_statement) + (throw_statement) + (try_statement) + (try_with_resources_statement) + (while_statement) + (yield_statement) + + ;; exceptions + ;; ";", + ;; "block", + (method_declaration) + (constructor_declaration) + (field_declaration) ] @statement (class_declaration - name: (_) @name @className + name: (_) @name @className ) @class @_.domain ;;!! void myFunk() {} ;;! ^^^^^^^^^^^^^^^^ (method_declaration - name: (_) @name @functionName + name: (_) @name @functionName ) @namedFunction @_.domain (constructor_declaration - name: (_) @name @functionName + name: (_) @name @functionName ) @namedFunction @_.domain ;;!! ((value) -> true) @@ -56,8 +56,8 @@ ;;!! if (value) {} ;;! ^^^^^^^^^^^^^ ( - (if_statement) @ifStatement - (#not-parent-type? @ifStatement "if_statement") + (if_statement) @ifStatement + (#not-parent-type? @ifStatement "if_statement") ) ;;!! "string" @@ -67,8 +67,8 @@ ;;!! // comment ;;! ^^^^^^^^^^ [ - (line_comment) - (block_comment) + (line_comment) + (block_comment) ] @comment @textFragment ;;!! int[] values = {1, 2, 3}; @@ -78,9 +78,9 @@ ;;!! List value = new ArrayList() {{ add("a"); }}; ;;! ^^^^^^^^^^^^^^^ (object_creation_expression - (class_body - (block) @map - ) + (class_body + (block) @map + ) ) ;;!! foo(1); @@ -90,9 +90,9 @@ ;;!! super(1); ;;! ^^^^^^^^ [ - (method_invocation) - (object_creation_expression) - (explicit_constructor_invocation) + (method_invocation) + (object_creation_expression) + (explicit_constructor_invocation) ] @functionCall ;;!! case "0": return "zero"; @@ -100,26 +100,26 @@ ;;!! case "0" -> "zero"; ;;! ^^^^^^^^^^^^^^^^^^^ [ - (switch_block_statement_group) - (switch_rule) + (switch_block_statement_group) + (switch_rule) ] @branch ;;!! case "0": return "zero"; ;;! ^^^ ;;! ------------------------ (switch_block_statement_group - (switch_label - (_) @condition - ) + (switch_label + (_) @condition + ) ) @condition.domain ;;!! case "0" -> "zero"; ;;! ^^^ ;;! ------------------- (switch_rule - (switch_label - (_) @condition - ) + (switch_label + (_) @condition + ) ) @condition.domain (switch_expression) @branch.iteration @condition.iteration @@ -127,69 +127,69 @@ ;;!! if () {} ;;! ^^^^^^^^ ( - (if_statement - "if" @branch.start @branch.removal.start - condition: (_) @condition - consequence: (block) @branch.end @branch.removal.end - alternative: (if_statement)? @branch.removal.end.startOf - ) @condition.domain - (#not-parent-type? @condition.domain "if_statement") - (#child-range! @condition 0 -1 true true) + (if_statement + "if" @branch.start @branch.removal.start + condition: (_) @condition + consequence: (block) @branch.end @branch.removal.end + alternative: (if_statement)? @branch.removal.end.startOf + ) @condition.domain + (#not-parent-type? @condition.domain "if_statement") + (#child-range! @condition 0 -1 true true) ) ;;!! else if () {} ;;! ^^^^^^^^^^^^^ (if_statement - "else" @branch.start @condition.domain.start - alternative: (if_statement - condition: (_) @condition - consequence: (block) @branch.end @condition.domain.end - (#child-range! @condition 0 -1 true true) - ) + "else" @branch.start @condition.domain.start + alternative: (if_statement + condition: (_) @condition + consequence: (block) @branch.end @condition.domain.end + (#child-range! @condition 0 -1 true true) + ) ) ;;!! else {} ;;! ^^^^^^^ (if_statement - "else" @branch.start - alternative: (block) @branch.end + "else" @branch.start + alternative: (block) @branch.end ) ;;!! for (int i = 0; i < 5; ++i) {} ;;! ^^^^^ ;;! ------------------------------ (for_statement - condition: (_) @condition + condition: (_) @condition ) @_.domain ;;!! while (value) {} ;;! ^^^^^ ;;! ---------------- (while_statement - condition: (_) @condition - (#child-range! @condition 0 -1 true true) + condition: (_) @condition + (#child-range! @condition 0 -1 true true) ) @_.domain (do_statement - condition: (_) @condition - (#child-range! @condition 0 -1 true true) + condition: (_) @condition + (#child-range! @condition 0 -1 true true) ) @_.domain ;;!! switch (value) {} ;;! ^^^^^ ;;! ----------------- (switch_expression - condition: (_) @private.switchStatementSubject - (#child-range! @private.switchStatementSubject 0 -1 true true) + condition: (_) @private.switchStatementSubject + (#child-range! @private.switchStatementSubject 0 -1 true true) ) @_.domain ;;!! true ? 1 : 2 (ternary_expression - condition: (_) @condition - consequence: (_) @branch + condition: (_) @condition + consequence: (_) @branch ) @condition.domain (ternary_expression - alternative: (_) @branch + alternative: (_) @branch ) ;;!! true ? 1 : 2 @@ -200,86 +200,86 @@ ;;! ^^^^^ ;;! ------------------------- (formal_parameters - (formal_parameter - (identifier) @name - ) @_.domain + (formal_parameter + (identifier) @name + ) @_.domain ) @_.iteration ;;!! Map ;;! ^^^^^^^ ^^^^^^ (type_arguments - (type_identifier) @type + (type_identifier) @type ) ;;!! List list = value; ;;! ^^^^^^^^^^^^ ;;! -------------------------- (local_variable_declaration - type: (_) @type + type: (_) @type ) @_.domain ;;!! name = new ArrayList(); ;;! ^^^^^^^^^^^^^^^^^ ;;! ----------------------- (object_creation_expression - type: (_) @type + type: (_) @type ) @_.domain ;;!! name = new int[5]; ;;! ^^^ ;;! ---------- (array_creation_expression - type: (_) @type + type: (_) @type ) @_.domain ;;!! void myFunk(int value) {} ;;! ^^^ ;;! --------- (formal_parameter - type: (_) @type + type: (_) @type ) @_.domain ;;!! int size() {} ;;! ^^^ ;;! ------------- (method_declaration - type: (_) @type + type: (_) @type ) @_.domain ;;!! new test(); ;;! ^^^^^^^^ ;;! ----------- (_ - (object_creation_expression - (argument_list) @functionCallee.end.startOf - ) @functionCallee.start.startOf @_.domain.start - ";"? @_.domain.end + (object_creation_expression + (argument_list) @functionCallee.end.startOf + ) @functionCallee.start.startOf @_.domain.start + ";"? @_.domain.end ) ;;!! new test().bar(); ;;! ^^^^^^^^^^^^^^ ;;! ----------------- (_ - (method_invocation - (argument_list) @functionCallee.end.startOf - ) @functionCallee.start.startOf @_.domain.start - ";"? @_.domain.end + (method_invocation + (argument_list) @functionCallee.end.startOf + ) @functionCallee.start.startOf @_.domain.start + ";"? @_.domain.end ) ;;!! super(); ;;! ^^^^^ ;;! -------- (explicit_constructor_invocation - (argument_list) @functionCallee.end.startOf + (argument_list) @functionCallee.end.startOf ) @functionCallee.start.startOf @_.domain ;;!! for (int value : values) {} ;;! ^^^^^^ ;;! --------------------------- (enhanced_for_statement - type: (_) @type - name: (_) @name - value: (_) @value + type: (_) @type + name: (_) @name + value: (_) @value ) @_.domain ;;!! int value = 1; @@ -287,16 +287,16 @@ ;;! xxxx ;;! -------------- (local_variable_declaration - (variable_declarator - name: (_) @name @name.trailing.start.endOf @value.leading.start.endOf - value: (_)? @value @name.trailing.end.startOf @value.leading.end.startOf - ) + (variable_declarator + name: (_) @name @name.trailing.start.endOf @value.leading.start.endOf + value: (_)? @value @name.trailing.end.startOf @value.leading.end.startOf + ) ) @_.domain (field_declaration - (variable_declarator - name: (_) @name @name.trailing.start.endOf @value.leading.start.endOf - value: (_)? @value @name.trailing.end.startOf @value.leading.end.startOf - ) + (variable_declarator + name: (_) @name @name.trailing.start.endOf @value.leading.start.endOf + value: (_)? @value @name.trailing.end.startOf @value.leading.end.startOf + ) ) @_.domain ;;!! value = 1; @@ -304,17 +304,17 @@ ;;! xxxx ;;! ---------- (_ - (assignment_expression - left: (_) @name @name.trailing.start.endOf @value.leading.start.endOf - right: (_) @value @name.trailing.end.startOf @value.leading.end.startOf - ) @_.domain.start - ";"? @_.domain.end + (assignment_expression + left: (_) @name @name.trailing.start.endOf @value.leading.start.endOf + right: (_) @value @name.trailing.end.startOf @value.leading.end.startOf + ) @_.domain.start + ";"? @_.domain.end ) ;;!! return value; ;;! ^^^^^ ;;! ------------- ( - (return_statement) @value @_.domain - (#child-range! @value 1 -2) + (return_statement) @value @_.domain + (#child-range! @value 1 -2) ) diff --git a/queries/json.scm b/queries/json.scm index 628218cfa7..907c9dc750 100644 --- a/queries/json.scm +++ b/queries/json.scm @@ -18,13 +18,13 @@ ;;! ^^^^^^^ ^ ;;! ---------- (pair - key: (_) @collectionKey @collectionKey.trailing.start.endOf @value.leading.start.endOf - value: (_) @value @collectionKey.trailing.end.startOf @value.leading.end.startOf + key: (_) @collectionKey @collectionKey.trailing.start.endOf @value.leading.start.endOf + value: (_) @value @collectionKey.trailing.end.startOf @value.leading.end.startOf ) @_.domain ;;!! {"bbb": 0, "ccc": 0} ;;! ****************** (object - "{" @collectionKey.iteration.start.endOf @value.iteration.start.endOf - "}" @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "{" @collectionKey.iteration.start.endOf @value.iteration.start.endOf + "}" @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) diff --git a/queries/markdown.scm b/queries/markdown.scm index b1bc2aadb9..42ae6b1651 100644 --- a/queries/markdown.scm +++ b/queries/markdown.scm @@ -11,9 +11,9 @@ ;;!! xxxxxxx ;;! ------- (section - (atx_heading - (_) - heading_content: (_) @name - ) @_.removal - (#shrink-to-match! @name "^\\s*(?.*)$") + (atx_heading + (_) + heading_content: (_) @name + ) @_.removal + (#shrink-to-match! @name "^\\s*(?.*)$") ) @_.domain