diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index b9b5b8e0..da966e0d 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -40,18 +40,18 @@ (type_name "(" @punctuation.bracket "=>" @punctuation.delimiter ")" @punctuation.bracket) ; Definitions -(struct_declaration +(struct_declaration name: (identifier) @type) -(enum_declaration +(enum_declaration name: (identifier) @type) (contract_declaration - name: (identifier) @type) + name: (identifier) @type) (library_declaration - name: (identifier) @type) + name: (identifier) @type) (interface_declaration name: (identifier) @type) -(event_definition - name: (identifier) @type) +(event_definition + name: (identifier) @type) (function_definition name: (identifier) @function) @@ -68,26 +68,26 @@ (struct_member name: (identifier) @property) (enum_value) @constant -; Invocations -(emit_statement . (identifier) @type) +; Invocations +(emit_statement . (_) @type) (modifier_invocation (identifier) @function) -(call_expression . (member_expression property: (identifier) @function.method)) -(call_expression . (identifier) @function) +(call_expression . (_(member_expression property: (_) @function.method))) +(call_expression . (expression(identifier)) @function) ; Function parameters -(call_struct_argument name: (identifier) @field) -(event_paramater name: (identifier) @variable.parameter) +(call_struct_argument name: (_) @field) +(event_parameter name: (identifier) @parameter) (parameter name: (identifier) @variable.parameter) ; Yul functions (yul_function_call function: (yul_identifier) @function) -(yul_function_definition . (yul_identifier) @function (yul_identifier) @variable.parameter) +(yul_function_definition . (yul_identifier) @function (yul_identifier) @parameter) ; Structs and members (member_expression property: (identifier) @property) -(struct_expression type: ((identifier) @type .)) +(struct_expression type: ((expression(identifier)) @type .)) (struct_field_assignment name: (identifier) @property) @@ -146,7 +146,7 @@ [ "try" "catch" -] @keyword.exception +] @exception [ "return" @@ -155,11 +155,11 @@ "function" @keyword.function -"import" @keyword.import -(import_directive "as" @keyword.import) -(import_directive "from" @keyword.import) +"import" @include +(import_directive "as" @include) +(import_directive "from" @include) -(event_paramater "indexed" @keyword) +(event_parameter "indexed" @keyword) ; Punctuation @@ -185,7 +185,6 @@ "&&" "||" ">>" - ">>>" "<<" "&" "^" @@ -200,7 +199,6 @@ "<=" "==" "!=" - "!==" ">=" ">" "!"