diff options
| author | Phạm Huy Hoàng <hoangtun0810@gmail.com> | 2024-03-21 20:44:35 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-03-21 15:51:26 +0100 |
| commit | 722617e6726c1508adadf83d531f54987c703be0 (patch) | |
| tree | 951cdcf1cd2571647a3e5afdc11d6fae5e88b630 | |
| parent | feat(rust): improve indents (diff) | |
| download | nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.gz nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.bz2 nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.lz nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.xz nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.zst nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.zip | |
refactor(format): drop extra indentation for field
140 files changed, 2122 insertions, 2742 deletions
diff --git a/queries/angular/highlights.scm b/queries/angular/highlights.scm index 2bf743cd1..f3aa27d25 100644 --- a/queries/angular/highlights.scm +++ b/queries/angular/highlights.scm @@ -12,9 +12,8 @@ name: (identifier) @function) (pipe_call - arguments: - (pipe_arguments - (identifier) @variable.parameter)) + arguments: (pipe_arguments + (identifier) @variable.parameter)) (structural_directive "*" @keyword @@ -47,14 +46,12 @@ function: (identifier) @function) (call_expression - function: - ((identifier) @function.builtin - (#eq? @function.builtin "$any"))) + function: ((identifier) @function.builtin + (#eq? @function.builtin "$any"))) (pair - key: - ((identifier) @variable.builtin - (#eq? @variable.builtin "$implicit"))) + key: ((identifier) @variable.builtin + (#eq? @variable.builtin "$implicit"))) ((control_keyword) @keyword.repeat (#any-of? @keyword.repeat "for" "empty")) diff --git a/queries/apex/highlights.scm b/queries/apex/highlights.scm index 55acadd62..50812f214 100644 --- a/queries/apex/highlights.scm +++ b/queries/apex/highlights.scm @@ -106,36 +106,34 @@ ] @operator (binary_expression - operator: - [ - ">" - "<" - "==" - "===" - "!==" - "&&" - "||" - "+" - "-" - "*" - "/" - "&" - "|" - "^" - "%" - "<<" - ">>" - ">>>" - ] @operator) + operator: [ + ">" + "<" + "==" + "===" + "!==" + "&&" + "||" + "+" + "-" + "*" + "/" + "&" + "|" + "^" + "%" + "<<" + ">>" + ">>>" + ] @operator) (unary_expression - operator: - [ - "+" - "-" - "!" - "~" - ]) @operator + operator: [ + "+" + "-" + "!" + "~" + ]) @operator (map_initializer "=>" @operator) @@ -147,9 +145,8 @@ ; Fields (field_declaration - declarator: - (variable_declarator - name: (identifier) @variable.member)) + declarator: (variable_declarator + name: (identifier) @variable.member)) (field_access field: (identifier) @variable.member) diff --git a/queries/apex/locals.scm b/queries/apex/locals.scm index d3cbfa73b..2457752fa 100644 --- a/queries/apex/locals.scm +++ b/queries/apex/locals.scm @@ -48,9 +48,8 @@ name: (identifier) @local.definition.method) (local_variable_declaration - declarator: - (variable_declarator - name: (identifier) @local.definition.var)) + declarator: (variable_declarator + name: (identifier) @local.definition.var)) (enhanced_for_statement name: (identifier) @local.definition.var) @@ -62,9 +61,8 @@ name: (identifier) @local.definition.parameter) (field_declaration - declarator: - (variable_declarator - name: (identifier) @local.definition.field)) + declarator: (variable_declarator + name: (identifier) @local.definition.field)) ; REFERENCES (identifier) @local.reference diff --git a/queries/authzed/highlights.scm b/queries/authzed/highlights.scm index 2009b78e3..fb946caaf 100644 --- a/queries/authzed/highlights.scm +++ b/queries/authzed/highlights.scm @@ -25,10 +25,9 @@ (identifier) @property) (call_expression - function: - (selector_expression - operand: (identifier) @constant - field: (field_identifier) @function.method)) + function: (selector_expression + operand: (identifier) @constant + field: (field_identifier) @function.method)) (perm_expression (stabby) @operator diff --git a/queries/awk/highlights.scm b/queries/awk/highlights.scm index 305a20828..bc6395439 100644 --- a/queries/awk/highlights.scm +++ b/queries/awk/highlights.scm @@ -41,14 +41,12 @@ "::" @punctuation.delimiter) (func_def - name: - (_ - (identifier) @function) @function) + name: (_ + (identifier) @function) @function) (func_call - name: - (_ - (identifier) @function) @function) + name: (_ + (identifier) @function) @function) (func_def (param_list diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm index 86f9a6734..32e40dbf8 100644 --- a/queries/bash/highlights.scm +++ b/queries/bash/highlights.scm @@ -170,12 +170,11 @@ "trap" "type" "typeset" "ulimit" "umask" "unalias" "wait")) (command - argument: - [ - (word) @variable.parameter - (concatenation - (word) @variable.parameter) - ]) + argument: [ + (word) @variable.parameter + (concatenation + (word) @variable.parameter) + ]) (number) @number diff --git a/queries/bash/injections.scm b/queries/bash/injections.scm index 83bb6359e..169ad1358 100644 --- a/queries/bash/injections.scm +++ b/queries/bash/injections.scm @@ -13,11 +13,10 @@ ((command name: (command_name) @_command . - argument: - [ - (string) - (raw_string) - ] @injection.content) + argument: [ + (string) + (raw_string) + ] @injection.content) (#eq? @_command "printf") (#set! injection.language "printf")) @@ -28,11 +27,10 @@ . (_) . - argument: - [ - (string) - (raw_string) - ] @injection.content) + argument: [ + (string) + (raw_string) + ] @injection.content) (#eq? @_command "printf") (#eq? @_arg "-v") (#set! injection.language "printf")) @@ -42,11 +40,10 @@ name: (command_name) @_command argument: (word) @_arg . - argument: - [ - (string) - (raw_string) - ] @injection.content) + argument: [ + (string) + (raw_string) + ] @injection.content) (#eq? @_command "printf") (#eq? @_arg "--") (#set! injection.language "printf")) diff --git a/queries/bitbake/highlights.scm b/queries/bitbake/highlights.scm index b8bbfea3f..4b03fbc27 100644 --- a/queries/bitbake/highlights.scm +++ b/queries/bitbake/highlights.scm @@ -137,9 +137,8 @@ ((assignment left: (python_identifier) @type.definition - right: - (call - function: (python_identifier) @_func)) + right: (call + function: (python_identifier) @_func)) (#any-of? @_func "TypeVar" "NewType")) ; Fields @@ -154,18 +153,16 @@ function: (python_identifier) @function.call) (call - function: - (attribute - attribute: (python_identifier) @function.method.call)) + function: (attribute + attribute: (python_identifier) @function.method.call)) ((call function: (python_identifier) @constructor) (#lua-match? @constructor "^%u")) ((call - function: - (attribute - attribute: (python_identifier) @constructor)) + function: (attribute + attribute: (python_identifier) @constructor)) (#lua-match? @constructor "^%u")) ((call @@ -191,10 +188,9 @@ ((call function: (python_identifier) @_isinstance - arguments: - (argument_list - (_) - (python_identifier) @type)) + arguments: (argument_list + (_) + (python_identifier) @type)) (#eq? @_isinstance "isinstance")) (anonymous_python_function @@ -216,11 +212,10 @@ (identifier) @function) (python_function_definition - body: - (block - . - (expression_statement - (python_string) @string.documentation @spell))) + body: (block + . + (expression_statement + (python_string) @string.documentation @spell))) ; Namespace (inherit_path) @module diff --git a/queries/bitbake/indents.scm b/queries/bitbake/indents.scm index ee60d0fda..5f2081868 100644 --- a/queries/bitbake/indents.scm +++ b/queries/bitbake/indents.scm @@ -154,9 +154,8 @@ (attribute attribute: (_) @indent.end) (call - arguments: - (_ - ")" @indent.end)) + arguments: (_ + ")" @indent.end)) "return" @indent.end ] .) diff --git a/queries/bitbake/injections.scm b/queries/bitbake/injections.scm index 39182e838..35c984a5b 100644 --- a/queries/bitbake/injections.scm +++ b/queries/bitbake/injections.scm @@ -1,11 +1,9 @@ (call - function: - (attribute - object: (python_identifier) @_re) - arguments: - (argument_list - (python_string - (string_content) @injection.content) @_string) + function: (attribute + object: (python_identifier) @_re) + arguments: (argument_list + (python_string + (string_content) @injection.content) @_string) (#eq? @_re "re") (#lua-match? @_string "^r.*") (#set! injection.language "regex")) diff --git a/queries/bitbake/locals.scm b/queries/bitbake/locals.scm index edee8b30b..e4726ec51 100644 --- a/queries/bitbake/locals.scm +++ b/queries/bitbake/locals.scm @@ -9,14 +9,12 @@ alias: (python_identifier) @local.definition.import) (import_statement - name: - (dotted_name - (python_identifier) @local.definition.import)) + name: (dotted_name + (python_identifier) @local.definition.import)) (import_from_statement - name: - (dotted_name - (python_identifier) @local.definition.import)) + name: (dotted_name + (python_identifier) @local.definition.import)) ; Function with parameters, defines parameters (parameters @@ -55,14 +53,12 @@ ; Loops ; not a scope! (for_statement - left: - (pattern_list - (python_identifier) @local.definition.var)) + left: (pattern_list + (python_identifier) @local.definition.var)) (for_statement - left: - (tuple_pattern - (python_identifier) @local.definition.var)) + left: (tuple_pattern + (python_identifier) @local.definition.var)) (for_statement left: (python_identifier) @local.definition.var) @@ -74,14 +70,12 @@ left: (python_identifier) @local.definition.var) (for_in_clause - left: - (tuple_pattern - (python_identifier) @local.definition.var)) + left: (tuple_pattern + (python_identifier) @local.definition.var)) (for_in_clause - left: - (pattern_list - (python_identifier) @local.definition.var)) + left: (pattern_list + (python_identifier) @local.definition.var)) (dictionary_comprehension) @local.scope @@ -94,30 +88,26 @@ left: (python_identifier) @local.definition.var) (assignment - left: - (pattern_list - (python_identifier) @local.definition.var)) + left: (pattern_list + (python_identifier) @local.definition.var)) (assignment - left: - (tuple_pattern - (python_identifier) @local.definition.var)) + left: (tuple_pattern + (python_identifier) @local.definition.var)) (assignment - left: - (attribute - (python_identifier) - (python_identifier) @local.definition.field)) + left: (attribute + (python_identifier) + (python_identifier) @local.definition.field)) (variable_assignment (identifier) - operator: - [ - "=" - "?=" - "??=" - ":=" - ] @local.definition.var) + operator: [ + "=" + "?=" + "??=" + ":=" + ] @local.definition.var) ; Walrus operator x := 1 (named_expression diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index e22aac997..f9e2ef800 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -263,18 +263,16 @@ function: (identifier) @function.call) (call_expression - function: - (field_expression - field: (field_identifier) @function.call)) + function: (field_expression + field: (field_identifier) @function.call)) (function_declarator declarator: (identifier) @function) (function_declarator - declarator: - (parenthesized_declarator - (pointer_declarator - declarator: (field_identifier) @function))) + declarator: (parenthesized_declarator + (pointer_declarator + declarator: (field_identifier) @function))) (preproc_function_def name: (identifier) @function.macro) diff --git a/queries/c/indents.scm b/queries/c/indents.scm index 0a85373f4..372a26c6c 100644 --- a/queries/c/indents.scm +++ b/queries/c/indents.scm @@ -43,19 +43,17 @@ ; Supports if without braces (but not both if-else without braces) (if_statement - consequence: - (_ - ";" @indent.end) @_consequence + consequence: (_ + ";" @indent.end) @_consequence (#not-has-type? @_consequence compound_statement) - alternative: - (else_clause - "else" @indent.branch - [ - (if_statement - (compound_statement) @indent.dedent)? @indent.dedent - (compound_statement)? @indent.dedent - (_)? @indent.dedent - ])?) @indent.begin + alternative: (else_clause + "else" @indent.branch + [ + (if_statement + (compound_statement) @indent.dedent)? @indent.dedent + (compound_statement)? @indent.dedent + (_)? @indent.dedent + ])?) @indent.begin (else_clause (_ diff --git a/queries/c/injections.scm b/queries/c/injections.scm index 308994bc0..00c1443b4 100644 --- a/queries/c/injections.scm +++ b/queries/c/injections.scm @@ -14,11 +14,10 @@ ((call_expression function: (identifier) @_function - arguments: - (argument_list - . - (string_literal - (string_content) @injection.content))) + arguments: (argument_list + . + (string_literal + (string_content) @injection.content))) ; format-ignore (#any-of? @_function "printf" "printf_s" @@ -36,12 +35,11 @@ ((call_expression function: (identifier) @_function - arguments: - (argument_list - (_) - . - (string_literal - (string_content) @injection.content))) + arguments: (argument_list + (_) + . + (string_literal + (string_content) @injection.content))) ; format-ignore (#any-of? @_function "fprintf" "fprintf_s" @@ -68,14 +66,13 @@ ((call_expression function: (identifier) @_function - arguments: - (argument_list - (_) - . - (_) - . - (string_literal - (string_content) @injection.content))) + arguments: (argument_list + (_) + . + (_) + . + (string_literal + (string_content) @injection.content))) ; format-ignore (#any-of? @_function "sprintf_s" @@ -92,16 +89,15 @@ ((call_expression function: (identifier) @_function - arguments: - (argument_list - (_) - . - (_) - . - (_) - . - (string_literal - (string_content) @injection.content))) + arguments: (argument_list + (_) + . + (_) + . + (_) + . + (string_literal + (string_content) @injection.content))) (#any-of? @_function "mvwprintw" "mvwscanw") (#set! injection.language "printf")) diff --git a/queries/c_sharp/folds.scm b/queries/c_sharp/folds.scm index 640242c67..bdd7b6551 100644 --- a/queries/c_sharp/folds.scm +++ b/queries/c_sharp/folds.scm @@ -1,9 +1,8 @@ -body: - [ - (declaration_list) - (switch_body) - (enum_member_declaration_list) - ] @fold +body: [ + (declaration_list) + (switch_body) + (enum_member_declaration_list) +] @fold accessors: (accessor_list) @fold diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index bd80f3146..e097907c2 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -32,28 +32,25 @@ name: (identifier) @function.method.call)) (invocation_expression - function: - (conditional_access_expression - (member_binding_expression - name: (identifier) @function.method.call))) + function: (conditional_access_expression + (member_binding_expression + name: (identifier) @function.method.call))) (namespace_declaration - name: - [ - (qualified_name) - (identifier) - ] @module) + name: [ + (qualified_name) + (identifier) + ] @module) (qualified_name (identifier) @type) (namespace_declaration - name: - [ - (qualified_name - (identifier) @module) - (identifier) @module - ]) + name: [ + (qualified_name + (identifier) @module) + (identifier) @module + ]) (invocation_expression (identifier) @function.method.call) @@ -184,16 +181,14 @@ (identifier) @type)) (_ - type: - (generic_name - (identifier) @type)) + type: (generic_name + (identifier) @type)) ; Generic Method invocation with generic type (invocation_expression - function: - (generic_name - . - (identifier) @function.method.call)) + function: (generic_name + . + (identifier) @function.method.call)) (invocation_expression (member_access_expression diff --git a/queries/c_sharp/locals.scm b/queries/c_sharp/locals.scm index 0476a1695..33df9bb37 100644 --- a/queries/c_sharp/locals.scm +++ b/queries/c_sharp/locals.scm @@ -14,9 +14,8 @@ left: (identifier) @local.definition.var) (for_each_statement - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (parameter (identifier) @local.definition.parameter) diff --git a/queries/cairo/highlights.scm b/queries/cairo/highlights.scm index e7a4faf9c..be4a749c4 100644 --- a/queries/cairo/highlights.scm +++ b/queries/cairo/highlights.scm @@ -10,9 +10,8 @@ "from" "import" ] @keyword.import - module_name: - (dotted_name - (identifier) @module .)) + module_name: (dotted_name + (identifier) @module .)) [ "as" @@ -74,9 +73,8 @@ path: (identifier) @module) (scoped_use_list - path: - (scoped_identifier - (identifier) @module)) + path: (scoped_identifier + (identifier) @module)) (use_list (scoped_identifier @@ -228,14 +226,12 @@ function: (identifier) @function.call) (call_expression - function: - (scoped_identifier - (identifier) @function.call .)) + function: (scoped_identifier + (identifier) @function.call .)) (call_expression - function: - (field_expression - field: (field_identifier) @function.call)) + function: (field_expression + field: (field_identifier) @function.call)) "jmp" @function.builtin @@ -267,23 +263,20 @@ name: (identifier) @constant) (call_expression - function: - (scoped_identifier - "::" - name: (identifier) @constant) + function: (scoped_identifier + "::" + name: (identifier) @constant) (#lua-match? @constant "^[A-Z]")) ((match_arm - pattern: - (match_pattern - (identifier) @constant)) + pattern: (match_pattern + (identifier) @constant)) (#lua-match? @constant "^[A-Z]")) ((match_arm - pattern: - (match_pattern - (scoped_identifier - name: (identifier) @constant))) + pattern: (match_pattern + (scoped_identifier + name: (identifier) @constant))) (#lua-match? @constant "^[A-Z]")) ((identifier) @constant.builtin diff --git a/queries/cairo/indents.scm b/queries/cairo/indents.scm index a97bd24a4..f63ef36fe 100644 --- a/queries/cairo/indents.scm +++ b/queries/cairo/indents.scm @@ -25,29 +25,24 @@ "}" @indent.end) (enum_item - body: - (enum_variant_list - "}" @indent.end)) + body: (enum_variant_list + "}" @indent.end)) (match_expression - body: - (match_block - "}" @indent.end)) + body: (match_block + "}" @indent.end)) (mod_item - body: - (declaration_list - "}" @indent.end)) + body: (declaration_list + "}" @indent.end)) (struct_item - body: - (field_declaration_list - "}" @indent.end)) + body: (field_declaration_list + "}" @indent.end)) (trait_item - body: - (declaration_list - "}" @indent.end)) + body: (declaration_list + "}" @indent.end)) [ ")" diff --git a/queries/cairo/locals.scm b/queries/cairo/locals.scm index 27ec73542..0573cf6db 100644 --- a/queries/cairo/locals.scm +++ b/queries/cairo/locals.scm @@ -22,9 +22,8 @@ ] @local.scope (use_declaration - argument: - (scoped_identifier - name: (identifier) @local.definition.import)) + argument: (scoped_identifier + name: (identifier) @local.definition.import)) (use_as_clause alias: (identifier) @local.definition.import) diff --git a/queries/commonlisp/highlights.scm b/queries/commonlisp/highlights.scm index 0f3524e99..84f132e48 100644 --- a/queries/commonlisp/highlights.scm +++ b/queries/commonlisp/highlights.scm @@ -11,30 +11,26 @@ function_name: (_) @function) (defun_header - lambda_list: - (list_lit - (sym_lit) @variable.parameter)) + lambda_list: (list_lit + (sym_lit) @variable.parameter)) (defun_header - keyword: - (defun_keyword - "defmethod") - lambda_list: + keyword: (defun_keyword + "defmethod") + lambda_list: (list_lit (list_lit - (list_lit - . - (sym_lit) - . - (sym_lit) @string.special.symbol))) + . + (sym_lit) + . + (sym_lit) @string.special.symbol))) (defun_header - lambda_list: + lambda_list: (list_lit (list_lit - (list_lit - . - (sym_lit) @variable.parameter - . - (_)))) + . + (sym_lit) @variable.parameter + . + (_)))) (defun_header specifier: (sym_lit) @string.special.symbol) diff --git a/queries/commonlisp/locals.scm b/queries/commonlisp/locals.scm index 2865c1f0f..98036d322 100644 --- a/queries/commonlisp/locals.scm +++ b/queries/commonlisp/locals.scm @@ -3,30 +3,26 @@ (#set! definition.function.scope "parent")) (defun_header - lambda_list: - (list_lit - (sym_lit) @local.definition.parameter)) + lambda_list: (list_lit + (sym_lit) @local.definition.parameter)) (defun_header - keyword: - (defun_keyword - "defmethod") - lambda_list: + keyword: (defun_keyword + "defmethod") + lambda_list: (list_lit (list_lit - (list_lit - . - (sym_lit) - . - (sym_lit) @local.definition.type))) + . + (sym_lit) + . + (sym_lit) @local.definition.type))) (defun_header - lambda_list: + lambda_list: (list_lit (list_lit - (list_lit - . - (sym_lit) @local.definition.parameter - . - (_)))) + . + (sym_lit) @local.definition.parameter + . + (_)))) (sym_lit) @local.reference diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm index f2ba879fb..594e0dc24 100644 --- a/queries/cpp/highlights.scm +++ b/queries/cpp/highlights.scm @@ -8,9 +8,8 @@ ; function(Foo ...foo) (variadic_parameter_declaration - declarator: - (variadic_declarator - (_) @variable.parameter)) + declarator: (variadic_declarator + (_) @variable.parameter)) ; int foo = 0 (optional_parameter_declaration @@ -44,9 +43,8 @@ (#lua-match? @type "^[%u]")) (case_statement - value: - (qualified_identifier - (identifier) @constant)) + value: (qualified_identifier + (identifier) @constant)) (using_declaration . @@ -167,15 +165,13 @@ (#lua-match? @constructor "^%u")) ((call_expression - function: - (qualified_identifier - name: (identifier) @constructor)) + function: (qualified_identifier + name: (identifier) @constructor)) (#lua-match? @constructor "^%u")) ((call_expression - function: - (field_expression - field: (field_identifier) @constructor)) + function: (field_expression + field: (field_identifier) @constructor)) (#lua-match? @constructor "^%u")) ; constructing a type in an initializer list: Constructor (): **SuperType (1)** diff --git a/queries/cpp/locals.scm b/queries/cpp/locals.scm index 8b1d8dcc1..b24ada85f 100644 --- a/queries/cpp/locals.scm +++ b/queries/cpp/locals.scm @@ -2,9 +2,8 @@ ; Parameters (variadic_parameter_declaration - declarator: - (variadic_declarator - (identifier) @local.definition.parameter)) + declarator: (variadic_declarator + (identifier) @local.definition.parameter)) (optional_parameter_declaration declarator: (identifier) @local.definition.parameter) @@ -19,9 +18,8 @@ (identifier) @local.definition.var) (struct_specifier - name: - (qualified_identifier - name: (type_identifier) @local.definition.type)) + name: (qualified_identifier + name: (type_identifier) @local.definition.type)) (class_specifier name: (type_identifier) @local.definition.type) @@ -30,9 +28,8 @@ name: (identifier) @local.definition.type) (class_specifier - name: - (qualified_identifier - name: (type_identifier) @local.definition.type)) + name: (qualified_identifier + name: (type_identifier) @local.definition.type)) (alias_declaration name: (type_identifier) @local.definition.type) @@ -63,14 +60,12 @@ name: (field_identifier) @local.definition.method) @local.scope (function_declarator - declarator: - (qualified_identifier - name: (identifier) @local.definition.function)) @local.scope + declarator: (qualified_identifier + name: (identifier) @local.definition.function)) @local.scope (field_declaration - declarator: - (function_declarator - (field_identifier) @local.definition.method)) + declarator: (function_declarator + (field_identifier) @local.definition.method)) (lambda_expression) @local.scope diff --git a/queries/cue/highlights.scm b/queries/cue/highlights.scm index 3371bc33e..27d4daddc 100644 --- a/queries/cue/highlights.scm +++ b/queries/cue/highlights.scm @@ -71,10 +71,9 @@ function: (identifier) @function.call) (call_expression - function: - (selector_expression - (_) - (identifier) @function.call)) + function: (selector_expression + (_) + (identifier) @function.call)) (call_expression function: (builtin_function) @function.call) diff --git a/queries/dot/highlights.scm b/queries/dot/highlights.scm index b4a36f18d..75ad92271 100644 --- a/queries/dot/highlights.scm +++ b/queries/dot/highlights.scm @@ -33,19 +33,16 @@ ] @punctuation.bracket (subgraph - id: - (id - (identifier) @module)) + id: (id + (identifier) @module)) (attribute - name: - (id - (identifier) @variable.member)) + name: (id + (identifier) @variable.member)) (attribute - value: - (id - (identifier) @constant)) + value: (id + (identifier) @constant)) (comment) @comment @spell diff --git a/queries/ecma/highlights.scm b/queries/ecma/highlights.scm index b645ae385..58785d454 100644 --- a/queries/ecma/highlights.scm +++ b/queries/ecma/highlights.scm @@ -58,11 +58,10 @@ name: (identifier) @function) (method_definition - name: - [ - (property_identifier) - (private_property_identifier) - ] @function.method) + name: [ + (property_identifier) + (private_property_identifier) + ] @function.method) (method_definition name: (property_identifier) @constructor @@ -77,15 +76,13 @@ value: (arrow_function)) (assignment_expression - left: - (member_expression - property: (property_identifier) @function.method) + left: (member_expression + property: (property_identifier) @function.method) right: (arrow_function)) (assignment_expression - left: - (member_expression - property: (property_identifier) @function.method) + left: (member_expression + property: (property_identifier) @function.method) right: (function_expression)) (variable_declarator @@ -110,13 +107,11 @@ function: (identifier) @function.call) (call_expression - function: - (member_expression - property: - [ - (property_identifier) - (private_property_identifier) - ] @function.method.call)) + function: (member_expression + property: [ + (property_identifier) + (private_property_identifier) + ] @function.method.call)) ; Builtins ;--------- diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm index 011d953bf..74d583849 100644 --- a/queries/ecma/injections.scm +++ b/queries/ecma/injections.scm @@ -8,12 +8,11 @@ ; html(`...`), html`...`, sql(...) etc (call_expression function: (identifier) @injection.language - arguments: - [ - (arguments - (template_string) @injection.content) - (template_string) @injection.content - ] + arguments: [ + (arguments + (template_string) @injection.content) + (template_string) @injection.content + ] (#lua-match? @injection.language "^[a-zA-Z][a-zA-Z0-9]*$") (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children) @@ -24,38 +23,32 @@ ; svg`...` or svg(`...`) (call_expression - function: - ((identifier) @_name - (#eq? @_name "svg")) - arguments: - [ - (arguments - (template_string) @injection.content) - (template_string) @injection.content - ] + function: ((identifier) @_name + (#eq? @_name "svg")) + arguments: [ + (arguments + (template_string) @injection.content) + (template_string) @injection.content + ] (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children) (#set! injection.language "html")) (call_expression - function: - ((identifier) @_name - (#eq? @_name "gql")) - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "graphql"))) + function: ((identifier) @_name + (#eq? @_name "gql")) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "graphql"))) (call_expression - function: - ((identifier) @_name - (#eq? @_name "hbs")) - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "glimmer"))) + function: ((identifier) @_name + (#eq? @_name "hbs")) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "glimmer"))) ((glimmer_template) @injection.content (#set! injection.language "glimmer")) @@ -64,67 +57,54 @@ (call_expression function: (identifier) @_name (#any-of? @_name "css" "keyframes") - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "styled"))) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) ; styled.div`<css>` (call_expression - function: - (member_expression - object: (identifier) @_name - (#eq? @_name "styled")) - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "styled"))) + function: (member_expression + object: (identifier) @_name + (#eq? @_name "styled")) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) ; styled(Component)`<css>` (call_expression - function: - (call_expression - function: (identifier) @_name - (#eq? @_name "styled")) - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "styled"))) + function: (call_expression + function: (identifier) @_name + (#eq? @_name "styled")) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) ; styled.div.attrs({ prop: "foo" })`<css>` (call_expression - function: - (call_expression - function: - (member_expression - object: - (member_expression - object: (identifier) @_name - (#eq? @_name "styled")))) - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "styled"))) + function: (call_expression + function: (member_expression + object: (member_expression + object: (identifier) @_name + (#eq? @_name "styled")))) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) ; styled(Component).attrs({ prop: "foo" })`<css>` (call_expression - function: - (call_expression - function: - (member_expression - object: - (call_expression - function: (identifier) @_name - (#eq? @_name "styled")))) - arguments: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "styled"))) + function: (call_expression + function: (member_expression + object: (call_expression + function: (identifier) @_name + (#eq? @_name "styled")))) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) ((regex_pattern) @injection.content (#set! injection.language "regex")) @@ -141,10 +121,9 @@ ; el.innerHTML = `<html>` (assignment_expression - left: - (member_expression - property: (property_identifier) @_prop - (#any-of? @_prop "outerHTML" "innerHTML")) + left: (member_expression + property: (property_identifier) @_prop + (#any-of? @_prop "outerHTML" "innerHTML")) right: (template_string) @injection.content (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children) @@ -152,13 +131,11 @@ ; el.innerHTML = '<html>' (assignment_expression - left: - (member_expression - property: (property_identifier) @_prop - (#any-of? @_prop "outerHTML" "innerHTML")) - right: - (string - (string_fragment) @injection.content) + left: (member_expression + property: (property_identifier) @_prop + (#any-of? @_prop "outerHTML" "innerHTML")) + right: (string + (string_fragment) @injection.content) (#set! injection.language "html")) ;---- Angular injections ----- @@ -167,61 +144,49 @@ ; }) (decorator (call_expression - function: - ((identifier) @_name - (#eq? @_name "Component")) - arguments: - (arguments - (object - (pair - key: - ((property_identifier) @_prop - (#eq? @_prop "template")) - value: - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "angular"))))))) + function: ((identifier) @_name + (#eq? @_name "Component")) + arguments: (arguments + (object + (pair + key: ((property_identifier) @_prop + (#eq? @_prop "template")) + value: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "angular"))))))) ; @Component({ ; styles: [`<css>`] ; }) (decorator (call_expression - function: - ((identifier) @_name - (#eq? @_name "Component")) - arguments: - (arguments - (object - (pair - key: - ((property_identifier) @_prop - (#eq? @_prop "styles")) - value: - (array - ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "css")))))))) + function: ((identifier) @_name + (#eq? @_name "Component")) + arguments: (arguments + (object + (pair + key: ((property_identifier) @_prop + (#eq? @_prop "styles")) + value: (array + ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "css")))))))) ; @Component({ ; styles: `<css>` ; }) (decorator (call_expression - function: - ((identifier) @_name - (#eq? @_name "Component")) - arguments: - (arguments - (object - (pair - key: - ((property_identifier) @_prop - (#eq? @_prop "styles")) - value: - ((template_string) @injection.content - (#set! injection.include-children) - (#offset! @injection.content 0 1 0 -1) - (#set! injection.language "css"))))))) + function: ((identifier) @_name + (#eq? @_name "Component")) + arguments: (arguments + (object + (pair + key: ((property_identifier) @_prop + (#eq? @_prop "styles")) + value: ((template_string) @injection.content + (#set! injection.include-children) + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "css"))))))) diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm index 43208f40f..cbdb40de5 100644 --- a/queries/elixir/highlights.scm +++ b/queries/elixir/highlights.scm @@ -95,42 +95,37 @@ ; Remote Function Calls (call - target: - (dot - left: - [ - (atom) @type - (_) - ] - right: (identifier) @function.call) + target: (dot + left: [ + (atom) @type + (_) + ] + right: (identifier) @function.call) (arguments)) ; Definition Function Calls (call - target: - ((identifier) @keyword.function - (#any-of? @keyword.function - "def" "defdelegate" "defexception" "defguard" "defguardp" "defimpl" "defmacro" "defmacrop" - "defmodule" "defn" "defnp" "defoverridable" "defp" "defprotocol" "defstruct")) + target: ((identifier) @keyword.function + (#any-of? @keyword.function + "def" "defdelegate" "defexception" "defguard" "defguardp" "defimpl" "defmacro" "defmacrop" + "defmodule" "defn" "defnp" "defoverridable" "defp" "defprotocol" "defstruct")) (arguments [ (call (identifier) @function) (identifier) @function (binary_operator - left: - (call - target: (identifier) @function) + left: (call + target: (identifier) @function) operator: "when") ])?) ; Kernel Keywords & Special Forms (call - target: - ((identifier) @keyword - (#any-of? @keyword - "alias" "case" "catch" "cond" "else" "for" "if" "import" "quote" "raise" "receive" "require" - "reraise" "super" "throw" "try" "unless" "unquote" "unquote_splicing" "use" "with"))) + target: ((identifier) @keyword + (#any-of? @keyword + "alias" "case" "catch" "cond" "else" "for" "if" "import" "quote" "raise" "receive" "require" + "reraise" "super" "throw" "try" "unless" "unquote" "unquote_splicing" "use" "with"))) ; Special Constants ((identifier) @constant.builtin @@ -160,22 +155,19 @@ ; Capture Operator (unary_operator operator: "&" - operand: - [ - (integer) @operator - (binary_operator - left: - [ - (call - target: - (dot - left: (_) - right: (identifier) @function)) - (identifier) @function - ] - operator: "/" - right: (integer) @operator) - ]) + operand: [ + (integer) @operator + (binary_operator + left: [ + (call + target: (dot + left: (_) + right: (identifier) @function)) + (identifier) @function + ] + operator: "/" + right: (integer) @operator) + ]) ; Non-String Sigils (sigil @@ -199,30 +191,27 @@ ; Module attributes (unary_operator operator: "@" - operand: - [ - (identifier) - (call - target: (identifier)) - ] @constant) @constant + operand: [ + (identifier) + (call + target: (identifier)) + ] @constant) @constant ; Documentation (unary_operator operator: "@" - operand: - (call - target: - ((identifier) @_identifier - (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) @comment.documentation - (arguments - [ - (string) - (boolean) - (charlist) - (sigil - "~" @comment.documentation - (sigil_name) @comment.documentation - quoted_start: _ @comment.documentation - (quoted_content) @comment.documentation - quoted_end: _ @comment.documentation) - ] @comment.documentation))) @comment.documentation + operand: (call + target: ((identifier) @_identifier + (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) @comment.documentation + (arguments + [ + (string) + (boolean) + (charlist) + (sigil + "~" @comment.documentation + (sigil_name) @comment.documentation + quoted_start: _ @comment.documentation + (quoted_content) @comment.documentation + quoted_end: _ @comment.documentation) + ] @comment.documentation))) @comment.documentation diff --git a/queries/elixir/injections.scm b/queries/elixir/injections.scm index b580f2ea6..cc74f792a 100644 --- a/queries/elixir/injections.scm +++ b/queries/elixir/injections.scm @@ -5,19 +5,17 @@ ; Documentation (unary_operator operator: "@" - operand: - (call - target: - ((identifier) @_identifier - (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) - (arguments - [ - (string - (quoted_content) @injection.content) - (sigil - (quoted_content) @injection.content) - ]) - (#set! injection.language "markdown"))) + operand: (call + target: ((identifier) @_identifier + (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) + (arguments + [ + (string + (quoted_content) @injection.content) + (sigil + (quoted_content) @injection.content) + ]) + (#set! injection.language "markdown"))) ; HEEx (sigil diff --git a/queries/elixir/locals.scm b/queries/elixir/locals.scm index 0ce0eab74..ac9d86e36 100644 --- a/queries/elixir/locals.scm +++ b/queries/elixir/locals.scm @@ -5,9 +5,8 @@ ; Module Definitions (call - target: - ((identifier) @_identifier - (#eq? @_identifier "defmodule")) + target: ((identifier) @_identifier + (#eq? @_identifier "defmodule")) (arguments (alias) @local.definition.type)) diff --git a/queries/elm/highlights.scm b/queries/elm/highlights.scm index 86351fe60..fc18566c9 100644 --- a/queries/elm/highlights.scm +++ b/queries/elm/highlights.scm @@ -97,40 +97,34 @@ ; Functions ;---------- (value_declaration - functionDeclarationLeft: - (function_declaration_left - (lower_case_identifier) @function - (pattern))) + functionDeclarationLeft: (function_declaration_left + (lower_case_identifier) @function + (pattern))) (value_declaration - functionDeclarationLeft: - (function_declaration_left - (lower_case_identifier) @function - pattern: (_))) + functionDeclarationLeft: (function_declaration_left + (lower_case_identifier) @function + pattern: (_))) (value_declaration - functionDeclarationLeft: - (function_declaration_left - (lower_case_identifier) @function) + functionDeclarationLeft: (function_declaration_left + (lower_case_identifier) @function) body: (anonymous_function_expr)) (type_annotation name: (lower_case_identifier) @function - typeExpression: - (type_expression - (arrow))) + typeExpression: (type_expression + (arrow))) (port_annotation name: (lower_case_identifier) @function - typeExpression: - (type_expression - (arrow))) + typeExpression: (type_expression + (arrow))) (function_call_expr - target: - (value_expr - (value_qid - (lower_case_identifier) @function.call))) + target: (value_expr + (value_qid + (lower_case_identifier) @function.call))) ; Operators ;---------- diff --git a/queries/erlang/highlights.scm b/queries/erlang/highlights.scm index 1b9aeaf4e..1ce046689 100644 --- a/queries/erlang/highlights.scm +++ b/queries/erlang/highlights.scm @@ -106,10 +106,9 @@ (export_type_attribute) @type.definition (export_type_attribute - types: - (fa - fun: _ @type - (#set! "priority" 101))) + types: (fa + fun: _ @type + (#set! "priority" 101))) (behaviour_attribute) @keyword.import @@ -117,9 +116,8 @@ (atom) @module) @keyword.import (wild_attribute - name: - (attr_name - name: _ @attribute)) @attribute + name: (attr_name + name: _ @attribute)) @attribute ; Records (record_expr) @type @@ -157,12 +155,11 @@ ; expr_function_call (call - expr: - [ - (atom) - (remote) - (var) - ] @function) + expr: [ + (atom) + (remote) + (var) + ] @function) (call (atom) @keyword.exception @@ -170,10 +167,9 @@ ; Parenthesized expression: (SomeFunc)(), only highlight the parens (call - expr: - (paren_expr - "(" @function.call - ")" @function.call)) + expr: (paren_expr + "(" @function.call + ")" @function.call)) ; function (external_fun) @function.call diff --git a/queries/faust/highlights.scm b/queries/faust/highlights.scm index df2c3e70a..6e7ef1d92 100644 --- a/queries/faust/highlights.scm +++ b/queries/faust/highlights.scm @@ -35,12 +35,11 @@ ; Types (_ - type: - [ - (int_type) - (float_type) - (any_type) - ]) @type.builtin + type: [ + (int_type) + (float_type) + (any_type) + ]) @type.builtin [ (single_precision) diff --git a/queries/fennel/folds.scm b/queries/fennel/folds.scm index b4901d96a..ad65bf78c 100644 --- a/queries/fennel/folds.scm +++ b/queries/fennel/folds.scm @@ -27,9 +27,8 @@ (#any-of? @_fn "fn" "lambda" "λ" "hashfn")) @fold (reader_macro - macro: - [ - "'" - "`" - ] + macro: [ + "'" + "`" + ] expression: (_) @fold) diff --git a/queries/fennel/injections.scm b/queries/fennel/injections.scm index cea50c4a3..b6b0bbcfe 100644 --- a/queries/fennel/injections.scm +++ b/queries/fennel/injections.scm @@ -42,14 +42,12 @@ . (table (table_pair - key: - (string - (string_content) @_command - (#eq? @_command "command")) - value: - (string - (string_content) @injection.content - (#set! injection.language "vim"))))) + key: (string + (string_content) @_command + (#eq? @_command "command")) + value: (string + (string_content) @injection.content + (#set! injection.language "vim"))))) (list . diff --git a/queries/fish/highlights.scm b/queries/fish/highlights.scm index 506602098..e8ba18efe 100644 --- a/queries/fish/highlights.scm +++ b/queries/fish/highlights.scm @@ -98,11 +98,10 @@ ; Commands (command - argument: - [ - (word) @variable.parameter - (#lua-match? @variable.parameter "^[-]") - ]) + argument: [ + (word) @variable.parameter + (#lua-match? @variable.parameter "^[-]") + ]) (command_substitution "$" @punctuation.bracket) @@ -113,15 +112,14 @@ ; derived from builtin -n (fish 3.2.2) (command - name: - [ - (word) @function.builtin - (#any-of? @function.builtin - "." ":" "_" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd" "command" - "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec" "exit" "fg" - "functions" "history" "isatty" "jobs" "math" "printf" "pwd" "random" "read" "realpath" "set" - "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait") - ]) + name: [ + (word) @function.builtin + (#any-of? @function.builtin + "." ":" "_" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd" "command" + "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec" "exit" "fg" + "functions" "history" "isatty" "jobs" "math" "printf" "pwd" "random" "read" "realpath" "set" + "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait") + ]) ; Functions (function_definition @@ -131,19 +129,17 @@ ] @keyword.function) (function_definition - name: - [ - (word) - (concatenation) - ] @function) + name: [ + (word) + (concatenation) + ] @function) (function_definition - option: - [ - (word) - (concatenation - (word)) - ] @variable.parameter + option: [ + (word) + (concatenation + (word)) + ] @variable.parameter (#lua-match? @variable.parameter "^[-]")) ; Strings diff --git a/queries/foam/locals.scm b/queries/foam/locals.scm index 508643672..f3f689081 100644 --- a/queries/foam/locals.scm +++ b/queries/foam/locals.scm @@ -7,6 +7,5 @@ keyword: (_) @local.definition.parameter) (key_value - value: - (macro - (identifier)*)* @local.reference) + value: (macro + (identifier)*)* @local.reference) diff --git a/queries/gdshader/highlights.scm b/queries/gdshader/highlights.scm index 334aece0f..fb8c053e7 100644 --- a/queries/gdshader/highlights.scm +++ b/queries/gdshader/highlights.scm @@ -130,11 +130,10 @@ member: (ident) @property) (call_expr - function: - [ - (ident) - (builtin_type) - ] @function) + function: [ + (ident) + (builtin_type) + ] @function) (call_expr function: (builtin_type) @function.call) diff --git a/queries/git_config/injections.scm b/queries/git_config/injections.scm index dcccb21ba..7a53af2ee 100644 --- a/queries/git_config/injections.scm +++ b/queries/git_config/injections.scm @@ -21,10 +21,9 @@ (section_header (section_name) @_alias) (variable - value: - (string - "\"" - "\"") @injection.content) + value: (string + "\"" + "\"") @injection.content) (#eq? @_alias "alias") (#lua-match? @injection.content "^\"!") (#offset! @injection.content 0 2 0 -1) diff --git a/queries/gleam/highlights.scm b/queries/gleam/highlights.scm index 49dd8777c..8754f3ed6 100644 --- a/queries/gleam/highlights.scm +++ b/queries/gleam/highlights.scm @@ -92,8 +92,7 @@ (module) @module (import - alias: - ((identifier) @module)?) + alias: ((identifier) @module)?) (remote_type_identifier module: (identifier) @module) @@ -114,10 +113,9 @@ ; Function Parameter Labels (function_call - arguments: - (arguments - (argument - label: (label) @label))) + arguments: (arguments + (argument + label: (label) @label))) (function_parameter label: (label)? @label @@ -125,10 +123,9 @@ ; Records (record - arguments: - (arguments - (argument - label: (label) @variable.member)?)) + arguments: (arguments + (argument + label: (label) @variable.member)?)) (record_pattern_argument label: (label) @variable.member) @@ -173,9 +170,8 @@ function: (identifier) @function.call) (function_call - function: - (field_access - field: (label) @function.call)) + function: (field_access + field: (label) @function.call)) ; External Functions (external_function diff --git a/queries/glimmer/highlights.scm b/queries/glimmer/highlights.scm index 1f2c4ed8a..9f11468d4 100644 --- a/queries/glimmer/highlights.scm +++ b/queries/glimmer/highlights.scm @@ -50,12 +50,11 @@ ; As are arguments in a block statement (block_statement_start - argument: - [ - (path_expression - (identifier) @variable) - (identifier) @variable - ]) + argument: [ + (path_expression + (identifier) @variable) + (identifier) @variable + ]) ; As is an identifier in a block param (block_params @@ -63,12 +62,11 @@ ; As are helper arguments ((helper_invocation - argument: - [ - (path_expression - (identifier) @variable) - (identifier) @variable - ]) + argument: [ + (path_expression + (identifier) @variable) + (identifier) @variable + ]) (#not-eq? @variable "this")) ; `this` should be highlighted as a built-in variable @@ -82,12 +80,11 @@ ; Helpers are functions ((helper_invocation - helper: - [ - (path_expression - (identifier) @function) - (identifier) @function - ]) + helper: [ + (path_expression + (identifier) @function) + (identifier) @function + ]) (#not-any-of? @function "if" "yield")) ((helper_invocation diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm index 2fa3973d7..715fd133a 100644 --- a/queries/go/highlights.scm +++ b/queries/go/highlights.scm @@ -29,9 +29,8 @@ function: (identifier) @function.call) (call_expression - function: - (selector_expression - field: (field_identifier) @function.method.call)) + function: (selector_expression + field: (field_identifier) @function.method.call)) ; Function definitions (function_declaration diff --git a/queries/go/injections.scm b/queries/go/injections.scm index 3bc76cd7a..38ba3e110 100644 --- a/queries/go/injections.scm +++ b/queries/go/injections.scm @@ -20,24 +20,20 @@ (#set! injection.language "re2c")) ((call_expression - function: - (selector_expression - field: (field_identifier) @_method) - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content)) + function: (selector_expression + field: (field_identifier) @_method) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content)) (#any-of? @_method "Printf" "Sprintf" "Fatalf" "Scanf" "Errorf" "Skipf" "Logf") (#set! injection.language "printf")) ((call_expression - function: - (selector_expression - field: (field_identifier) @_method) - arguments: - (argument_list - (_) - . - (interpreted_string_literal) @injection.content)) + function: (selector_expression + field: (field_identifier) @_method) + arguments: (argument_list + (_) + . + (interpreted_string_literal) @injection.content)) (#any-of? @_method "Fprintf" "Fscanf" "Appendf" "Sscanf") (#set! injection.language "printf")) diff --git a/queries/go/locals.scm b/queries/go/locals.scm index a8325f97c..608c45826 100644 --- a/queries/go/locals.scm +++ b/queries/go/locals.scm @@ -7,9 +7,8 @@ ) (short_var_declaration - left: - (expression_list - (identifier) @local.definition.var)) + left: (expression_list + (identifier) @local.definition.var)) (var_spec name: (identifier) @local.definition.var) @@ -22,9 +21,8 @@ (for_statement (range_clause - left: - (expression_list - (identifier) @local.definition.var))) + left: (expression_list + (identifier) @local.definition.var))) (const_declaration (const_spec @@ -57,22 +55,19 @@ (#set! reference.kind "call")) ((call_expression - function: - (selector_expression - field: (field_identifier) @local.reference)) + function: (selector_expression + field: (field_identifier) @local.reference)) (#set! reference.kind "call")) ((call_expression - function: - (parenthesized_expression - (identifier) @local.reference)) + function: (parenthesized_expression + (identifier) @local.reference)) (#set! reference.kind "call")) ((call_expression - function: - (parenthesized_expression - (selector_expression - field: (field_identifier) @local.reference))) + function: (parenthesized_expression + (selector_expression + field: (field_identifier) @local.reference))) (#set! reference.kind "call")) ; Scopes diff --git a/queries/gotmpl/highlights.scm b/queries/gotmpl/highlights.scm index e1629f816..ba69dc07d 100644 --- a/queries/gotmpl/highlights.scm +++ b/queries/gotmpl/highlights.scm @@ -11,9 +11,8 @@ function: (identifier) @function) (method_call - method: - (selector_expression - field: (field_identifier) @function)) + method: (selector_expression + field: (field_identifier) @function)) ; Builtin functions (function_call diff --git a/queries/gotmpl/injections.scm b/queries/gotmpl/injections.scm index 787ca9925..3cfc26361 100644 --- a/queries/gotmpl/injections.scm +++ b/queries/gotmpl/injections.scm @@ -4,20 +4,18 @@ ; {{"put" | printf "%s%s" "out" | printf "%q"}} (function_call function: (identifier) @_function - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) (#eq? @_function "printf") (#set! injection.language "printf")) ; {{ js "var a = 1 + 1" }} (function_call function: (identifier) @_function - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) (#eq? @_function "js") (#offset! @injection.content 0 1 0 -1) (#set! injection.language "javascript")) @@ -25,10 +23,9 @@ ; {{ html "<h1>hello</h1>" }} (function_call function: (identifier) @_function - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) (#eq? @_function "html") (#offset! @injection.content 0 1 0 -1) (#set! injection.language "html")) diff --git a/queries/groovy/highlights.scm b/queries/groovy/highlights.scm index 1dad58363..0266ee1f7 100644 --- a/queries/groovy/highlights.scm +++ b/queries/groovy/highlights.scm @@ -215,9 +215,8 @@ function: (identifier) @function) (function_call - function: - (dotted_identifier - (identifier) @function .)) + function: (dotted_identifier + (identifier) @function .)) (function_call (argument_list @@ -228,9 +227,8 @@ function: (identifier) @function) (juxt_function_call - function: - (dotted_identifier - (identifier) @function .)) + function: (dotted_identifier + (identifier) @function .)) (juxt_function_call (argument_list diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm index f561dfe36..35d71e722 100644 --- a/queries/hack/highlights.scm +++ b/queries/hack/highlights.scm @@ -195,20 +195,17 @@ (variable) @variable.parameter) (call_expression - function: - (qualified_identifier - (identifier) @function.call .)) + function: (qualified_identifier + (identifier) @function.call .)) (call_expression - function: - (scoped_identifier - (identifier) @function.call .)) + function: (scoped_identifier + (identifier) @function.call .)) (call_expression - function: - (selection_expression - (qualified_identifier - (identifier) @function.method.call .))) + function: (selection_expression + (qualified_identifier + (identifier) @function.method.call .))) (qualified_identifier (_) @module diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm index 33d9d2950..9cb4c8104 100644 --- a/queries/haskell/highlights.scm +++ b/queries/haskell/highlights.scm @@ -7,23 +7,20 @@ (pat_wildcard) @variable (function - patterns: - (patterns - (_) @variable.parameter)) + patterns: (patterns + (_) @variable.parameter)) (exp_lambda (_)+ @variable.parameter "->") (function - infix: - (infix - lhs: (_) @variable.parameter)) + infix: (infix + lhs: (_) @variable.parameter)) (function - infix: - (infix - rhs: (_) @variable.parameter)) + infix: (infix + rhs: (_) @variable.parameter)) ; ---------------------------------------------------------------------------- ; Literals and comments @@ -185,7 +182,24 @@ (function name: (variable) @variable - rhs: + rhs: [ + (exp_literal) + (exp_apply + (exp_name + [ + (constructor) + (variable) + (qualified_variable) + ])) + (quasiquote) + ((exp_name) + . + (operator)) + ]) + +(function + name: (variable) @variable + rhs: (exp_infix [ (exp_literal) (exp_apply @@ -199,26 +213,7 @@ ((exp_name) . (operator)) - ]) - -(function - name: (variable) @variable - rhs: - (exp_infix - [ - (exp_literal) - (exp_apply - (exp_name - [ - (constructor) - (variable) - (qualified_variable) - ])) - (quasiquote) - ((exp_name) - . - (operator)) - ])) + ])) ; Consider signatures (and accompanying functions) ; with only one value on the rhs as variables @@ -403,14 +398,13 @@ ; function defined in terms of a function composition (function name: (variable) @function - rhs: - (exp_infix - (_) - . - (operator) @_op - . - (_) - (#any-of? @_op "." ">>>" "***" ">=>" "<=<"))) + rhs: (exp_infix + (_) + . + (operator) @_op + . + (_) + (#any-of? @_op "." ">>>" "***" ">=>" "<=<"))) (exp_apply (exp_name @@ -486,9 +480,8 @@ ; scoped function types (func :: a -> b) (pat_typed - pattern: - (pat_name - (variable) @function) + pattern: (pat_name + (variable) @function) type: (fun)) ; signatures that have a function type @@ -618,12 +611,11 @@ (variable) @variable.member)) (exp_field - field: - [ - (variable) @variable.member - (qualified_variable - (variable) @variable.member) - ]) + field: [ + (variable) @variable.member + (qualified_variable + (variable) @variable.member) + ]) ; ---------------------------------------------------------------------------- ; Spell checking diff --git a/queries/hcl/highlights.scm b/queries/hcl/highlights.scm index 45a120dff..4fb7d1fca 100644 --- a/queries/hcl/highlights.scm +++ b/queries/hcl/highlights.scm @@ -104,10 +104,9 @@ ; ; highlight identifier keys as though they were block attributes (object_elem - key: - (expression - (variable_expr - (identifier) @variable.member))) + key: (expression + (variable_expr + (identifier) @variable.member))) ; var.foo, data.bar ; diff --git a/queries/helm/highlights.scm b/queries/helm/highlights.scm index ab5803a8a..05028ba93 100644 --- a/queries/helm/highlights.scm +++ b/queries/helm/highlights.scm @@ -31,11 +31,10 @@ ; {{ .Values.test }} (selector_expression - operand: - (field - name: (identifier) @constant.builtin - (#any-of? @constant.builtin - "Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template")) + operand: (field + name: (identifier) @constant.builtin + (#any-of? @constant.builtin + "Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template")) (field_identifier)) ; {{ $.Values.test }} diff --git a/queries/helm/injections.scm b/queries/helm/injections.scm index 12f1b7cc7..2adf8743a 100644 --- a/queries/helm/injections.scm +++ b/queries/helm/injections.scm @@ -7,10 +7,9 @@ ; {{ regexFind "[a-zA-Z][1-9]" "abcd1234" }} (function_call function: (identifier) @_function - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) (#any-of? @_function "regexMatch" "mustRegexMatch" "regexFindAll" "mustRegexFinDall" "regexFind" "mustRegexFind" "regexReplaceAll" "mustRegexReplaceAll" "regexReplaceAllLiteral" "mustRegexReplaceAllLiteral" @@ -20,20 +19,18 @@ (function_call function: (identifier) @_function - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) (#any-of? @_function "fromYaml" "fromYamlArray") (#offset! @injection.content 0 1 0 -1) (#set! injection.language "yaml")) (function_call function: (identifier) @_function - arguments: - (argument_list - . - (interpreted_string_literal) @injection.content) + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) (#any-of? @_function "fromJson" "fromJsonArray") (#offset! @injection.content 0 1 0 -1) (#set! injection.language "json")) diff --git a/queries/java/highlights.scm b/queries/java/highlights.scm index b515358e1..07bc6cd2f 100644 --- a/queries/java/highlights.scm +++ b/queries/java/highlights.scm @@ -111,9 +111,8 @@ ; Fields (field_declaration - declarator: - (variable_declarator - name: (identifier) @variable.member)) + declarator: (variable_declarator + name: (identifier) @variable.member)) (field_access field: (identifier) @variable.member) diff --git a/queries/java/injections.scm b/queries/java/injections.scm index 8113bea28..2ad7e5fe1 100644 --- a/queries/java/injections.scm +++ b/queries/java/injections.scm @@ -10,19 +10,17 @@ ((method_invocation name: (identifier) @_method - arguments: - (argument_list + arguments: (argument_list + . + (string_literal . - (string_literal - . - (_) @injection.content))) + (_) @injection.content))) (#any-of? @_method "format" "printf") (#set! injection.language "printf")) ((method_invocation - object: - (string_literal - (string_fragment) @injection.content) + object: (string_literal + (string_fragment) @injection.content) name: (identifier) @_method) (#eq? @_method "formatted") (#set! injection.language "printf")) diff --git a/queries/java/locals.scm b/queries/java/locals.scm index ac0715c93..53e950908 100644 --- a/queries/java/locals.scm +++ b/queries/java/locals.scm @@ -67,9 +67,8 @@ name: (identifier) @local.definition.method) (local_variable_declaration - declarator: - (variable_declarator - name: (identifier) @local.definition.var)) + declarator: (variable_declarator + name: (identifier) @local.definition.var)) (enhanced_for_statement ; for (var item : items) { @@ -92,9 +91,8 @@ (#has-ancestor? @local.definition.import import_declaration)) (field_declaration - declarator: - (variable_declarator - name: (identifier) @local.definition.field)) + declarator: (variable_declarator + name: (identifier) @local.definition.field)) ; REFERENCES (identifier) @local.reference diff --git a/queries/javascript/locals.scm b/queries/javascript/locals.scm index 892901c26..6d6846fc7 100644 --- a/queries/javascript/locals.scm +++ b/queries/javascript/locals.scm @@ -7,18 +7,16 @@ ; this.quuz = "qux"; ; } (field_definition - property: - [ - (property_identifier) - (private_property_identifier) - ] @local.definition.var) + property: [ + (property_identifier) + (private_property_identifier) + ] @local.definition.var) ; this.foo = "bar" (assignment_expression - left: - (member_expression - object: (this) - property: (property_identifier) @local.definition.var)) + left: (member_expression + object: (this) + property: (property_identifier) @local.definition.var)) (formal_parameters (identifier) @local.definition.parameter) diff --git a/queries/jsonnet/highlights.scm b/queries/jsonnet/highlights.scm index 85670a25c..1e67baa32 100644 --- a/queries/jsonnet/highlights.scm +++ b/queries/jsonnet/highlights.scm @@ -104,15 +104,13 @@ ; Functions (field - function: - (fieldname - (id) @function)) + function: (fieldname + (id) @function)) (field - function: - (fieldname - (string - (string_content) @function))) + function: (fieldname + (string + (string_content) @function))) (param identifier: (id) @variable.parameter) diff --git a/queries/jsonnet/locals.scm b/queries/jsonnet/locals.scm index ca03ef077..aa3a16c75 100644 --- a/queries/jsonnet/locals.scm +++ b/queries/jsonnet/locals.scm @@ -9,9 +9,8 @@ (local_bind) @local.scope (field - function: - (fieldname - (id) @local.definition.function) + function: (fieldname + (id) @local.definition.function) (#set! "definition.function.scope" "parent")) (bind diff --git a/queries/jsx/highlights.scm b/queries/jsx/highlights.scm index 468eb8a3c..deb3c1598 100644 --- a/queries/jsx/highlights.scm +++ b/queries/jsx/highlights.scm @@ -1,18 +1,16 @@ (jsx_element - open_tag: - (jsx_opening_element - [ - "<" - ">" - ] @tag.delimiter)) + open_tag: (jsx_opening_element + [ + "<" + ">" + ] @tag.delimiter)) (jsx_element - close_tag: - (jsx_closing_element - [ - "</" - ">" - ] @tag.delimiter)) + close_tag: (jsx_closing_element + [ + "</" + ">" + ] @tag.delimiter)) (jsx_self_closing_element [ diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index 1ff8b8e4e..5b8cf5bbb 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -31,14 +31,12 @@ name: (identifier) @function) (function_definition - name: - (field_expression - (identifier) @function .)) + name: (field_expression + (identifier) @function .)) (short_function_definition - name: - (field_expression - (identifier) @function .)) + name: (field_expression + (identifier) @function .)) ; calls (call_expression diff --git a/queries/latex/highlights.scm b/queries/latex/highlights.scm index 819a2ff94..1d795fc23 100644 --- a/queries/latex/highlights.scm +++ b/queries/latex/highlights.scm @@ -42,22 +42,19 @@ ; General environments (begin command: _ @module - name: - (curly_group_text - (text) @label)) + name: (curly_group_text + (text) @label)) (end command: _ @module - name: - (curly_group_text - (text) @label)) + name: (curly_group_text + (text) @label)) ; Definitions and references (new_command_definition command: _ @function.macro - declaration: - (curly_group_command_name - (_) @function)) + declaration: (curly_group_command_name + (_) @function)) (old_command_definition command: _ @function.macro @@ -69,48 +66,40 @@ (environment_definition command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (theorem_definition command: _ @function.macro - name: - (curly_group_text - (_) @label)) + name: (curly_group_text + (_) @label)) (paired_delimiter_definition command: _ @function.macro - declaration: - (curly_group_command_name - (_) @function)) + declaration: (curly_group_command_name + (_) @function)) (label_definition command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (label_reference_range command: _ @function.macro - from: - (curly_group_text - (_) @markup.link) - to: - (curly_group_text - (_) @markup.link)) + from: (curly_group_text + (_) @markup.link) + to: (curly_group_text + (_) @markup.link)) (label_reference command: _ @function.macro - names: - (curly_group_text_list - (_) @markup.link)) + names: (curly_group_text_list + (_) @markup.link)) (label_number command: _ @function.macro - name: - (curly_group_text - (_) @markup.link) + name: (curly_group_text + (_) @markup.link) number: (_) @markup.link) (citation @@ -119,52 +108,44 @@ (glossary_entry_definition command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (glossary_entry_reference command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (acronym_definition command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (acronym_reference command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (color_definition command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) (color_reference command: _ @function.macro - name: - (curly_group_text - (_) @markup.link)) + name: (curly_group_text + (_) @markup.link)) ; Formatting (text_mode - content: - (curly_group - (_) @none @spell)) + content: (curly_group + (_) @none @spell)) (math_environment (begin command: _ @markup.math - name: - (curly_group_text - (_) @markup.math))) + name: (curly_group_text + (_) @markup.math))) (math_environment (_) @markup.math) @@ -172,95 +153,76 @@ (math_environment (end command: _ @markup.math - name: - (curly_group_text - (_) @markup.math))) + name: (curly_group_text + (_) @markup.math))) ; Sectioning (title_declaration command: _ @module - options: - (brack_group - (_) @markup.heading.1)? - text: - (curly_group - (_) @markup.heading.1)) + options: (brack_group + (_) @markup.heading.1)? + text: (curly_group + (_) @markup.heading.1)) (author_declaration command: _ @module - authors: - (curly_group_author_list - (author)+ @markup.heading.1)) + authors: (curly_group_author_list + (author)+ @markup.heading.1)) (chapter command: _ @module - toc: - (brack_group - (_) @markup.heading.2)? - text: - (curly_group - (_) @markup.heading.2)) + toc: (brack_group + (_) @markup.heading.2)? + text: (curly_group + (_) @markup.heading.2)) (part command: _ @module - toc: - (brack_group - (_) @markup.heading.2)? - text: - (curly_group - (_) @markup.heading.2)) + toc: (brack_group + (_) @markup.heading.2)? + text: (curly_group + (_) @markup.heading.2)) (section command: _ @module - toc: - (brack_group - (_) @markup.heading.3)? - text: - (curly_group - (_) @markup.heading.3)) + toc: (brack_group + (_) @markup.heading.3)? + text: (curly_group + (_) @markup.heading.3)) (subsection command: _ @module - toc: - (brack_group - (_) @markup.heading.4)? - text: - (curly_group - (_) @markup.heading.4)) + toc: (brack_group + (_) @markup.heading.4)? + text: (curly_group + (_) @markup.heading.4)) (subsubsection command: _ @module - toc: - (brack_group - (_) @markup.heading.5)? - text: - (curly_group - (_) @markup.heading.5)) + toc: (brack_group + (_) @markup.heading.5)? + text: (curly_group + (_) @markup.heading.5)) (paragraph command: _ @module - toc: - (brack_group - (_) @markup.heading.6)? - text: - (curly_group - (_) @markup.heading.6)) + toc: (brack_group + (_) @markup.heading.6)? + text: (curly_group + (_) @markup.heading.6)) (subparagraph command: _ @module - toc: - (brack_group - (_) @markup.heading.6)? - text: - (curly_group - (_) @markup.heading.6)) + toc: (brack_group + (_) @markup.heading.6)? + text: (curly_group + (_) @markup.heading.6)) ; Beamer frames (generic_environment (begin - name: - (curly_group_text - (text) @label) + name: (curly_group_text + (text) @label) (#any-of? @label "frame")) . (curly_group @@ -268,38 +230,33 @@ ((generic_command command: (command_name) @_name - arg: - (curly_group - (text) @markup.heading)) + arg: (curly_group + (text) @markup.heading)) (#eq? @_name "\\frametitle")) ((generic_command command: (command_name) @_name - arg: - (curly_group - (_) @markup.italic)) + arg: (curly_group + (_) @markup.italic)) (#eq? @_name "\\emph")) ((generic_command command: (command_name) @_name - arg: - (curly_group - (_) @markup.italic)) + arg: (curly_group + (_) @markup.italic)) (#any-of? @_name "\\textit" "\\mathit")) ((generic_command command: (command_name) @_name - arg: - (curly_group - (_) @markup.strong)) + arg: (curly_group + (_) @markup.strong)) (#any-of? @_name "\\textbf" "\\mathbf")) ((generic_command command: (command_name) @_name . - arg: - (curly_group - (_) @markup.link.url)) + arg: (curly_group + (_) @markup.link.url)) (#any-of? @_name "\\url" "\\href")) ; File inclusion commands diff --git a/queries/latex/injections.scm b/queries/latex/injections.scm index 189987a38..c0dbdc0a6 100644 --- a/queries/latex/injections.scm +++ b/queries/latex/injections.scm @@ -19,15 +19,13 @@ (minted_environment (begin - language: - (curly_group_text - (text) @injection.language)) + language: (curly_group_text + (text) @injection.language)) (source_code) @injection.content) ((generic_environment (begin - name: - (curly_group_text - (text) @_env))) @injection.content + name: (curly_group_text + (text) @_env))) @injection.content (#set! injection.language "c") (#any-of? @_env "asy" "asydef")) diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 053d8116d..0c8f07f29 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -180,27 +180,24 @@ (vararg_expression) @variable.parameter.builtin (function_declaration - name: - [ - (identifier) @function - (dot_index_expression - field: (identifier) @function) - ]) + name: [ + (identifier) @function + (dot_index_expression + field: (identifier) @function) + ]) (function_declaration - name: - (method_index_expression - method: (identifier) @function.method)) + name: (method_index_expression + method: (identifier) @function.method)) (assignment_statement (variable_list . - name: - [ - (identifier) @function - (dot_index_expression - field: (identifier) @function) - ]) + name: [ + (identifier) @function + (dot_index_expression + field: (identifier) @function) + ]) (expression_list . value: (function_definition))) @@ -211,14 +208,13 @@ value: (function_definition))) (function_call - name: - [ - (identifier) @function.call - (dot_index_expression - field: (identifier) @function.call) - (method_index_expression - method: (identifier) @function.method.call) - ]) + name: [ + (identifier) @function.call + (dot_index_expression + field: (identifier) @function.call) + (method_index_expression + method: (identifier) @function.method.call) + ]) (function_call (identifier) @function.builtin @@ -253,21 +249,19 @@ (dot_index_expression field: (identifier) @_method (#any-of? @_method "find" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (_) - . - (string - content: (string_content) @string.regexp))) + arguments: (arguments + . + (_) + . + (string + content: (string_content) @string.regexp))) ;("123"):match("%d+") (function_call (method_index_expression method: (identifier) @_method (#any-of? @_method "find" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (string - content: (string_content) @string.regexp))) + arguments: (arguments + . + (string + content: (string_content) @string.regexp))) diff --git a/queries/lua/injections.scm b/queries/lua/injections.scm index d1dcf87d6..4fccbcb14 100644 --- a/queries/lua/injections.scm +++ b/queries/lua/injections.scm @@ -1,49 +1,44 @@ ((function_call - name: - [ - (identifier) @_cdef_identifier - (_ - _ - (identifier) @_cdef_identifier) - ] - arguments: - (arguments - (string - content: _ @injection.content))) + name: [ + (identifier) @_cdef_identifier + (_ + _ + (identifier) @_cdef_identifier) + ] + arguments: (arguments + (string + content: _ @injection.content))) (#set! injection.language "c") (#eq? @_cdef_identifier "cdef")) ((function_call name: (_) @_vimcmd_identifier - arguments: - (arguments - (string - content: _ @injection.content))) + arguments: (arguments + (string + content: _ @injection.content))) (#set! injection.language "vim") (#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_command" "vim.api.nvim_exec2")) ((function_call name: (_) @_vimcmd_identifier - arguments: - (arguments - (string - content: _ @injection.content) .)) + arguments: (arguments + (string + content: _ @injection.content) .)) (#set! injection.language "query") (#any-of? @_vimcmd_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse")) ((function_call name: (_) @_vimcmd_identifier - arguments: - (arguments - . - (_) - . - (string - content: _ @_method) - . - (string - content: _ @injection.content))) + arguments: (arguments + . + (_) + . + (string + content: _ @_method) + . + (string + content: _ @injection.content))) (#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify") (#eq? @_method "nvim_exec_lua") (#set! injection.language "lua")) @@ -51,17 +46,15 @@ ; vim.api.nvim_create_autocmd("FileType", { command = "injected here" }) (function_call name: (_) @_vimcmd_identifier - arguments: - (arguments - . - (_) - . - (table_constructor - (field - name: (identifier) @_command - value: - (string - content: (_) @injection.content))) .) + arguments: (arguments + . + (_) + . + (table_constructor + (field + name: (identifier) @_command + value: (string + content: (_) @injection.content))) .) ; limit so only 2-argument functions gets matched before pred handle (#eq? @_vimcmd_identifier "vim.api.nvim_create_autocmd") (#eq? @_command "command") @@ -69,31 +62,29 @@ (function_call name: (_) @_user_cmd - arguments: - (arguments - . - (_) - . - (string - content: (_) @injection.content) - . - (_) .) + arguments: (arguments + . + (_) + . + (string + content: (_) @injection.content) + . + (_) .) (#eq? @_user_cmd "vim.api.nvim_create_user_command") (#set! injection.language "vim")) (function_call name: (_) @_user_cmd - arguments: - (arguments - . - (_) - . - (_) - . - (string - content: (_) @injection.content) - . - (_) .) + arguments: (arguments + . + (_) + . + (_) + . + (string + content: (_) @injection.content) + . + (_) .) ; Limiting predicate handling to only functions with 4 arguments (#eq? @_user_cmd "vim.api.nvim_buf_create_user_command") (#set! injection.language "vim")) @@ -141,48 +132,44 @@ (dot_index_expression field: (identifier) @_method (#any-of? @_method "find" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (_) - . - (string - content: (string_content) @injection.content - (#set! injection.language "luap") - (#set! injection.include-children)))) + arguments: (arguments + . + (_) + . + (string + content: (string_content) @injection.content + (#set! injection.language "luap") + (#set! injection.include-children)))) ;("123"):match("%d+") (function_call (method_index_expression method: (identifier) @_method (#any-of? @_method "find" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (string - content: (string_content) @injection.content - (#set! injection.language "luap") - (#set! injection.include-children)))) + arguments: (arguments + . + (string + content: (string_content) @injection.content + (#set! injection.language "luap") + (#set! injection.include-children)))) ; string.format("pi = %.2f", 3.14159) ((function_call (dot_index_expression field: (identifier) @_method) - arguments: - (arguments - . - (string - (string_content) @injection.content))) + arguments: (arguments + . + (string + (string_content) @injection.content))) (#eq? @_method "format") (#set! injection.language "printf")) ; ("pi = %.2f"):format(3.14159) ((function_call (method_index_expression - table: - (_ - (string - (string_content) @injection.content)) + table: (_ + (string + (string_content) @injection.content)) method: (identifier) @_method)) (#eq? @_method "format") (#set! injection.language "printf")) diff --git a/queries/lua/locals.scm b/queries/lua/locals.scm index 8f50e844f..c4f36e8d4 100644 --- a/queries/lua/locals.scm +++ b/queries/lua/locals.scm @@ -27,19 +27,17 @@ (#set! definition.function.scope "parent")) ((function_declaration - name: - (dot_index_expression - . - (_) @local.definition.associated - (identifier) @local.definition.function)) + name: (dot_index_expression + . + (_) @local.definition.associated + (identifier) @local.definition.function)) (#set! definition.method.scope "parent")) ((function_declaration - name: - (method_index_expression - . - (_) @local.definition.associated - (identifier) @local.definition.method)) + name: (method_index_expression + . + (_) @local.definition.associated + (identifier) @local.definition.method)) (#set! definition.method.scope "parent")) (for_generic_clause diff --git a/queries/luau/highlights.scm b/queries/luau/highlights.scm index 8b71a31eb..08ed56b83 100644 --- a/queries/luau/highlights.scm +++ b/queries/luau/highlights.scm @@ -199,14 +199,12 @@ name: (identifier) @function) (function_call - name: - (dot_index_expression - field: (identifier) @function.call)) + name: (dot_index_expression + field: (identifier) @function.call)) (function_declaration - name: - (dot_index_expression - field: (identifier) @function)) + name: (dot_index_expression + field: (identifier) @function)) (method_index_expression method: (identifier) @function.method.call) @@ -256,13 +254,12 @@ ] @punctuation.bracket (variable_list - attribute: - (attribute - ([ - "<" - ">" - ] @punctuation.bracket - (identifier) @attribute))) + attribute: (attribute + ([ + "<" + ">" + ] @punctuation.bracket + (identifier) @attribute))) (generic_type [ @@ -290,21 +287,19 @@ (dot_index_expression field: (identifier) @_method (#any-of? @_method "find" "format" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (_) - . - (string - content: _ @string.regexp))) + arguments: (arguments + . + (_) + . + (string + content: _ @string.regexp))) ; ("123"):match("%d+") (function_call (method_index_expression method: (identifier) @_method (#any-of? @_method "find" "format" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (string - content: _ @string.regexp))) + arguments: (arguments + . + (string + content: _ @string.regexp))) diff --git a/queries/luau/injections.scm b/queries/luau/injections.scm index 4563f8ed4..558791520 100644 --- a/queries/luau/injections.scm +++ b/queries/luau/injections.scm @@ -1,15 +1,13 @@ ((function_call - name: - [ - (identifier) @_cdef_identifier - (_ - _ - (identifier) @_cdef_identifier) - ] - arguments: - (arguments - (string - content: _ @injection.content))) + name: [ + (identifier) @_cdef_identifier + (_ + _ + (identifier) @_cdef_identifier) + ] + arguments: (arguments + (string + content: _ @injection.content))) (#eq? @_cdef_identifier "cdef") (#set! injection.language "c")) @@ -23,13 +21,12 @@ (dot_index_expression field: (identifier) @_method (#any-of? @_method "find" "format" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (_) - . - (string - content: _ @injection.content)) + arguments: (arguments + . + (_) + . + (string + content: _ @injection.content)) (#set! injection.language "luap")) ; ("123"):match("%d+") @@ -37,11 +34,10 @@ (method_index_expression method: (identifier) @_method (#any-of? @_method "find" "format" "match" "gmatch" "gsub")) - arguments: - (arguments - . - (string - content: _ @injection.content)) + arguments: (arguments + . + (string + content: _ @injection.content)) (#set! injection.language "luap")) ((comment) @injection.content diff --git a/queries/luau/locals.scm b/queries/luau/locals.scm index 8e45c4743..d5420b4c8 100644 --- a/queries/luau/locals.scm +++ b/queries/luau/locals.scm @@ -30,19 +30,17 @@ (#set! definition.function.scope "parent")) ((function_declaration - name: - (dot_index_expression - . - (_) @local.definition.associated - (identifier) @local.definition.function)) + name: (dot_index_expression + . + (_) @local.definition.associated + (identifier) @local.definition.function)) (#set! definition.method.scope "parent")) ((function_declaration - name: - (method_index_expression - . - (_) @local.definition.associated - (identifier) @local.definition.method)) + name: (method_index_expression + . + (_) @local.definition.associated + (identifier) @local.definition.method)) (#set! definition.method.scope "parent")) (for_generic_clause diff --git a/queries/m68k/locals.scm b/queries/m68k/locals.scm index 6e958b6f5..54e948a4b 100644 --- a/queries/m68k/locals.scm +++ b/queries/m68k/locals.scm @@ -20,8 +20,7 @@ name: (symbol) @local.definition.constant) (external_reference - symbols: - (symbol_list - (symbol) @local.definition.import)) + symbols: (symbol_list + (symbol) @local.definition.import)) (symbol) @local.reference diff --git a/queries/make/highlights.scm b/queries/make/highlights.scm index b02dc4eba..f51616006 100644 --- a/queries/make/highlights.scm +++ b/queries/make/highlights.scm @@ -48,9 +48,8 @@ "include" "-include" ] @keyword.import - filenames: - (list - (word) @string.special.path)) + filenames: (list + (word) @string.special.path)) (variable_assignment name: (word) @string.special.symbol diff --git a/queries/nickel/highlights.scm b/queries/nickel/highlights.scm index 3bb63ca2c..07673d797 100644 --- a/queries/nickel/highlights.scm +++ b/queries/nickel/highlights.scm @@ -66,11 +66,9 @@ (builtin) @function.builtin (fun_expr - pats: - (pattern_fun - (ident) @variable.parameter)) + pats: (pattern_fun + (ident) @variable.parameter)) (applicative - t1: - (applicative - (record_operand) @function)) + t1: (applicative + (record_operand) @function)) diff --git a/queries/nim/highlights.scm b/queries/nim/highlights.scm index 104979b3f..c5207ff62 100644 --- a/queries/nim/highlights.scm +++ b/queries/nim/highlights.scm @@ -35,20 +35,16 @@ ; NOTE: has to be before literals and punctuation etc. ; identifiers in "case" "of" branches have to be enums (case - alternative: - (of_branch - values: - (expression_list - (_) @constant))) + alternative: (of_branch + values: (expression_list + (_) @constant))) ; NOTE: has to be before literals and punctuation etc. ; in variant objects with "case" "of" (variant_declaration - alternative: - (of_branch - values: - (expression_list - (_) @constant))) + alternative: (of_branch + values: (expression_list + (_) @constant))) ; NOTE: has to be before literals and punctuation etc. ; ============================================================================= @@ -154,9 +150,8 @@ (colon_expression left: (identifier) @_emit_keyword (#eq? @_emit_keyword "emit") - right: - (_ - (string_content) @none)))) + right: (_ + (string_content) @none)))) ; ============================================================================= ; @string.escape ; escape sequences @@ -184,240 +179,215 @@ ; ============================================================================= ; @function ; function definitions (proc_declaration - name: - [ - (identifier) @function + name: [ + (identifier) @function + (accent_quoted + (identifier) @function) + (exported_symbol + (identifier) @function) + (exported_symbol (accent_quoted - (identifier) @function) - (exported_symbol - (identifier) @function) - (exported_symbol - (accent_quoted - (identifier) @function)) - ]) + (identifier) @function)) + ]) (func_declaration - name: - [ - (identifier) @function + name: [ + (identifier) @function + (accent_quoted + (identifier) @function) + (exported_symbol + (identifier) @function) + (exported_symbol (accent_quoted - (identifier) @function) - (exported_symbol - (identifier) @function) - (exported_symbol - (accent_quoted - (identifier) @function)) - ]) + (identifier) @function)) + ]) (iterator_declaration - name: - [ - (identifier) @function + name: [ + (identifier) @function + (accent_quoted + (identifier) @function) + (exported_symbol + (identifier) @function) + (exported_symbol (accent_quoted - (identifier) @function) - (exported_symbol - (identifier) @function) - (exported_symbol - (accent_quoted - (identifier) @function)) - ]) + (identifier) @function)) + ]) (converter_declaration - name: - [ - (identifier) @function + name: [ + (identifier) @function + (accent_quoted + (identifier) @function) + (exported_symbol + (identifier) @function) + (exported_symbol (accent_quoted - (identifier) @function) - (exported_symbol - (identifier) @function) - (exported_symbol - (accent_quoted - (identifier) @function)) - ]) + (identifier) @function)) + ]) ; ============================================================================= ; @function.call ; function calls (call - function: - [ - (identifier) @function.call - (accent_quoted - (identifier) @function.call) - ; generic types - (bracket_expression - left: (identifier) @function.call) - (bracket_expression - left: - (accent_quoted - (identifier) @function.call)) - ; dot accessor - (dot_expression - right: (identifier) @function.call) - (dot_expression - right: - (accent_quoted - (identifier) @function.call)) - ; both - (bracket_expression - left: - (dot_expression - right: (identifier) @function.call)) - (bracket_expression - left: - (dot_expression - right: - (accent_quoted - (identifier) @function.call))) - ]) + function: [ + (identifier) @function.call + (accent_quoted + (identifier) @function.call) + ; generic types + (bracket_expression + left: (identifier) @function.call) + (bracket_expression + left: (accent_quoted + (identifier) @function.call)) + ; dot accessor + (dot_expression + right: (identifier) @function.call) + (dot_expression + right: (accent_quoted + (identifier) @function.call)) + ; both + (bracket_expression + left: (dot_expression + right: (identifier) @function.call)) + (bracket_expression + left: (dot_expression + right: (accent_quoted + (identifier) @function.call))) + ]) (dot_generic_call - function: - [ - (identifier) @function.call - (accent_quoted - (identifier) @function.call) - ]) + function: [ + (identifier) @function.call + (accent_quoted + (identifier) @function.call) + ]) ; generalized_string is a function call ; `identifier"string literal"` ; is short for ; `identifier(r"string literal")` (generalized_string - function: - [ - (identifier) @function.call - (accent_quoted - (identifier) @function.call) - ]) + function: [ + (identifier) @function.call + (accent_quoted + (identifier) @function.call) + ]) ; call with leading literal (dot_expression - left: - [ - (nil_literal) - (integer_literal) - (float_literal) - (custom_numeric_literal) - (char_literal) - (interpreted_string_literal) - (long_string_literal) - (raw_string_literal) - (generalized_string) + left: [ + (nil_literal) + (integer_literal) + (float_literal) + (custom_numeric_literal) + (char_literal) + (interpreted_string_literal) + (long_string_literal) + (raw_string_literal) + (generalized_string) + (array_construction) + ; for sequences + (prefix_expression + operator: (operator) @_at (array_construction) - ; for sequences - (prefix_expression - operator: (operator) @_at - (array_construction) - (#eq? @_at "@")) - (tuple_construction) - (curly_construction) - ] - right: - [ - (identifier) @function.call - (accent_quoted - (identifier) @function.call) - ]) + (#eq? @_at "@")) + (tuple_construction) + (curly_construction) + ] + right: [ + (identifier) @function.call + (accent_quoted + (identifier) @function.call) + ]) ; NOTE: will double capture as @function.call if it also has argument_list ; function.calls in `varargs[type, routine]` (bracket_expression left: (identifier) @_varargs - right: - (argument_list - . - (_) - . - [ - (identifier) @function.call - (accent_quoted - (identifier) @function.call) - (dot_expression - right: (identifier) @function.call) - (dot_expression - right: - (accent_quoted - (identifier) @function.call)) - ]) + right: (argument_list + . + (_) + . + [ + (identifier) @function.call + (accent_quoted + (identifier) @function.call) + (dot_expression + right: (identifier) @function.call) + (dot_expression + right: (accent_quoted + (identifier) @function.call)) + ]) (#eq? @_varargs "varargs")) ; ============================================================================= ; @function.macro ; preprocessor macros (template_declaration - name: - [ - (identifier) @function.macro + name: [ + (identifier) @function.macro + (accent_quoted + (identifier) @function.macro) + (exported_symbol + (identifier) @function.macro) + (exported_symbol (accent_quoted - (identifier) @function.macro) - (exported_symbol - (identifier) @function.macro) - (exported_symbol - (accent_quoted - (identifier) @function.macro)) - ]) + (identifier) @function.macro)) + ]) (macro_declaration - name: - [ - (identifier) @function.macro + name: [ + (identifier) @function.macro + (accent_quoted + (identifier) @function.macro) + (exported_symbol + (identifier) @function.macro) + (exported_symbol (accent_quoted - (identifier) @function.macro) - (exported_symbol - (identifier) @function.macro) - (exported_symbol - (accent_quoted - (identifier) @function.macro)) - ]) + (identifier) @function.macro)) + ]) ; ============================================================================= ; @function.method ; method definitions (method_declaration - name: - [ - (identifier) @function.method + name: [ + (identifier) @function.method + (accent_quoted + (identifier) @function.method) + (exported_symbol + (identifier) @function.method) + (exported_symbol (accent_quoted - (identifier) @function.method) - (exported_symbol - (identifier) @function.method) - (exported_symbol - (accent_quoted - (identifier) @function.method)) - ]) + (identifier) @function.method)) + ]) ; ============================================================================= ; @constructor ; constructor calls and definitions (call - function: - [ - (identifier) @constructor - (accent_quoted - (identifier) @constructor) - ; generic types - (bracket_expression - left: (identifier) @constructor) - (bracket_expression - left: - (accent_quoted - (identifier) @constructor)) - ; dot accessor - (dot_expression - right: (identifier) @constructor) - (dot_expression - right: - (accent_quoted - (identifier) @constructor)) - ; both - (bracket_expression - left: - (dot_expression - right: (identifier) @constructor)) - (bracket_expression - left: - (dot_expression - right: - (accent_quoted - (identifier) @constructor))) - ] + function: [ + (identifier) @constructor + (accent_quoted + (identifier) @constructor) + ; generic types + (bracket_expression + left: (identifier) @constructor) + (bracket_expression + left: (accent_quoted + (identifier) @constructor)) + ; dot accessor + (dot_expression + right: (identifier) @constructor) + (dot_expression + right: (accent_quoted + (identifier) @constructor)) + ; both + (bracket_expression + left: (dot_expression + right: (identifier) @constructor)) + (bracket_expression + left: (dot_expression + right: (accent_quoted + (identifier) @constructor))) + ] (argument_list (colon_expression)+)) @@ -520,12 +490,11 @@ ; ============================================================================= ; @label ; GOTO and other labels (e.g. `label:` in C) (block - label: - [ - (identifier) @label - (accent_quoted - (identifier) @label) - ]) + label: [ + (identifier) @label + (accent_quoted + (identifier) @label) + ]) ; ============================================================================= ; @keyword.import ; keywords for including modules (e.g. `import` / `from` in Python) @@ -554,9 +523,8 @@ ; @type ; type or class definitions and annotations ; generic types when calling (call - function: - (bracket_expression - right: (argument_list) @type)) + function: (bracket_expression + right: (argument_list) @type)) ; NOTE: this also falsely matches ; when accessing and directly call elements from an array of routines @@ -567,11 +535,10 @@ ; right side of `is` operator is always type (infix_expression - operator: - [ - "is" - "isnot" - ] + operator: [ + "is" + "isnot" + ] right: (_) @type) ; except branch always contains types of errors @@ -582,16 +549,14 @@ ; overrule special case in (except_branch) with "as" operator ; `except module.exception[gen_type] as variable:` (except_branch - values: - (expression_list - (infix_expression - operator: "as" - right: - [ - (identifier) @variable - (accent_quoted - (identifier) @variable) - ]))) + values: (expression_list + (infix_expression + operator: "as" + right: [ + (identifier) @variable + (accent_quoted + (identifier) @variable) + ]))) ; for inline tuple types ; `type a = tuple[a: int]` @@ -608,24 +573,22 @@ ; call(parameter_name=arg) (argument_list (equal_expression - left: - [ - (identifier) @variable.parameter - (accent_quoted - (identifier) @variable.parameter) - ])) + left: [ + (identifier) @variable.parameter + (accent_quoted + (identifier) @variable.parameter) + ])) ; parameters in function declaration (parameter_declaration_list (parameter_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @variable.parameter - (accent_quoted - (identifier) @variable.parameter) - ])))) + name: [ + (identifier) @variable.parameter + (accent_quoted + (identifier) @variable.parameter) + ])))) ; NOTE: needs to be after @type ; generic types when declaring @@ -633,43 +596,38 @@ (parameter_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @variable.parameter - (accent_quoted - (identifier) @variable.parameter) - ])))) + name: [ + (identifier) @variable.parameter + (accent_quoted + (identifier) @variable.parameter) + ])))) ; for loop variables (for - left: - (symbol_declaration_list - (symbol_declaration - name: - [ - (identifier) @variable.parameter - (accent_quoted - (identifier) @variable.parameter) - ]))) - -((tuple_deconstruct_declaration - (symbol_declaration - name: - [ + left: (symbol_declaration_list + (symbol_declaration + name: [ (identifier) @variable.parameter (accent_quoted (identifier) @variable.parameter) - ])) @_tuple_decons + ]))) + +((tuple_deconstruct_declaration + (symbol_declaration + name: [ + (identifier) @variable.parameter + (accent_quoted + (identifier) @variable.parameter) + ])) @_tuple_decons (#has-ancestor? @_tuple_decons for)) (concept_declaration - parameters: - (parameter_list - [ - (identifier) @variable.parameter - (accent_quoted - (identifier) @variable.parameter) - ])) + parameters: (parameter_list + [ + (identifier) @variable.parameter + (accent_quoted + (identifier) @variable.parameter) + ])) (var_parameter [ @@ -711,17 +669,16 @@ (type_section (type_declaration (type_symbol_declaration - name: - [ - (identifier) @type.definition + name: [ + (identifier) @type.definition + (accent_quoted + (identifier) @type.definition) + (exported_symbol + (identifier) @type.definition) + (exported_symbol (accent_quoted - (identifier) @type.definition) - (exported_symbol - (identifier) @type.definition) - (exported_symbol - (accent_quoted - (identifier) @type.definition)) - ]))) + (identifier) @type.definition)) + ]))) ; ============================================================================= ; @keyword.modifier ; type qualifier keywords (e.g. `const`) @@ -761,54 +718,50 @@ (field_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @variable.member + name: [ + (identifier) @variable.member + (accent_quoted + (identifier) @variable.member) + (exported_symbol + (identifier) @variable.member) + (exported_symbol (accent_quoted - (identifier) @variable.member) - (exported_symbol - (identifier) @variable.member) - (exported_symbol - (accent_quoted - (identifier) @variable.member)) - ]))) + (identifier) @variable.member)) + ]))) ; fields in object construction (call (argument_list (colon_expression - left: - [ - (identifier) @variable.member - (accent_quoted - (identifier) @variable.member) - ]))) + left: [ + (identifier) @variable.member + (accent_quoted + (identifier) @variable.member) + ]))) ; fields in tuple construction (tuple_construction (colon_expression - left: - [ - (identifier) @variable.member - (accent_quoted - (identifier) @variable.member) - ])) + left: [ + (identifier) @variable.member + (accent_quoted + (identifier) @variable.member) + ])) (variant_declaration (variant_discriminator_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @variable.member + name: [ + (identifier) @variable.member + (accent_quoted + (identifier) @variable.member) + (exported_symbol + (identifier) @variable.member) + (exported_symbol (accent_quoted - (identifier) @variable.member) - (exported_symbol - (identifier) @variable.member) - (exported_symbol - (accent_quoted - (identifier) @variable.member)) - ])))) + (identifier) @variable.member)) + ])))) ; ============================================================================= ; @variable.builtin ; built-in variable names (e.g. `this`) @@ -824,84 +777,75 @@ ; enum declaration (enum_field_declaration (symbol_declaration - name: - [ - (identifier) @constant - (accent_quoted - (identifier) @constant) - ])) + name: [ + (identifier) @constant + (accent_quoted + (identifier) @constant) + ])) ; constant declaration (const_section (variable_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @constant + name: [ + (identifier) @constant + (accent_quoted + (identifier) @constant) + (exported_symbol + (identifier) @constant) + (exported_symbol (accent_quoted - (identifier) @constant) - (exported_symbol - (identifier) @constant) - (exported_symbol - (accent_quoted - (identifier) @constant)) - ])))) + (identifier) @constant)) + ])))) ((tuple_deconstruct_declaration (symbol_declaration - name: - [ - (identifier) @constant + name: [ + (identifier) @constant + (accent_quoted + (identifier) @constant) + (exported_symbol + (identifier) @constant) + (exported_symbol (accent_quoted - (identifier) @constant) - (exported_symbol - (identifier) @constant) - (exported_symbol - (accent_quoted - (identifier) @constant)) - ])) @_tuple_decons + (identifier) @constant)) + ])) @_tuple_decons (#has-ancestor? @_tuple_decons const_section)) ; constants x and y in `array[x..y, type]` (bracket_expression left: (identifier) @_array - right: - (argument_list - . - (infix_expression - right: - [ - (identifier) @constant - (accent_quoted - (identifier) @constant) - (dot_expression - right: (identifier) @constant) - (dot_expression - right: - (accent_quoted - (identifier) @constant)) - ])) + right: (argument_list + . + (infix_expression + right: [ + (identifier) @constant + (accent_quoted + (identifier) @constant) + (dot_expression + right: (identifier) @constant) + (dot_expression + right: (accent_quoted + (identifier) @constant)) + ])) (#any-of? @_array "array" "range")) (bracket_expression left: (identifier) @_array - right: - (argument_list - . - (infix_expression - left: - [ - (identifier) @constant - (accent_quoted - (identifier) @constant) - (dot_expression - right: (identifier) @constant) - (dot_expression - right: - (accent_quoted - (identifier) @constant)) - ])) + right: (argument_list + . + (infix_expression + left: [ + (identifier) @constant + (accent_quoted + (identifier) @constant) + (dot_expression + right: (identifier) @constant) + (dot_expression + right: (accent_quoted + (identifier) @constant)) + ])) (#any-of? @_array "array" "range")) ; NOTE: can only do this for (infix_expression)s, since standalone identifiers @@ -926,19 +870,17 @@ (expression_list (infix_expression operator: (operator) @_operator - right: - [ - (identifier) @module - (array_construction - (identifier) @module) - ])) + right: [ + (identifier) @module + (array_construction + (identifier) @module) + ])) (#eq? @_operator "/")) (import_from_statement - module: - (infix_expression - operator: (operator) @_operator - right: (identifier) @module) + module: (infix_expression + operator: (operator) @_operator + right: (identifier) @module) (#eq? @_operator "/")) (export_statement @@ -949,12 +891,11 @@ ; overrule things ; left identifier in dot_expression (dot_expression - left: - [ - (identifier) @none - (accent_quoted - (identifier) @none) - ]) + left: [ + (identifier) @none + (accent_quoted + (identifier) @none) + ]) ; NOTE: we can't know what the left identifier is, so better leave it alone ; for consistency diff --git a/queries/nim/injections.scm b/queries/nim/injections.scm index 2b3f0a990..da15fd84c 100644 --- a/queries/nim/injections.scm +++ b/queries/nim/injections.scm @@ -52,9 +52,8 @@ (colon_expression left: (identifier) @_emit_keyword (#eq? @_emit_keyword "emit") - right: - (_ - (string_content) @injection.content))))) + right: (_ + (string_content) @injection.content))))) ; ============================================================================= ; asm statement diff --git a/queries/nim/locals.scm b/queries/nim/locals.scm index d4d89b048..95279e2ea 100644 --- a/queries/nim/locals.scm +++ b/queries/nim/locals.scm @@ -1,11 +1,10 @@ ; ============================================================================== ; @local.definition ; various definitions (block - label: - [ - (identifier) @local.definition - (accent_quoted) @local.definition - ]) + label: [ + (identifier) @local.definition + (accent_quoted) @local.definition + ]) ; ============================================================================== ; @local.definition.constant ; constants @@ -13,79 +12,73 @@ (variable_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @local.definition.constant - (accent_quoted) @local.definition.constant - (exported_symbol - (identifier) @local.definition.constant) - (exported_symbol - (accent_quoted) @local.definition.constant) - ])) + name: [ + (identifier) @local.definition.constant + (accent_quoted) @local.definition.constant + (exported_symbol + (identifier) @local.definition.constant) + (exported_symbol + (accent_quoted) @local.definition.constant) + ])) type: (type_expression)? @local.definition.associated)) ; ============================================================================== ; @local.definition.function ; functions (proc_declaration - name: - [ - (identifier) @local.definition.function - (accent_quoted) @local.definition.function - (exported_symbol - (identifier) @local.definition.function) - (exported_symbol - (accent_quoted) @local.definition.function) - ] + name: [ + (identifier) @local.definition.function + (accent_quoted) @local.definition.function + (exported_symbol + (identifier) @local.definition.function) + (exported_symbol + (accent_quoted) @local.definition.function) + ] (#set! "definition.function.scope" "parent")) (func_declaration - name: - [ - (identifier) @local.definition.function - (accent_quoted) @local.definition.function - (exported_symbol - (identifier) @local.definition.function) - (exported_symbol - (accent_quoted) @local.definition.function) - ] + name: [ + (identifier) @local.definition.function + (accent_quoted) @local.definition.function + (exported_symbol + (identifier) @local.definition.function) + (exported_symbol + (accent_quoted) @local.definition.function) + ] (#set! "definition.function.scope" "parent")) (iterator_declaration - name: - [ - (identifier) @local.definition.function - (accent_quoted) @local.definition.function - (exported_symbol - (identifier) @local.definition.function) - (exported_symbol - (accent_quoted) @local.definition.function) - ] + name: [ + (identifier) @local.definition.function + (accent_quoted) @local.definition.function + (exported_symbol + (identifier) @local.definition.function) + (exported_symbol + (accent_quoted) @local.definition.function) + ] (#set! "definition.function.scope" "parent")) (converter_declaration - name: - [ - (identifier) @local.definition.function - (accent_quoted) @local.definition.function - (exported_symbol - (identifier) @local.definition.function) - (exported_symbol - (accent_quoted) @local.definition.function) - ] + name: [ + (identifier) @local.definition.function + (accent_quoted) @local.definition.function + (exported_symbol + (identifier) @local.definition.function) + (exported_symbol + (accent_quoted) @local.definition.function) + ] (#set! "definition.function.scope" "parent")) ; ============================================================================== ; @local.definition.method ; methods (method_declaration - name: - [ - (identifier) @local.definition.method - (accent_quoted) @local.definition.method - (exported_symbol - (identifier) @local.definition.method) - (exported_symbol - (accent_quoted) @local.definition.method) - ] + name: [ + (identifier) @local.definition.method + (accent_quoted) @local.definition.method + (exported_symbol + (identifier) @local.definition.method) + (exported_symbol + (accent_quoted) @local.definition.method) + ] (#set! "definition.method.scope" "parent")) ; ============================================================================== @@ -94,72 +87,65 @@ (variable_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @local.definition.var - (accent_quoted) @local.definition.var - (exported_symbol - (identifier) @local.definition.var) - (exported_symbol - (accent_quoted) @local.definition.var) - ])) + name: [ + (identifier) @local.definition.var + (accent_quoted) @local.definition.var + (exported_symbol + (identifier) @local.definition.var) + (exported_symbol + (accent_quoted) @local.definition.var) + ])) type: (type_expression)? @local.definition.associated)) (let_section (variable_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @local.definition.var - (accent_quoted) @local.definition.var - (exported_symbol - (identifier) @local.definition.var) - (exported_symbol - (accent_quoted) @local.definition.var) - ])) + name: [ + (identifier) @local.definition.var + (accent_quoted) @local.definition.var + (exported_symbol + (identifier) @local.definition.var) + (exported_symbol + (accent_quoted) @local.definition.var) + ])) type: (type_expression)? @local.definition.associated)) (for (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @local.definition.var - (accent_quoted) @local.definition.var - ]))) + name: [ + (identifier) @local.definition.var + (accent_quoted) @local.definition.var + ]))) (try (except_branch - values: - (expression_list - (infix_expression - right: - [ - (identifier) @local.definition.var - (accent_quoted) @local.definition.var - ])))) + values: (expression_list + (infix_expression + right: [ + (identifier) @local.definition.var + (accent_quoted) @local.definition.var + ])))) ; ============================================================================== ; @local.definition.parameter ; parameters (parameter_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @local.definition.parameter - (accent_quoted) @local.definition.parameter - ])) + name: [ + (identifier) @local.definition.parameter + (accent_quoted) @local.definition.parameter + ])) type: (type_expression)? @local.definition.associated) (concept_declaration - parameters: - (parameter_list - [ - (identifier) @local.definition.parameter - (accent_quoted - (identifier) @local.definition.parameter) - ])) + parameters: (parameter_list + [ + (identifier) @local.definition.parameter + (accent_quoted + (identifier) @local.definition.parameter) + ])) (var_parameter [ @@ -199,42 +185,39 @@ ; ============================================================================== ; @local.definition.macro ; preprocessor macros (template_declaration - name: - [ - (identifier) @local.definition.macro - (accent_quoted) @local.definition.macro - (exported_symbol - (identifier) @local.definition.macro) - (exported_symbol - (accent_quoted) @local.definition.macro) - ] + name: [ + (identifier) @local.definition.macro + (accent_quoted) @local.definition.macro + (exported_symbol + (identifier) @local.definition.macro) + (exported_symbol + (accent_quoted) @local.definition.macro) + ] (#set! "definition.macro.scope" "parent")) (macro_declaration - name: - [ - (identifier) @local.definition.macro - (accent_quoted) @local.definition.macro - (exported_symbol - (identifier) @local.definition.macro) - (exported_symbol - (accent_quoted) @local.definition.macro) - ] + name: [ + (identifier) @local.definition.macro + (accent_quoted) @local.definition.macro + (exported_symbol + (identifier) @local.definition.macro) + (exported_symbol + (accent_quoted) @local.definition.macro) + ] (#set! "definition.macro.scope" "parent")) ; ============================================================================== ; @local.definition.type ; types or classes (type_declaration (type_symbol_declaration - name: - [ - (identifier) @local.definition.type - (accent_quoted) @local.definition.type - (exported_symbol - (identifier) @local.definition.type) - (exported_symbol - (accent_quoted) @local.definition.type) - ])) + name: [ + (identifier) @local.definition.type + (accent_quoted) @local.definition.type + (exported_symbol + (identifier) @local.definition.type) + (exported_symbol + (accent_quoted) @local.definition.type) + ])) ; ============================================================================== ; @local.definition.field ; fields or properties @@ -246,15 +229,14 @@ (field_declaration (symbol_declaration_list (symbol_declaration - name: - [ - (identifier) @local.definition.field - (accent_quoted) @local.definition.field - (exported_symbol - (identifier) @local.definition.field) - (exported_symbol - (accent_quoted) @local.definition.field) - ])) + name: [ + (identifier) @local.definition.field + (accent_quoted) @local.definition.field + (exported_symbol + (identifier) @local.definition.field) + (exported_symbol + (accent_quoted) @local.definition.field) + ])) type: (type_expression)? @local.definition.associated) ; ============================================================================== @@ -262,11 +244,10 @@ (enum_declaration (enum_field_declaration (symbol_declaration - name: - [ - (identifier) @local.definition.enum - (accent_quoted) @local.definition.enum - ]))) + name: [ + (identifier) @local.definition.enum + (accent_quoted) @local.definition.enum + ]))) ; ============================================================================== ; @local.definition.namespace ; modules or namespaces @@ -285,19 +266,17 @@ (expression_list (infix_expression operator: (operator) @_operator - right: - [ - (identifier) @local.definition.namespace - (array_construction - (identifier) @local.definition.namespace) - ])) + right: [ + (identifier) @local.definition.namespace + (array_construction + (identifier) @local.definition.namespace) + ])) (#eq? @_operator "/")) (import_from_statement - module: - (infix_expression - operator: (operator) @_operator - right: (identifier) @local.definition.namespace) + module: (infix_expression + operator: (operator) @_operator + right: (identifier) @local.definition.namespace) (expression_list [ (identifier) @local.definition.import diff --git a/queries/nim_format_string/highlights.scm b/queries/nim_format_string/highlights.scm index 44fc80260..fde9e4ba0 100644 --- a/queries/nim_format_string/highlights.scm +++ b/queries/nim_format_string/highlights.scm @@ -16,6 +16,5 @@ type: (type)? @type) (matching_curlies - nim_expression: - (nim_expression - escaped_curly: (escaped_curly)+ @string.escape) @none) + nim_expression: (nim_expression + escaped_curly: (escaped_curly)+ @string.escape) @none) diff --git a/queries/ninja/highlights.scm b/queries/ninja/highlights.scm index 8e7268953..8323ee9e9 100644 --- a/queries/ninja/highlights.scm +++ b/queries/ninja/highlights.scm @@ -65,9 +65,8 @@ ; ------------------ (manifest (let - name: - ((identifier) @constant.builtin - (#any-of? @constant.builtin "builddir" "ninja_required_version")))) + name: ((identifier) @constant.builtin + (#any-of? @constant.builtin "builddir" "ninja_required_version")))) ; Rules bindings ; ----------------- diff --git a/queries/nix/highlights.scm b/queries/nix/highlights.scm index 9baf8c4a7..9f00167c4 100644 --- a/queries/nix/highlights.scm +++ b/queries/nix/highlights.scm @@ -84,9 +84,8 @@ ; function calls (apply_expression - function: - (variable_expression - name: (identifier) @function.call)) + function: (variable_expression + name: (identifier) @function.call)) ; basic identifiers (variable_expression) @variable @@ -101,12 +100,10 @@ ; builtin functions (with builtins prefix) (select_expression - expression: - (variable_expression - name: (identifier) @_id) - attrpath: - (attrpath - attr: (identifier) @function.builtin) + expression: (variable_expression + name: (identifier) @_id) + attrpath: (attrpath + attr: (identifier) @function.builtin) (#eq? @_id "builtins")) ; builtin functions (without builtins prefix) @@ -158,9 +155,8 @@ (select_expression expression: (_) @_expr - attrpath: - (attrpath - attr: (identifier) @variable.member) + attrpath: (attrpath + attr: (identifier) @variable.member) (#not-eq? @_expr "builtins")) (attrset_expression @@ -179,9 +175,8 @@ ; function definition (binding - attrpath: - (attrpath - attr: (identifier) @function) + attrpath: (attrpath + attr: (identifier) @function) expression: (function_expression)) ; unary operators diff --git a/queries/nix/injections.scm b/queries/nix/injections.scm index 5d86d3697..8feff0f8a 100644 --- a/queries/nix/injections.scm +++ b/queries/nix/injections.scm @@ -14,193 +14,165 @@ (apply_expression function: (_) @_func - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "regex"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "regex"))) - ] + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "regex"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "regex"))) + ] (#match? @_func "(^|\\.)match$") (#set! injection.combined)) (binding - attrpath: - (attrpath - (identifier) @_path) - expression: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - ] + attrpath: (attrpath + (identifier) @_path) + expression: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + ] (#match? @_path "(^\\w+(Phase|Hook|Check)|(pre|post)[A-Z]\\w+|script)$")) (apply_expression function: (_) @_func - argument: + argument: (_ + (_)* (_ (_)* - (_ - (_)* - (binding - attrpath: - (attrpath - (identifier) @_path) - expression: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - ]))) + (binding + attrpath: (attrpath + (identifier) @_path) + expression: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + ]))) (#match? @_func "(^|\\.)writeShellApplication$") (#match? @_path "^text$") (#set! injection.combined)) (apply_expression - function: - (apply_expression - function: - (apply_expression - function: (_) @_func)) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - ] + function: (apply_expression + function: (apply_expression + function: (_) @_func)) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + ] (#match? @_func "(^|\\.)runCommand((No)?CC)?(Local)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: (_) @_func) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "bash"))) - ]) + function: (apply_expression + function: (_) @_func) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "bash"))) + ]) (#match? @_func "(^|\\.)write(Bash|Dash|ShellScript)(Bin)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: (_) @_func) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "fish"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "fish"))) - ]) + function: (apply_expression + function: (_) @_func) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "fish"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "fish"))) + ]) (#match? @_func "(^|\\.)writeFish(Bin)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: - (apply_expression - function: (_) @_func)) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "haskell"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "haskell"))) - ]) + function: (apply_expression + function: (apply_expression + function: (_) @_func)) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "haskell"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "haskell"))) + ]) (#match? @_func "(^|\\.)writeHaskell(Bin)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: - (apply_expression - function: (_) @_func)) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "javascript"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "javascript"))) - ]) + function: (apply_expression + function: (apply_expression + function: (_) @_func)) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "javascript"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "javascript"))) + ]) (#match? @_func "(^|\\.)writeJS(Bin)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: - (apply_expression - function: (_) @_func)) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "perl"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "perl"))) - ]) + function: (apply_expression + function: (apply_expression + function: (_) @_func)) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "perl"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "perl"))) + ]) (#match? @_func "(^|\\.)writePerl(Bin)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: - (apply_expression - function: (_) @_func)) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "python"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "python"))) - ]) + function: (apply_expression + function: (apply_expression + function: (_) @_func)) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "python"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "python"))) + ]) (#match? @_func "(^|\\.)write(PyPy|Python)[23](Bin)?$") (#set! injection.combined)) ((apply_expression - function: - (apply_expression - function: - (apply_expression - function: (_) @_func)) - argument: - [ - (string_expression - ((string_fragment) @injection.content - (#set! injection.language "rust"))) - (indented_string_expression - ((string_fragment) @injection.content - (#set! injection.language "rust"))) - ]) + function: (apply_expression + function: (apply_expression + function: (_) @_func)) + argument: [ + (string_expression + ((string_fragment) @injection.content + (#set! injection.language "rust"))) + (indented_string_expression + ((string_fragment) @injection.content + (#set! injection.language "rust"))) + ]) (#match? @_func "(^|\\.)writeRust(Bin)?$") (#set! injection.combined)) diff --git a/queries/objc/highlights.scm b/queries/objc/highlights.scm index 50ac7a78b..b068bf13c 100644 --- a/queries/objc/highlights.scm +++ b/queries/objc/highlights.scm @@ -244,12 +244,10 @@ declarator: (identifier) @variable.parameter) (parameter_declaration - declarator: - (function_declarator - declarator: - (parenthesized_declarator - (block_pointer_declarator - declarator: (identifier) @variable.parameter)))) + declarator: (function_declarator + declarator: (parenthesized_declarator + (block_pointer_declarator + declarator: (identifier) @variable.parameter)))) "..." @variable.parameter.builtin diff --git a/queries/ocaml/highlights.scm b/queries/ocaml/highlights.scm index 3863d405e..abd0f6bd4 100644 --- a/queries/ocaml/highlights.scm +++ b/queries/ocaml/highlights.scm @@ -40,11 +40,10 @@ (let_binding pattern: (value_name) @function - body: - [ - (fun_expression) - (function_expression) - ]) + body: [ + (fun_expression) + (function_expression) + ]) (value_specification (value_name) @function) @@ -57,23 +56,20 @@ ; Application ;------------ (infix_expression - left: - (value_path - (value_name) @function.call) + left: (value_path + (value_name) @function.call) operator: (concat_operator) @_operator (#eq? @_operator "@@")) (infix_expression operator: (rel_operator) @_operator - right: - (value_path - (value_name) @function.call) + right: (value_path + (value_name) @function.call) (#eq? @_operator "|>")) (application_expression - function: - (value_path - (value_name) @function.call)) + function: (value_path + (value_name) @function.call)) ((value_name) @function.builtin (#any-of? @function.builtin "raise" "raise_notrace" "failwith" "invalid_arg")) diff --git a/queries/ocaml/locals.scm b/queries/ocaml/locals.scm index 38f1f15f2..38d392609 100644 --- a/queries/ocaml/locals.scm +++ b/queries/ocaml/locals.scm @@ -28,16 +28,14 @@ (#set! definition.var.scope "parent")) (let_binding - pattern: - (tuple_pattern - (value_name) @local.definition.var) + pattern: (tuple_pattern + (value_name) @local.definition.var) (#set! definition.var.scope "parent")) (let_binding - pattern: - (record_pattern - (field_pattern - (value_name) @local.definition.var)) + pattern: (record_pattern + (field_pattern + (value_name) @local.definition.var)) (#set! definition.var.scope "parent")) (external diff --git a/queries/pascal/highlights.scm b/queries/pascal/highlights.scm index 3511386ca..d6014ee1d 100644 --- a/queries/pascal/highlights.scm +++ b/queries/pascal/highlights.scm @@ -291,9 +291,8 @@ name: (identifier) @type) (declType - name: - (genericTpl - entity: (identifier) @type)) + name: (genericTpl + entity: (identifier) @type)) ; -- Procedure & function declarations ; foobar @@ -302,23 +301,19 @@ ; foobar<t> (declProc - name: - (genericTpl - entity: (identifier) @function)) + name: (genericTpl + entity: (identifier) @function)) ; foo.bar (declProc - name: - (genericDot - rhs: (identifier) @function)) + name: (genericDot + rhs: (identifier) @function)) ; foo.bar<t> (declProc - name: - (genericDot - rhs: - (genericTpl - entity: (identifier) @function))) + name: (genericDot + rhs: (genericTpl + entity: (identifier) @function))) ; Treat property declarations like functions (declProp @@ -342,9 +337,8 @@ type: (typeref) @type) (declProc - name: - (genericDot - lhs: (identifier) @type)) + name: (genericDot + lhs: (identifier) @type)) (declType (genericDot @@ -362,9 +356,8 @@ entity: (identifier) @type) (genericTpl - entity: - (genericDot - (identifier) @type)) + entity: (genericDot + (identifier) @type)) ; -- Exception parameters (exceptionHandler @@ -432,23 +425,19 @@ ; foobar<t> (exprCall - entity: - (exprTpl - entity: (identifier) @function)) + entity: (exprTpl + entity: (identifier) @function)) ; foo.bar (exprCall - entity: - (exprDot - rhs: (identifier) @function)) + entity: (exprDot + rhs: (identifier) @function)) ; foo.bar<t> (exprCall - entity: - (exprDot - rhs: - (exprTpl - entity: (identifier) @function))) + entity: (exprDot + rhs: (exprTpl + entity: (identifier) @function))) (inherited) @function @@ -469,9 +458,8 @@ (statement (exprDot - rhs: - (exprTpl - entity: (identifier) @function))) + rhs: (exprTpl + entity: (identifier) @function))) ; -- Break, Continue & Exit ; (Not ideal: ideally, there would be a way to check if these special @@ -482,9 +470,8 @@ (statement (exprCall - entity: - ((identifier) @keyword.return - (#lua-match? @keyword.return "^[eE][xX][iI][tT]$")))) + entity: ((identifier) @keyword.return + (#lua-match? @keyword.return "^[eE][xX][iI][tT]$")))) (statement ((identifier) @keyword.repeat @@ -505,9 +492,8 @@ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) (assignment - rhs: - ((identifier) @constant - (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) + rhs: ((identifier) @constant + (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) (exprBrackets ((identifier) @constant @@ -518,14 +504,12 @@ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) (exprDot - rhs: - ((identifier) @constant - (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) + rhs: ((identifier) @constant + (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) (exprTpl - args: - ((identifier) @constant - (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) + args: ((identifier) @constant + (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2,3}[A-Z].+$"))) (exprArgs ((identifier) @constant diff --git a/queries/pascal/locals.scm b/queries/pascal/locals.scm index bb12cb2d2..d74d54ad4 100644 --- a/queries/pascal/locals.scm +++ b/queries/pascal/locals.scm @@ -45,9 +45,8 @@ name: (identifier) @local.definition) (declType - name: - (genericTpl - entity: (identifier) @local.definition)) + name: (genericTpl + entity: (identifier) @local.definition)) (declProc name: (identifier) @local.definition) diff --git a/queries/php_only/highlights.scm b/queries/php_only/highlights.scm index 20d35c18e..557421d9f 100644 --- a/queries/php_only/highlights.scm +++ b/queries/php_only/highlights.scm @@ -60,12 +60,11 @@ ]) (scoped_call_expression - scope: - [ - (name) @type - (qualified_name - (name) @type) - ]) + scope: [ + (name) @type + (qualified_name + (name) @type) + ]) (class_constant_access_expression . @@ -84,12 +83,11 @@ (binary_expression operator: "instanceof" - right: - [ - (name) @type - (qualified_name - (name) @type) - ]) + right: [ + (name) @type + (qualified_name + (name) @type) + ]) ; Functions, methods, constructors (array_creation_expression @@ -102,9 +100,8 @@ name: (name) @function.method) (function_call_expression - function: - (qualified_name - (name) @function.call)) + function: (qualified_name + (name) @function.call)) (function_call_expression (name) @function.call) @@ -146,17 +143,15 @@ (variable_name) @property) (member_access_expression - name: - (variable_name - (name)) @variable.member) + name: (variable_name + (name)) @variable.member) (member_access_expression name: (name) @variable.member) (nullsafe_member_access_expression - name: - (variable_name - (name)) @variable.member) + name: (variable_name + (name)) @variable.member) (nullsafe_member_access_expression name: (name) @variable.member) @@ -169,9 +164,8 @@ ; Namespace (namespace_definition - name: - (namespace_name - (name) @module)) + name: (namespace_name + (name) @module)) (namespace_name_as_prefix (namespace_name diff --git a/queries/php_only/injections.scm b/queries/php_only/injections.scm index 8e60cdd34..b13449b9f 100644 --- a/queries/php_only/injections.scm +++ b/queries/php_only/injections.scm @@ -16,24 +16,22 @@ ; regex ((function_call_expression function: (_) @_preg_func_identifier - arguments: - (arguments - . - (argument - (_ - (string_value) @injection.content)))) + arguments: (arguments + . + (argument + (_ + (string_value) @injection.content)))) (#set! injection.language "regex") (#lua-match? @_preg_func_identifier "^preg_")) ; bash ((function_call_expression function: (_) @_shell_func_identifier - arguments: - (arguments - . - (argument - (_ - (string_value) @injection.content)))) + arguments: (arguments + . + (argument + (_ + (string_value) @injection.content)))) (#set! injection.language "bash") (#any-of? @_shell_func_identifier "shell_exec" "escapeshellarg" "escapeshellcmd" "exec" "passthru" "proc_open" "shell_exec" diff --git a/queries/php_only/locals.scm b/queries/php_only/locals.scm index 8d509b37c..aff2b3dae 100644 --- a/queries/php_only/locals.scm +++ b/queries/php_only/locals.scm @@ -67,10 +67,9 @@ (#set! reference.kind "method")) (function_call_expression - function: - (qualified_name - (name) @local.reference - (#set! reference.kind "function"))) + function: (qualified_name + (name) @local.reference + (#set! reference.kind "function"))) (object_creation_expression (qualified_name @@ -78,9 +77,8 @@ (#set! reference.kind "type"))) (scoped_call_expression - scope: - (qualified_name - (name) @local.reference - (#set! reference.kind "type")) + scope: (qualified_name + (name) @local.reference + (#set! reference.kind "type")) name: (name) @local.reference (#set! reference.kind "method")) diff --git a/queries/pony/highlights.scm b/queries/pony/highlights.scm index 06b0006b3..53024d5e5 100644 --- a/queries/pony/highlights.scm +++ b/queries/pony/highlights.scm @@ -133,15 +133,14 @@ (#set! "priority" 105)) (call_expression - callee: - [ - (identifier) @function.method.call - (ffi_identifier - (identifier) @function.method.call) - (member_expression - "." - (identifier) @function.method.call) - ]) + callee: [ + (identifier) @function.method.call + (ffi_identifier + (identifier) @function.method.call) + (member_expression + "." + (identifier) @function.method.call) + ]) ; Parameters (parameter @@ -168,22 +167,20 @@ ; Operators (unary_expression - operator: - [ - "not" - "addressof" - "digestof" - ] @keyword.operator) + operator: [ + "not" + "addressof" + "digestof" + ] @keyword.operator) (binary_expression - operator: - [ - "and" - "or" - "xor" - "is" - "isnt" - ] @keyword.operator) + operator: [ + "and" + "or" + "xor" + "is" + "isnt" + ] @keyword.operator) [ "=" diff --git a/queries/puppet/highlights.scm b/queries/puppet/highlights.scm index 582e50764..d1698d736 100644 --- a/queries/puppet/highlights.scm +++ b/queries/puppet/highlights.scm @@ -42,9 +42,8 @@ name: (identifier) @attribute) (attribute - name: - (variable - (identifier) @attribute)) + name: (variable + (identifier) @attribute)) ; Parameters (lambda diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index fea97bed3..d35f7307c 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -35,9 +35,8 @@ ((assignment left: (identifier) @type.definition - right: - (call - function: (identifier) @_func)) + right: (call + function: (identifier) @_func)) (#any-of? @_func "TypeVar" "NewType")) ; Function calls @@ -45,18 +44,16 @@ function: (identifier) @function.call) (call - function: - (attribute - attribute: (identifier) @function.method.call)) + function: (attribute + attribute: (identifier) @function.method.call)) ((call function: (identifier) @constructor) (#lua-match? @constructor "^%u")) ((call - function: - (attribute - attribute: (identifier) @constructor)) + function: (attribute + attribute: (identifier) @constructor)) (#lua-match? @constructor "^%u")) ; Decorators @@ -109,10 +106,9 @@ ((call function: (identifier) @_isinstance - arguments: - (argument_list - (_) - (identifier) @type)) + arguments: (argument_list + (_) + (identifier) @type)) (#eq? @_isinstance "isinstance")) ; Normal parameters @@ -211,18 +207,16 @@ (string) @string.documentation @spell)) (class_definition - body: - (block - . - (expression_statement - (string) @string.documentation @spell))) + body: (block + . + (expression_statement + (string) @string.documentation @spell))) (function_definition - body: - (block - . - (expression_statement - (string) @string.documentation @spell))) + body: (block + . + (expression_statement + (string) @string.documentation @spell))) ; Tokens [ @@ -378,32 +372,27 @@ name: (identifier) @type) (class_definition - body: - (block - (function_definition - name: (identifier) @function.method))) + body: (block + (function_definition + name: (identifier) @function.method))) (class_definition - superclasses: - (argument_list - (identifier) @type)) + superclasses: (argument_list + (identifier) @type)) ((class_definition - body: - (block - (expression_statement - (assignment - left: (identifier) @variable.member)))) + body: (block + (expression_statement + (assignment + left: (identifier) @variable.member)))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition - body: - (block - (expression_statement - (assignment - left: - (_ - (identifier) @variable.member))))) + body: (block + (expression_statement + (assignment + left: (_ + (identifier) @variable.member))))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition @@ -434,12 +423,10 @@ ; Regex from the `re` module (call - function: - (attribute - object: (identifier) @_re) - arguments: - (argument_list - . - (string - (string_content) @string.regexp)) + function: (attribute + object: (identifier) @_re) + arguments: (argument_list + . + (string + (string_content) @string.regexp)) (#eq? @_re "re")) diff --git a/queries/python/indents.scm b/queries/python/indents.scm index 94005ebab..dbda25b5c 100644 --- a/queries/python/indents.scm +++ b/queries/python/indents.scm @@ -164,9 +164,8 @@ (attribute attribute: (_) @indent.end) (call - arguments: - (_ - ")" @indent.end)) + arguments: (_ + ")" @indent.end)) "return" @indent.end ] .) diff --git a/queries/python/injections.scm b/queries/python/injections.scm index 3db20929e..bbc924be4 100644 --- a/queries/python/injections.scm +++ b/queries/python/injections.scm @@ -1,19 +1,16 @@ (call - function: - (attribute - object: (identifier) @_re) - arguments: - (argument_list - . - (string - (string_content) @injection.content)) + function: (attribute + object: (identifier) @_re) + arguments: (argument_list + . + (string + (string_content) @injection.content)) (#eq? @_re "re") (#set! injection.language "regex")) ((binary_operator - left: - (string - (string_content) @injection.content) + left: (string + (string_content) @injection.content) operator: "%") (#set! injection.language "printf")) diff --git a/queries/python/locals.scm b/queries/python/locals.scm index e0454dbf4..6a9dffe23 100644 --- a/queries/python/locals.scm +++ b/queries/python/locals.scm @@ -2,34 +2,29 @@ (module) @local.scope (class_definition - body: - (block - (expression_statement - (assignment - left: (identifier) @local.definition.field)))) @local.scope + body: (block + (expression_statement + (assignment + left: (identifier) @local.definition.field)))) @local.scope (class_definition - body: - (block - (expression_statement - (assignment - left: - (_ - (identifier) @local.definition.field))))) @local.scope + body: (block + (expression_statement + (assignment + left: (_ + (identifier) @local.definition.field))))) @local.scope ; Imports (aliased_import alias: (identifier) @local.definition.import) (import_statement - name: - (dotted_name - (identifier) @local.definition.import)) + name: (dotted_name + (identifier) @local.definition.import)) (import_from_statement - name: - (dotted_name - (identifier) @local.definition.import)) + name: (dotted_name + (identifier) @local.definition.import)) ; Function with parameters, defines parameters (parameters @@ -64,22 +59,19 @@ (#set! definition.type.scope "parent")) (class_definition - body: - (block - (function_definition - name: (identifier) @local.definition.method))) + body: (block + (function_definition + name: (identifier) @local.definition.method))) ; Loops ; not a scope! (for_statement - left: - (pattern_list - (identifier) @local.definition.var)) + left: (pattern_list + (identifier) @local.definition.var)) (for_statement - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (for_statement left: (identifier) @local.definition.var) @@ -91,14 +83,12 @@ left: (identifier) @local.definition.var) (for_in_clause - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (for_in_clause - left: - (pattern_list - (identifier) @local.definition.var)) + left: (pattern_list + (identifier) @local.definition.var)) (dictionary_comprehension) @local.scope @@ -111,20 +101,17 @@ left: (identifier) @local.definition.var) (assignment - left: - (pattern_list - (identifier) @local.definition.var)) + left: (pattern_list + (identifier) @local.definition.var)) (assignment - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (assignment - left: - (attribute - (identifier) - (identifier) @local.definition.field)) + left: (attribute + (identifier) + (identifier) @local.definition.field)) ; Walrus operator x := 1 (named_expression diff --git a/queries/qmljs/highlights.scm b/queries/qmljs/highlights.scm index b4b30d0aa..d543074be 100644 --- a/queries/qmljs/highlights.scm +++ b/queries/qmljs/highlights.scm @@ -4,12 +4,11 @@ ; Annotations (ui_annotation "@" @operator - type_name: - [ - (identifier) @attribute - (nested_identifier - (identifier) @attribute) - ]) + type_name: [ + (identifier) @attribute + (nested_identifier + (identifier) @attribute) + ]) ; type (ui_property @@ -17,28 +16,25 @@ ; Properties (ui_object_definition_binding - name: - [ - (identifier) @property - (nested_identifier - (identifier) @property) - ]) + name: [ + (identifier) @property + (nested_identifier + (identifier) @property) + ]) (ui_binding - name: - [ - (identifier) @property - (nested_identifier - (identifier) @property) - ]) + name: [ + (identifier) @property + (nested_identifier + (identifier) @property) + ]) ; locals query appears not working unless id: <ref> isn't a parameter. (ui_binding name: (identifier) @property (#eq? @property "id") - value: - (expression_statement - (identifier) @variable)) + value: (expression_statement + (identifier) @variable)) (ui_property name: (identifier) @property) @@ -77,10 +73,9 @@ ; function (call_expression - function: - (member_expression - object: (identifier) @variable - property: (property_identifier) @function)) + function: (member_expression + object: (identifier) @variable + property: (property_identifier) @function)) ; js ; Literals diff --git a/queries/query/highlights.scm b/queries/query/highlights.scm index cdedb23e2..abc7aa50a 100644 --- a/queries/query/highlights.scm +++ b/queries/query/highlights.scm @@ -68,20 +68,18 @@ ((predicate name: (identifier) @_name - parameters: - (parameters - (string - "\"" @string - "\"" @string) @string.regexp)) + parameters: (parameters + (string + "\"" @string + "\"" @string) @string.regexp)) (#any-of? @_name "match" "not-match" "vim-match" "not-vim-match" "lua-match" "not-lua-match")) ((predicate name: (identifier) @_name - parameters: - (parameters - (string - "\"" @string - "\"" @string) @string.regexp - . - (string) .)) + parameters: (parameters + (string + "\"" @string + "\"" @string) @string.regexp + . + (string) .)) (#any-of? @_name "gsub" "not-gsub")) diff --git a/queries/query/injections.scm b/queries/query/injections.scm index dd1a8556c..408d88e28 100644 --- a/queries/query/injections.scm +++ b/queries/query/injections.scm @@ -1,28 +1,25 @@ ((predicate name: (identifier) @_name - parameters: - (parameters - (string) @injection.content)) + parameters: (parameters + (string) @injection.content)) (#any-of? @_name "match" "not-match" "vim-match" "not-vim-match") (#set! injection.language "regex") (#offset! @injection.content 0 1 0 -1)) ((predicate name: (identifier) @_name - parameters: - (parameters - (string) @injection.content)) + parameters: (parameters + (string) @injection.content)) (#any-of? @_name "lua-match" "not-lua-match") (#set! injection.language "luap") (#offset! @injection.content 0 1 0 -1)) ((predicate name: (identifier) @_name - parameters: - (parameters - (string) @injection.content - . - (string) .)) + parameters: (parameters + (string) @injection.content + . + (string) .)) (#any-of? @_name "gsub" "not-gsub") (#set! injection.language "luap") (#offset! @injection.content 0 1 0 -1)) diff --git a/queries/r/highlights.scm b/queries/r/highlights.scm index 1ce166ee0..784a54242 100755 --- a/queries/r/highlights.scm +++ b/queries/r/highlights.scm @@ -55,36 +55,34 @@ ] @operator (unary - operator: - [ - "-" - "+" - "!" - "~" - "?" - ] @operator) + operator: [ + "-" + "+" + "!" + "~" + "?" + ] @operator) (binary - operator: - [ - "-" - "+" - "*" - "/" - "^" - "<" - ">" - "<=" - ">=" - "==" - "!=" - "||" - "|" - "&&" - "&" - ":" - "~" - ] @operator) + operator: [ + "-" + "+" + "*" + "/" + "^" + "<" + ">" + "<=" + ">=" + "==" + "!=" + "||" + "|" + "&&" + "&" + ":" + "~" + ] @operator) [ "|>" @@ -157,7 +155,6 @@ function: (identifier) @function.call)) (call - function: - (dollar - _ - (identifier) @function.method.call)) + function: (dollar + _ + (identifier) @function.method.call)) diff --git a/queries/rego/highlights.scm b/queries/rego/highlights.scm index b738eb9db..3cc32949d 100644 --- a/queries/rego/highlights.scm +++ b/queries/rego/highlights.scm @@ -44,14 +44,12 @@ (number) @number (expr_call - func_name: - (fn_name - (var) @function .)) + func_name: (fn_name + (var) @function .)) (expr_call - func_arguments: - (fn_args - (expr) @variable.parameter)) + func_arguments: (fn_args + (expr) @variable.parameter)) (rule_args (term) @variable.parameter) diff --git a/queries/robot/indents.scm b/queries/robot/indents.scm index a4d81c852..457fbff66 100644 --- a/queries/robot/indents.scm +++ b/queries/robot/indents.scm @@ -8,11 +8,10 @@ "END" @indent.branch) (for_statement - right: - (_ - (arguments - (continuation - (ellipses) @indent.branch)))) + right: (_ + (arguments + (continuation + (ellipses) @indent.branch)))) (while_statement) @indent.begin diff --git a/queries/rst/highlights.scm b/queries/rst/highlights.scm index 27c37142c..2d1b33eff 100644 --- a/queries/rst/highlights.scm +++ b/queries/rst/highlights.scm @@ -22,9 +22,8 @@ name: (type) @function) (directive - body: - (body - (arguments) @variable.parameter)) + body: (body + (arguments) @variable.parameter)) ((directive name: (type) @keyword.import) @@ -143,9 +142,8 @@ (directive name: (type) @_directive - body: - (body - (content) @spell - (#not-any-of? @_directive "code" "code-block" "sourcecode"))) + body: (body + (content) @spell + (#not-any-of? @_directive "code" "code-block" "sourcecode"))) (paragraph) @spell diff --git a/queries/rst/injections.scm b/queries/rst/injections.scm index da57daa65..7178de9da 100644 --- a/queries/rst/injections.scm +++ b/queries/rst/injections.scm @@ -14,10 +14,9 @@ ; Directives with nested content without arguments, but with options ((directive name: (type) @_type - body: - (body - (options) - (content) @injection.content)) + body: (body + (options) + (content) @injection.content)) (#set! injection.language "rst") (#any-of? @_type "attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition" @@ -26,9 +25,8 @@ ; Directives with nested content with arguments and options ((directive name: (type) @_type - body: - (body - (content) @injection.content)) + body: (body + (content) @injection.content)) (#set! injection.language "rst") (#any-of? @_type "figure" "topic" "sidebar" "container" "table" "list-table" "class" "role" @@ -37,25 +35,22 @@ ; Special directives ((directive name: (type) @_type - body: - (body - (arguments) @injection.language - (content) @injection.content)) + body: (body + (arguments) @injection.language + (content) @injection.content)) (#any-of? @_type "raw" "code" "code-block" "sourcecode")) ((directive name: (type) @_type - body: - (body - (content) @injection.content)) + body: (body + (content) @injection.content)) (#set! injection.language "latex") (#eq? @_type "math")) ((directive name: (type) @_type - body: - (body - (content) @injection.content)) + body: (body + (content) @injection.content)) (#set! injection.language "csv") (#eq? @_type "csv-table")) diff --git a/queries/rst/locals.scm b/queries/rst/locals.scm index 477c4ef3b..ce4235b43 100644 --- a/queries/rst/locals.scm +++ b/queries/rst/locals.scm @@ -24,9 +24,8 @@ ; The role directive can define a new role ((directive name: (type) @_type - body: - (body - (arguments) @local.definition)) + body: (body + (arguments) @local.definition)) (#eq? @_type "role")) ; References diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm index c0e71e1dc..15f709128 100644 --- a/queries/ruby/highlights.scm +++ b/queries/ruby/highlights.scm @@ -78,11 +78,10 @@ (call receiver: (constant)? @type - method: - [ - (identifier) - (constant) - ] @function.call) + method: [ + (identifier) + (constant) + ] @function.call) (program (call @@ -97,18 +96,16 @@ (identifier) @function) (method - name: - [ - (identifier) @function - (constant) @type - ]) + name: [ + (identifier) @function + (constant) @type + ]) (singleton_method - name: - [ - (identifier) @function - (constant) @type - ]) + name: [ + (identifier) @function + (constant) @type + ]) (class name: (constant) @type) diff --git a/queries/ruby/locals.scm b/queries/ruby/locals.scm index 2a27c93a2..29a67e2ba 100644 --- a/queries/ruby/locals.scm +++ b/queries/ruby/locals.scm @@ -42,18 +42,16 @@ name: (constant) @local.definition.type) (method - name: - [ - (identifier) - (constant) - ] @local.definition.function) + name: [ + (identifier) + (constant) + ] @local.definition.function) (singleton_method - name: - [ - (identifier) - (constant) - ] @local.definition.function) + name: [ + (identifier) + (constant) + ] @local.definition.function) (method_parameters (identifier) @local.definition.var) diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index 332ee12fa..4b83014a0 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -55,27 +55,23 @@ function: (identifier) @function.call) (call_expression - function: - (scoped_identifier - (identifier) @function.call .)) + function: (scoped_identifier + (identifier) @function.call .)) (call_expression - function: - (field_expression - field: (field_identifier) @function.call)) + function: (field_expression + field: (field_identifier) @function.call)) (generic_function function: (identifier) @function.call) (generic_function - function: - (scoped_identifier - name: (identifier) @function.call)) + function: (scoped_identifier + name: (identifier) @function.call)) (generic_function - function: - (field_expression - field: (field_identifier) @function.call)) + function: (field_expression + field: (field_identifier) @function.call)) ; Assume other uppercase names are enum constructors ((field_identifier) @constant @@ -136,9 +132,8 @@ path: (identifier) @module) (scoped_use_list - path: - (scoped_identifier - (identifier) @module)) + path: (scoped_identifier + (identifier) @module)) (use_list (scoped_identifier @@ -156,24 +151,21 @@ ; Correct enum constructors (call_expression - function: - (scoped_identifier - "::" - name: (identifier) @constant) + function: (scoped_identifier + "::" + name: (identifier) @constant) (#lua-match? @constant "^[A-Z]")) ; Assume uppercase names in a match arm are constants. ((match_arm - pattern: - (match_pattern - (identifier) @constant)) + pattern: (match_pattern + (identifier) @constant)) (#lua-match? @constant "^[A-Z]")) ((match_arm - pattern: - (match_pattern - (scoped_identifier - name: (identifier) @constant))) + pattern: (match_pattern + (scoped_identifier + name: (identifier) @constant))) (#lua-match? @constant "^[A-Z]")) ((identifier) @constant.builtin @@ -210,9 +202,8 @@ macro: (identifier) @function.macro) (macro_invocation - macro: - (scoped_identifier - (identifier) @function.macro .)) + macro: (scoped_identifier + (identifier) @function.macro .)) ; Literals [ diff --git a/queries/rust/indents.scm b/queries/rust/indents.scm index c4737ab80..d56a246c6 100644 --- a/queries/rust/indents.scm +++ b/queries/rust/indents.scm @@ -55,42 +55,35 @@ "}" @indent.end) (enum_item - body: - (enum_variant_list - "}" @indent.end)) + body: (enum_variant_list + "}" @indent.end)) (impl_item - body: - (declaration_list - "}" @indent.end)) + body: (declaration_list + "}" @indent.end)) (match_expression - body: - (match_block - "}" @indent.end)) + body: (match_block + "}" @indent.end)) (mod_item - body: - (declaration_list - "}" @indent.end)) + body: (declaration_list + "}" @indent.end)) (struct_item - body: - (field_declaration_list - "}" @indent.end)) + body: (field_declaration_list + "}" @indent.end)) (struct_expression - body: - (field_initializer_list - "}" @indent.end)) + body: (field_initializer_list + "}" @indent.end)) (struct_pattern "}" @indent.end) (trait_item - body: - (declaration_list - "}" @indent.end)) + body: (declaration_list + "}" @indent.end)) (impl_item (where_clause) @indent.dedent) diff --git a/queries/rust/injections.scm b/queries/rust/injections.scm index 629f707c7..c8c360199 100644 --- a/queries/rust/injections.scm +++ b/queries/rust/injections.scm @@ -1,22 +1,20 @@ (macro_invocation - macro: - [ - (scoped_identifier - name: (_) @_macro_name) - (identifier) @_macro_name - ] + macro: [ + (scoped_identifier + name: (_) @_macro_name) + (identifier) @_macro_name + ] (token_tree) @injection.content (#not-eq? @_macro_name "slint") (#set! injection.language "rust") (#set! injection.include-children)) (macro_invocation - macro: - [ - (scoped_identifier - name: (_) @_macro_name) - (identifier) @_macro_name - ] + macro: [ + (scoped_identifier + name: (_) @_macro_name) + (identifier) @_macro_name + ] (token_tree) @injection.content (#eq? @_macro_name "slint") (#offset! @injection.content 0 1 0 -1) @@ -45,57 +43,47 @@ (#any-of? @injection.language "html" "json")) (call_expression - function: - (scoped_identifier - path: (identifier) @_regex - (#any-of? @_regex "Regex" "ByteRegexBuilder") - name: (identifier) @_new - (#eq? @_new "new")) - arguments: - (arguments - (raw_string_literal) @injection.content) + function: (scoped_identifier + path: (identifier) @_regex + (#any-of? @_regex "Regex" "ByteRegexBuilder") + name: (identifier) @_new + (#eq? @_new "new")) + arguments: (arguments + (raw_string_literal) @injection.content) (#set! injection.language "regex")) (call_expression - function: - (scoped_identifier - path: - (scoped_identifier - (identifier) @_regex - (#any-of? @_regex "Regex" "ByteRegexBuilder") .) - name: (identifier) @_new - (#eq? @_new "new")) - arguments: - (arguments - (raw_string_literal) @injection.content) + function: (scoped_identifier + path: (scoped_identifier + (identifier) @_regex + (#any-of? @_regex "Regex" "ByteRegexBuilder") .) + name: (identifier) @_new + (#eq? @_new "new")) + arguments: (arguments + (raw_string_literal) @injection.content) (#set! injection.language "regex")) (call_expression - function: - (scoped_identifier - path: (identifier) @_regex - (#any-of? @_regex "RegexSet" "RegexSetBuilder") - name: (identifier) @_new - (#eq? @_new "new")) - arguments: - (arguments - (array_expression - (raw_string_literal) @injection.content)) + function: (scoped_identifier + path: (identifier) @_regex + (#any-of? @_regex "RegexSet" "RegexSetBuilder") + name: (identifier) @_new + (#eq? @_new "new")) + arguments: (arguments + (array_expression + (raw_string_literal) @injection.content)) (#set! injection.language "regex")) (call_expression - function: - (scoped_identifier - path: - (scoped_identifier - (identifier) @_regex - (#any-of? @_regex "RegexSet" "RegexSetBuilder") .) - name: (identifier) @_new - (#eq? @_new "new")) - arguments: - (arguments - (array_expression - (raw_string_literal) @injection.content)) + function: (scoped_identifier + path: (scoped_identifier + (identifier) @_regex + (#any-of? @_regex "RegexSet" "RegexSetBuilder") .) + name: (identifier) @_new + (#eq? @_new "new")) + arguments: (arguments + (array_expression + (raw_string_literal) @injection.content)) (#set! injection.language "regex")) ((block_comment) @injection.content diff --git a/queries/rust/locals.scm b/queries/rust/locals.scm index bba614536..2b1469bf6 100644 --- a/queries/rust/locals.scm +++ b/queries/rust/locals.scm @@ -3,9 +3,8 @@ name: (identifier) @local.definition.import) (use_declaration - argument: - (scoped_identifier - name: (identifier) @local.definition.import)) + argument: (scoped_identifier + name: (identifier) @local.definition.import)) (use_as_clause alias: (identifier) @local.definition.import) @@ -19,9 +18,8 @@ (function_item name: (identifier) @local.definition.method - parameters: - (parameters - (self_parameter))) + parameters: (parameters + (self_parameter))) ; Variables (parameter @@ -37,9 +35,8 @@ (identifier) @local.definition.var) (let_condition - pattern: - (_ - (identifier) @local.definition.var)) + pattern: (_ + (identifier) @local.definition.var)) (tuple_struct_pattern (identifier) @local.definition.var) diff --git a/queries/scala/highlights.scm b/queries/scala/highlights.scm index 74fde4ea9..45ef1ada4 100644 --- a/queries/scala/highlights.scm +++ b/queries/scala/highlights.scm @@ -97,9 +97,8 @@ function: (operator_identifier) @function.call) (call_expression - function: - (field_expression - field: (identifier) @function.method.call)) + function: (field_expression + field: (identifier) @function.method.call)) ((call_expression function: (identifier) @constructor) diff --git a/queries/scala/locals.scm b/queries/scala/locals.scm index 0ba019cf8..7128a4984 100644 --- a/queries/scala/locals.scm +++ b/queries/scala/locals.scm @@ -43,8 +43,7 @@ name: (identifier) @local.definition.var) (for_expression - enumerators: - (enumerators - (enumerator - (tuple_pattern - (identifier) @local.definition.var)))) + enumerators: (enumerators + (enumerator + (tuple_pattern + (identifier) @local.definition.var)))) diff --git a/queries/slint/highlights.scm b/queries/slint/highlights.scm index d93ba299e..4e108e28d 100644 --- a/queries/slint/highlights.scm +++ b/queries/slint/highlights.scm @@ -162,9 +162,8 @@ (simple_identifier) @variable) (member_access - member: - (expression - (simple_identifier) @property)) + member: (expression + (simple_identifier) @property)) (states_definition name: (simple_identifier) @constant) diff --git a/queries/snakemake/highlights.scm b/queries/snakemake/highlights.scm index b28117402..3e75f142d 100644 --- a/queries/snakemake/highlights.scm +++ b/queries/snakemake/highlights.scm @@ -14,10 +14,9 @@ ; Subordinate directives (eg. input, output) (_ - body: - (_ - (directive - name: _ @label))) + body: (_ + (directive + name: _ @label))) ; rule/module/checkpoint names (rule_definition diff --git a/queries/sourcepawn/highlights.scm b/queries/sourcepawn/highlights.scm index f89331846..6fe94e610 100644 --- a/queries/sourcepawn/highlights.scm +++ b/queries/sourcepawn/highlights.scm @@ -23,9 +23,8 @@ function: (identifier) @function) (call_expression - function: - (field_access - field: (identifier) @function.method.call)) + function: (field_access + field: (identifier) @function.method.call)) ; Types [ diff --git a/queries/sparql/highlights.scm b/queries/sparql/highlights.scm index db4e5a4d0..19c0257ca 100644 --- a/queries/sparql/highlights.scm +++ b/queries/sparql/highlights.scm @@ -206,29 +206,26 @@ (rdf_literal "^^" @type - datatype: - (_ - [ - "<" - ">" - (namespace) - ] @type) @type) + datatype: (_ + [ + "<" + ">" + (namespace) + ] @type) @type) (function_call identifier: (_) @function) (function_call - identifier: - (iri_reference - [ - "<" - ">" - ] @function)) + identifier: (iri_reference + [ + "<" + ">" + ] @function)) (function_call - identifier: - (prefixed_name - (namespace) @function)) + identifier: (prefixed_name + (namespace) @function)) (base_declaration (iri_reference diff --git a/queries/sql/highlights.scm b/queries/sql/highlights.scm index 83d4bf9b2..051dbc825 100644 --- a/queries/sql/highlights.scm +++ b/queries/sql/highlights.scm @@ -28,10 +28,9 @@ alias: (identifier) @variable) (term - value: - (cast - name: (keyword_cast) @function.call - parameter: (literal)?)) + value: (cast + name: (keyword_cast) @function.call + parameter: (literal)?)) (literal) @string diff --git a/queries/squirrel/highlights.scm b/queries/squirrel/highlights.scm index a8c37215d..db4e12429 100644 --- a/queries/squirrel/highlights.scm +++ b/queries/squirrel/highlights.scm @@ -143,11 +143,10 @@ function: (identifier) @function.call) (call_expression - function: - (deref_expression - "." - . - (identifier) @function.call)) + function: (deref_expression + "." + . + (identifier) @function.call)) (call_expression (global_variable @@ -163,14 +162,12 @@ (call_expression [ function: (identifier) @function.builtin - function: - (global_variable - "::" - (_) @function.builtin) - function: - (deref_expression - "." - (_) @function.builtin) + function: (global_variable + "::" + (_) @function.builtin) + function: (deref_expression + "." + (_) @function.builtin) ] (#any-of? @function.builtin ; General Methods diff --git a/queries/ssh_config/injections.scm b/queries/ssh_config/injections.scm index 6c7861e35..d1b24be61 100644 --- a/queries/ssh_config/injections.scm +++ b/queries/ssh_config/injections.scm @@ -7,12 +7,11 @@ (#set! injection.language "bash")) ((parameter - keyword: - [ - "KnownHostsCommand" - "LocalCommand" - "RemoteCommand" - "ProxyCommand" - ] + keyword: [ + "KnownHostsCommand" + "LocalCommand" + "RemoteCommand" + "ProxyCommand" + ] argument: (string) @injection.content) (#set! injection.language "bash")) diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm index 9affc32c1..9ca7aa8b5 100644 --- a/queries/starlark/highlights.scm +++ b/queries/starlark/highlights.scm @@ -33,9 +33,8 @@ ((assignment left: (identifier) @type.definition - right: - (call - function: (identifier) @_func)) + right: (call + function: (identifier) @_func)) (#any-of? @_func "TypeVar" "NewType")) ; Decorators @@ -88,10 +87,9 @@ ((call function: (identifier) @_isinstance - arguments: - (argument_list - (_) - (identifier) @type)) + arguments: (argument_list + (_) + (identifier) @type)) (#eq? @_isinstance "isinstance")) ((identifier) @type.builtin @@ -190,11 +188,10 @@ (string) @string.documentation @spell)) (function_definition - body: - (block - . - (expression_statement - (string) @string.documentation @spell))) + body: (block + . + (expression_statement + (string) @string.documentation @spell))) ; Tokens [ @@ -271,9 +268,8 @@ ((call function: (identifier) @keyword.import - arguments: - (argument_list - (string) @string)) + arguments: (argument_list + (string) @string)) (#eq? @keyword.import "load")) [ @@ -323,10 +319,9 @@ ; Struct definitions ((call function: (identifier) @_func - arguments: - (argument_list - (keyword_argument - name: (identifier) @variable.member))) + arguments: (argument_list + (keyword_argument + name: (identifier) @variable.member))) (#eq? @_func "struct")) ; Function calls @@ -334,16 +329,14 @@ function: (identifier) @function.call) (call - function: - (attribute - attribute: (identifier) @function.method.call)) + function: (attribute + attribute: (identifier) @function.method.call)) ((call function: (identifier) @constructor) (#lua-match? @constructor "^[A-Z]")) ((call - function: - (attribute - attribute: (identifier) @constructor)) + function: (attribute + attribute: (identifier) @constructor)) (#lua-match? @constructor "^[A-Z]")) diff --git a/queries/starlark/locals.scm b/queries/starlark/locals.scm index 5da211f65..82ec0b5d2 100644 --- a/queries/starlark/locals.scm +++ b/queries/starlark/locals.scm @@ -32,14 +32,12 @@ ; Loops ; not a scope! (for_statement - left: - (pattern_list - (identifier) @local.definition.var)) + left: (pattern_list + (identifier) @local.definition.var)) (for_statement - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (for_statement left: (identifier) @local.definition.var) @@ -49,14 +47,12 @@ left: (identifier) @local.definition.var) (for_in_clause - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (for_in_clause - left: - (pattern_list - (identifier) @local.definition.var)) + left: (pattern_list + (identifier) @local.definition.var)) (dictionary_comprehension) @local.scope @@ -69,20 +65,17 @@ left: (identifier) @local.definition.var) (assignment - left: - (pattern_list - (identifier) @local.definition.var)) + left: (pattern_list + (identifier) @local.definition.var)) (assignment - left: - (tuple_pattern - (identifier) @local.definition.var)) + left: (tuple_pattern + (identifier) @local.definition.var)) (assignment - left: - (attribute - (identifier) - (identifier) @local.definition.field)) + left: (attribute + (identifier) + (identifier) @local.definition.field)) ; Walrus operator x := 1 (named_expression @@ -98,7 +91,6 @@ ; Loads ((call function: (identifier) @_fn - arguments: - (argument_list - (string) @local.definition.import)) + arguments: (argument_list + (string) @local.definition.import)) (#eq? @_fn "load")) diff --git a/queries/supercollider/locals.scm b/queries/supercollider/locals.scm index 1707b655a..ea1229047 100644 --- a/queries/supercollider/locals.scm +++ b/queries/supercollider/locals.scm @@ -12,16 +12,14 @@ (#set! "definition.var.scope" "local")) (variable_definition - name: - (variable - (local_var - (identifier) @local.definition.var))) + name: (variable + (local_var + (identifier) @local.definition.var))) (variable_definition - name: - (variable - (environment_var - (identifier) @local.definition.var)) + name: (variable + (environment_var + (identifier) @local.definition.var)) (#set! "definition.var.scope" "global")) (function_definition diff --git a/queries/t32/highlights.scm b/queries/t32/highlights.scm index d98ccd76a..3ddce588a 100644 --- a/queries/t32/highlights.scm +++ b/queries/t32/highlights.scm @@ -129,9 +129,8 @@ function: (identifier) @function.call) (hll_call_expression - function: - (hll_field_expression - field: (hll_field_identifier) @function.call)) + function: (hll_field_expression + field: (hll_field_identifier) @function.call)) ; HLL variables (identifier) @variable @@ -176,10 +175,9 @@ ((command_expression command: (identifier) @keyword - arguments: - (argument_list - . - (identifier) @label)) + arguments: (argument_list + . + (identifier) @label)) (#lua-match? @keyword "^[gG][oO][tT][oO]$")) (labeled_expression diff --git a/queries/t32/locals.scm b/queries/t32/locals.scm index f1c022f6e..91bf7660e 100644 --- a/queries/t32/locals.scm +++ b/queries/t32/locals.scm @@ -12,9 +12,8 @@ (command_expression command: (identifier) - arguments: - (argument_list - declarator: (trace32_hll_variable) @local.definition.var)) + arguments: (argument_list + declarator: (trace32_hll_variable) @local.definition.var)) ; Function definitions (subroutine_block diff --git a/queries/tablegen/highlights.scm b/queries/tablegen/highlights.scm index 7c6d71753..e4084be26 100644 --- a/queries/tablegen/highlights.scm +++ b/queries/tablegen/highlights.scm @@ -58,14 +58,12 @@ name: (identifier) @type) (def - name: - (value - (_) @type)) + name: (value + (_) @type)) (defm - name: - (value - (_) @type)) + name: (value + (_) @type)) (defset name: (identifier) @type) diff --git a/queries/tablegen/locals.scm b/queries/tablegen/locals.scm index 98c52ceac..c73100193 100644 --- a/queries/tablegen/locals.scm +++ b/queries/tablegen/locals.scm @@ -37,14 +37,12 @@ name: (identifier) @local.definition.type) (def - name: - (value - (_) @local.definition.type)) + name: (value + (_) @local.definition.type)) (defm - name: - (value - (_) @local.definition.type)) + name: (value + (_) @local.definition.type)) (defset name: (identifier) @local.definition.type) diff --git a/queries/teal/highlights.scm b/queries/teal/highlights.scm index 8f5be2725..ec80ead0f 100644 --- a/queries/teal/highlights.scm +++ b/queries/teal/highlights.scm @@ -214,20 +214,18 @@ ; The rest of it (var_declaration - declarators: - (var_declarators - (var - name: (identifier) @variable))) + declarators: (var_declarators + (var + name: (identifier) @variable))) (var_declaration - declarators: - (var_declarators - (var - "<" @punctuation.bracket - . - attribute: (attribute) @attribute - . - ">" @punctuation.bracket))) + declarators: (var_declarators + (var + "<" @punctuation.bracket + . + attribute: (attribute) @attribute + . + ">" @punctuation.bracket))) [ "(" diff --git a/queries/teal/locals.scm b/queries/teal/locals.scm index d3a81f122..c2386c632 100644 --- a/queries/teal/locals.scm +++ b/queries/teal/locals.scm @@ -1,14 +1,12 @@ (var_declaration - declarators: - (var_declarators - (var - (identifier)) @local.definition.var)) + declarators: (var_declarators + (var + (identifier)) @local.definition.var)) (var_assignment - variables: - (assignment_variables - (var - (identifier) @local.definition.var) @local.definition.associated)) + variables: (assignment_variables + (var + (identifier) @local.definition.var) @local.definition.associated)) (arg name: (identifier) @local.definition.parameter) diff --git a/queries/terraform/highlights.scm b/queries/terraform/highlights.scm index 1655af31d..a6bf83cdb 100644 --- a/queries/terraform/highlights.scm +++ b/queries/terraform/highlights.scm @@ -35,8 +35,7 @@ (#any-of? @type.builtin "bool" "string" "number" "object" "tuple" "list" "map" "set" "any")) (object_elem - val: - (expression - (variable_expr - (identifier) @type.builtin - (#any-of? @type.builtin "bool" "string" "number" "object" "tuple" "list" "map" "set" "any")))) + val: (expression + (variable_expr + (identifier) @type.builtin + (#any-of? @type.builtin "bool" "string" "number" "object" "tuple" "list" "map" "set" "any")))) diff --git a/queries/tlaplus/locals.scm b/queries/tlaplus/locals.scm index e30f9ec41..f7b481c72 100644 --- a/queries/tlaplus/locals.scm +++ b/queries/tlaplus/locals.scm @@ -43,9 +43,8 @@ parameter: (identifier) @local.definition.parameter) (module_definition - parameter: - (operator_declaration - name: (_) @local.definition.parameter)) + parameter: (operator_declaration + name: (_) @local.definition.parameter)) (operator_definition name: (_) @local.definition.macro @@ -55,9 +54,8 @@ parameter: (identifier) @local.definition.parameter) (operator_definition - parameter: - (operator_declaration - name: (_) @local.definition.parameter)) + parameter: (operator_declaration + name: (_) @local.definition.parameter)) (quantifier_bound (identifier) @local.definition.parameter) diff --git a/queries/turtle/highlights.scm b/queries/turtle/highlights.scm index f4db53c36..30d1f4513 100644 --- a/queries/turtle/highlights.scm +++ b/queries/turtle/highlights.scm @@ -54,10 +54,9 @@ (rdf_literal "^^" @type - datatype: - (_ - [ - "<" - ">" - (namespace) - ] @type) @type) + datatype: (_ + [ + "<" + ">" + (namespace) + ] @type) @type) diff --git a/queries/typescript/highlights.scm b/queries/typescript/highlights.scm index 48f891cc4..5fae21b96 100644 --- a/queries/typescript/highlights.scm +++ b/queries/typescript/highlights.scm @@ -197,11 +197,10 @@ ; property signatures (property_signature name: (property_identifier) @function.method - type: - (type_annotation - [ - (union_type - (parenthesized_type - (function_type))) - (function_type) - ])) + type: (type_annotation + [ + (union_type + (parenthesized_type + (function_type))) + (function_type) + ])) diff --git a/queries/uxntal/highlights.scm b/queries/uxntal/highlights.scm index 622e00b4f..962b6d7b9 100644 --- a/queries/uxntal/highlights.scm +++ b/queries/uxntal/highlights.scm @@ -16,17 +16,15 @@ (rune . - rune_start: - (rune_char - ",") + rune_start: (rune_char + ",") . (identifier) @function.call) (rune . - rune_start: - (rune_char - ";") + rune_start: (rune_char + ";") . (identifier) @function.call) diff --git a/queries/v/highlights.scm b/queries/v/highlights.scm index be038aa34..4e72a0514 100644 --- a/queries/v/highlights.scm +++ b/queries/v/highlights.scm @@ -112,9 +112,8 @@ ; Fields (selector_expression - field: - (reference_expression - (identifier) @variable.member)) + field: (reference_expression + (identifier) @variable.member)) (field_name) @variable.member @@ -156,9 +155,8 @@ name: (identifier) @function.method) (call_expression - name: - (selector_expression - field: (reference_expression) @function.method.call)) + name: (selector_expression + field: (reference_expression) @function.method.call)) (call_expression name: (reference_expression) @function.call) diff --git a/queries/v/injections.scm b/queries/v/injections.scm index ceb93cd3d..f27ab8954 100644 --- a/queries/v/injections.scm +++ b/queries/v/injections.scm @@ -8,16 +8,13 @@ ; regex for the methods defined in `re` module ((call_expression - name: - (selector_expression - field: - (reference_expression - (identifier) @_re)) - arguments: - (argument_list - (argument - (literal - (raw_string_literal) @injection.content - (#offset! @injection.content 0 2 0 -1))))) + name: (selector_expression + field: (reference_expression + (identifier) @_re)) + arguments: (argument_list + (argument + (literal + (raw_string_literal) @injection.content + (#offset! @injection.content 0 2 0 -1))))) (#any-of? @_re "regex_base" "regex_opt" "compile_opt") (#set! injection.language "regex")) diff --git a/queries/v/locals.scm b/queries/v/locals.scm index ba271e04d..a3423f696 100644 --- a/queries/v/locals.scm +++ b/queries/v/locals.scm @@ -2,10 +2,9 @@ name: (identifier) @local.definition.function) ;@function (var_declaration - var_list: - (expression_list - (reference_expression - (identifier) @local.definition.var))) + var_list: (expression_list + (reference_expression + (identifier) @local.definition.var))) (function_declaration name: (identifier) @local.definition.function) @@ -17,17 +16,14 @@ (identifier) @local.reference ((call_expression - name: - (reference_expression - (identifier)) @local.reference) + name: (reference_expression + (identifier)) @local.reference) (#set! reference.kind "call")) ((call_expression - name: - (selector_expression - field: - (reference_expression - (identifier) @local.definition.function))) + name: (selector_expression + field: (reference_expression + (identifier) @local.definition.function))) (#set! reference.kind "call")) (source_file) @local.scope diff --git a/queries/vim/highlights.scm b/queries/vim/highlights.scm index cc51282a7..2950278f9 100644 --- a/queries/vim/highlights.scm +++ b/queries/vim/highlights.scm @@ -42,9 +42,8 @@ function: (identifier) @function.call) (call_expression - function: - (scoped_identifier - (identifier) @function.call)) + function: (scoped_identifier + (identifier) @function.call)) (parameters (identifier) @variable.parameter) @@ -206,10 +205,9 @@ (command_attribute name: _ @property - val: - (behavior - name: _ @constant - val: (identifier)? @function)?) + val: (behavior + name: _ @constant + val: (identifier)? @function)?) ; Edit command (plus_plus_opt diff --git a/queries/vim/locals.scm b/queries/vim/locals.scm index dff662680..870647279 100644 --- a/queries/vim/locals.scm +++ b/queries/vim/locals.scm @@ -7,9 +7,8 @@ name: (identifier) @local.definition.function) (function_declaration - parameters: - (parameters - (identifier) @local.definition.parameter)) + parameters: (parameters + (identifier) @local.definition.parameter)) (let_statement [ diff --git a/queries/wing/highlights.scm b/queries/wing/highlights.scm index 931ca5620..e33829b81 100644 --- a/queries/wing/highlights.scm +++ b/queries/wing/highlights.scm @@ -20,15 +20,13 @@ (keyword_argument_key) @variable.parameter (call - caller: - (reference - (nested_identifier - property: (member_identifier) @function.method.call))) + caller: (reference + (nested_identifier + property: (member_identifier) @function.method.call))) (call - caller: - (reference - (reference_identifier) @function.method.call)) + caller: (reference + (reference_identifier) @function.method.call)) ; Primitives (number) @number diff --git a/queries/yaml/highlights.scm b/queries/yaml/highlights.scm index 375ced906..342d7e563 100644 --- a/queries/yaml/highlights.scm +++ b/queries/yaml/highlights.scm @@ -33,34 +33,30 @@ ] @keyword.directive (block_mapping_pair - key: - (flow_node - [ - (double_quote_scalar) - (single_quote_scalar) - ] @property)) + key: (flow_node + [ + (double_quote_scalar) + (single_quote_scalar) + ] @property)) (block_mapping_pair - key: - (flow_node - (plain_scalar - (string_scalar) @property))) + key: (flow_node + (plain_scalar + (string_scalar) @property))) (flow_mapping (_ - key: - (flow_node - [ - (double_quote_scalar) - (single_quote_scalar) - ] @property))) + key: (flow_node + [ + (double_quote_scalar) + (single_quote_scalar) + ] @property))) (flow_mapping (_ - key: - (flow_node - (plain_scalar - (string_scalar) @property)))) + key: (flow_node + (plain_scalar + (string_scalar) @property)))) [ "," diff --git a/queries/yaml/injections.scm b/queries/yaml/injections.scm index f7bff7360..b05c332fe 100644 --- a/queries/yaml/injections.scm +++ b/queries/yaml/injections.scm @@ -5,84 +5,76 @@ (block_mapping_pair key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") - value: - (flow_node - (plain_scalar - (string_scalar) @injection.content) - (#set! injection.language "bash"))) + value: (flow_node + (plain_scalar + (string_scalar) @injection.content) + (#set! injection.language "bash"))) (block_mapping_pair key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") - value: - (block_node - (block_scalar) @injection.content - (#set! injection.language "bash") - (#offset! @injection.content 0 1 0 0))) + value: (block_node + (block_scalar) @injection.content + (#set! injection.language "bash") + (#offset! @injection.content 0 1 0 0))) (block_mapping_pair key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") - value: - (block_node - (block_sequence - (block_sequence_item - (flow_node - (plain_scalar - (string_scalar) @injection.content)) - (#set! injection.language "bash"))))) + value: (block_node + (block_sequence + (block_sequence_item + (flow_node + (plain_scalar + (string_scalar) @injection.content)) + (#set! injection.language "bash"))))) (block_mapping_pair key: (flow_node) @_run (#any-of? @_run "script" "before_script" "after_script") - value: - (block_node - (block_sequence - (block_sequence_item - (block_node - (block_scalar) @injection.content - (#set! injection.language "bash") - (#offset! @injection.content 0 1 0 0)))))) + value: (block_node + (block_sequence + (block_sequence_item + (block_node + (block_scalar) @injection.content + (#set! injection.language "bash") + (#offset! @injection.content 0 1 0 0)))))) ; Prometheus Alertmanager ("expr") (block_mapping_pair key: (flow_node) @_expr (#eq? @_expr "expr") - value: - (flow_node - (plain_scalar - (string_scalar) @injection.content) - (#set! injection.language "promql"))) + value: (flow_node + (plain_scalar + (string_scalar) @injection.content) + (#set! injection.language "promql"))) (block_mapping_pair key: (flow_node) @_expr (#eq? @_expr "expr") - value: - (block_node - (block_scalar) @injection.content - (#set! injection.language "promql") - (#offset! @injection.content 0 1 0 0))) + value: (block_node + (block_scalar) @injection.content + (#set! injection.language "promql") + (#offset! @injection.content 0 1 0 0))) (block_mapping_pair key: (flow_node) @_expr (#eq? @_expr "expr") - value: - (block_node - (block_sequence - (block_sequence_item - (flow_node - (plain_scalar - (string_scalar) @injection.content)) - (#set! injection.language "promql"))))) + value: (block_node + (block_sequence + (block_sequence_item + (flow_node + (plain_scalar + (string_scalar) @injection.content)) + (#set! injection.language "promql"))))) (block_mapping_pair key: (flow_node) @_expr (#eq? @_expr "expr") - value: - (block_node - (block_sequence - (block_sequence_item - (block_node - (block_scalar) @injection.content - (#set! injection.language "promql") - (#offset! @injection.content 0 1 0 0)))))) + value: (block_node + (block_sequence + (block_sequence_item + (block_node + (block_scalar) @injection.content + (#set! injection.language "promql") + (#offset! @injection.content 0 1 0 0)))))) diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua index 1bc7532b8..f5b129cde 100755 --- a/scripts/format-queries.lua +++ b/scripts/format-queries.lua @@ -201,16 +201,6 @@ local format_queries = [[ ;; Workaround to just use the string's content (anonymous_node (identifier) @format.keep) -(field_definition - name: (_) - ":" @format.indent.begin @format.append-newline ; suppress trailing whitespaces with forced newlines - [ - (named_node [ (named_node) (list) (grouping) (anonymous_node) (field_definition) ]) - (list "[" . (_) . (_) "]") - (grouping "(" . (_) . (_) ")") - (grouping - quantifier: (quantifier)) - ]) ; ( (_) ) handler (grouping |
