From 6ab900df5e63472d6c02fc287dd5a64af75e2c0c Mon Sep 17 00:00:00 2001 From: Leonard Paturel Date: Wed, 19 Feb 2025 10:05:58 +0800 Subject: [PATCH 1/2] fixed solidity event parameter typo --- queries/solidity/highlights.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index b9b5b8e0..5e8e54f7 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -77,7 +77,7 @@ ; Function parameters (call_struct_argument name: (identifier) @field) -(event_paramater name: (identifier) @variable.parameter) +(event_parameter name: (identifier) @variable.parameter) (parameter name: (identifier) @variable.parameter) ; Yul functions @@ -159,7 +159,7 @@ (import_directive "as" @keyword.import) (import_directive "from" @keyword.import) -(event_paramater "indexed" @keyword) +(event_parameter "indexed" @keyword) ; Punctuation From db956e4086ed50d0a2a3d80e697b9fd92a5326b3 Mon Sep 17 00:00:00 2001 From: LeoPatOZ Date: Wed, 19 Feb 2025 10:25:08 +0800 Subject: [PATCH 2/2] updated solidity highlight.scm --- queries/solidity/highlights.scm | 38 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index 5e8e54f7..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_parameter 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,9 +155,9 @@ "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_parameter "indexed" @keyword) @@ -185,7 +185,6 @@ "&&" "||" ">>" - ">>>" "<<" "&" "^" @@ -200,7 +199,6 @@ "<=" "==" "!=" - "!==" ">=" ">" "!"