From bff5f62ba14499cdcc741aab400c225c1d9b4e25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:00:54 +0000 Subject: [PATCH 1/4] Initial plan From 926c57582b20a41a95cf1bbda7d0ac6ac55cc2bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:12:02 +0000 Subject: [PATCH 2/4] Support instanceof operator and arrow functions from Angular 21.2 Co-authored-by: princemaple <1329716+princemaple@users.noreply.github.com> Agent-Logs-Url: https://github.com/princemaple/ngx-html-syntax/sessions/66972ff1-40e0-490d-a244-cf94cc57ad77 --- NgxHTML.sublime-syntax | 4 +++- tests/syntax_test_scopes.component.html | 27 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/NgxHTML.sublime-syntax b/NgxHTML.sublime-syntax index 3108696..b9e5df3 100644 --- a/NgxHTML.sublime-syntax +++ b/NgxHTML.sublime-syntax @@ -561,6 +561,8 @@ contexts: scope: punctuation.separator.sequence.ngx - match: ';' scope: punctuation.terminator.expression.ngx + - match: '=>' + scope: keyword.operator.assignment.arrow.ngx - match: (?:\*\*|&&|\|\||\?\?|[-+*/%])= scope: keyword.operator.assignment.augmented.ngx - match: '[!=]==?|[<>]=?' @@ -578,7 +580,7 @@ contexts: push: ng-ternary-expression - match: in{{ident_break}} scope: keyword.operator.comparison.ngx - - match: (?:typeof|void){{ident_break}} + - match: (?:typeof|void|instanceof){{ident_break}} scope: keyword.operator.type.ngx ng-ternary-expression: diff --git a/tests/syntax_test_scopes.component.html b/tests/syntax_test_scopes.component.html index e61f72a..483c69e 100644 --- a/tests/syntax_test_scopes.component.html +++ b/tests/syntax_test_scopes.component.html @@ -823,6 +823,33 @@ + {{ obj instanceof SomeClass }} + + + + + + {{ (x) => x * 2 }} + + + + + + + + {{ items.filter(item => item.active) }} + + + + + + + + + + + + {{ person['name'][0] = "Mirabel" }} From c248aa47bf08e77d60441ff097311dc47b7b016a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:12:58 +0000 Subject: [PATCH 3/4] Scope arrow params as variable.parameter.ngx, use keyword.declaration.function.arrow.ngx Co-authored-by: princemaple <1329716+princemaple@users.noreply.github.com> Agent-Logs-Url: https://github.com/princemaple/ngx-html-syntax/sessions/ead32532-920a-4084-bebd-bd2e6e516772 --- NgxHTML.sublime-syntax | 37 ++++++++++++++++++++++++- tests/syntax_test_scopes.component.html | 8 +++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/NgxHTML.sublime-syntax b/NgxHTML.sublime-syntax index b9e5df3..15029ff 100644 --- a/NgxHTML.sublime-syntax +++ b/NgxHTML.sublime-syntax @@ -418,6 +418,7 @@ contexts: ng-expressions: # https://angular.dev/guide/templates/expression-syntax - include: ng-arrays + - include: ng-arrow-functions - include: ng-groups - include: ng-objects - include: ng-function-calls @@ -458,6 +459,40 @@ contexts: pop: 1 - include: ng-expressions +###[ ANGULAR ARROW FUNCTIONS ]################################################# + + ng-arrow-functions: + # single param without parens: x => + - match: '{{ident_name}}(?=\s*=>)' + scope: variable.parameter.ngx + # grouped params: (x) => or (x, y) => + - match: \( + scope: punctuation.section.group.begin.ngx + branch_point: ng-arrow-params + branch: + - ng-arrow-params-body + - ng-group-body + + ng-arrow-params-body: + - meta_scope: meta.group.ngx + - match: \) + scope: punctuation.section.group.end.ngx + set: ng-after-arrow-params + - match: ',' + scope: punctuation.separator.parameters.ngx + - match: '{{ident_name}}' + scope: variable.parameter.ngx + - match: (?=\S) + fail: ng-arrow-params + + ng-after-arrow-params: + - match: \s*(=>) + captures: + 1: keyword.declaration.function.arrow.ngx + pop: 1 + - match: '' + fail: ng-arrow-params + ###[ ANGULAR OBJECTS ]######################################################### ng-objects: @@ -562,7 +597,7 @@ contexts: - match: ';' scope: punctuation.terminator.expression.ngx - match: '=>' - scope: keyword.operator.assignment.arrow.ngx + scope: keyword.declaration.function.arrow.ngx - match: (?:\*\*|&&|\|\||\?\?|[-+*/%])= scope: keyword.operator.assignment.augmented.ngx - match: '[!=]==?|[<>]=?' diff --git a/tests/syntax_test_scopes.component.html b/tests/syntax_test_scopes.component.html index 483c69e..b6630b5 100644 --- a/tests/syntax_test_scopes.component.html +++ b/tests/syntax_test_scopes.component.html @@ -831,9 +831,9 @@ {{ (x) => x * 2 }} - + - + @@ -843,8 +843,8 @@ - - + + From 54f53e481c16ce0d9bc9963b61d6cbbf70605609 Mon Sep 17 00:00:00 2001 From: Po Chen Date: Wed, 25 Mar 2026 06:42:19 +1100 Subject: [PATCH 4/4] Update NgxHTML.sublime-syntax Co-authored-by: deathaxe <16542113+deathaxe@users.noreply.github.com> --- NgxHTML.sublime-syntax | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/NgxHTML.sublime-syntax b/NgxHTML.sublime-syntax index 15029ff..4d9f4fa 100644 --- a/NgxHTML.sublime-syntax +++ b/NgxHTML.sublime-syntax @@ -486,11 +486,10 @@ contexts: fail: ng-arrow-params ng-after-arrow-params: - - match: \s*(=>) - captures: - 1: keyword.declaration.function.arrow.ngx + - match: '=>' + scope: keyword.declaration.function.arrow.ngx pop: 1 - - match: '' + - match: (?=\S) fail: ng-arrow-params ###[ ANGULAR OBJECTS ]#########################################################