Skip to content

Commit 0b4c149

Browse files
authored
add simple highlight for @let
1 parent 5ab46f7 commit 0b4c149

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

NgxHTML.sublime-syntax

+10-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ version: 2
99
extends: Packages/HTML/HTML.sublime-syntax
1010

1111
variables:
12-
angular_blocks: (?<=\@)\b(?xi:for | if | else | else if | switch | case | empty | placeholder | defer | default | error | loading)\b
12+
angular_blocks: (?<=\@)\b(?xi:for | if | else | else if | switch | case | empty | placeholder | defer | default | error | loading | let)\b
1313

1414
contexts:
1515
main:
1616
- meta_prepend: true
1717
- include: interpolation
18-
- include: angular-blocks
18+
- include: ng-control-flow
1919

2020
interpolation:
2121
- match: '{{'
@@ -88,12 +88,19 @@ contexts:
8888
- tag-event-attribute-assignment
8989

9090

91-
angular-blocks:
91+
ng-control-flow:
9292
- match: '(@){{angular_blocks}}'
9393
scope: keyword.control.control-flow.html
9494
captures:
9595
1: punctuation.definition.keyword.html
9696
push:
97+
- match: '='
98+
scope: punctuation.section.let.begin.ngx.html
99+
push:
100+
- meta_scope: meta.let.ngx.html
101+
- match: ';'
102+
scope: punctuation.section.let.end.ngx.html
103+
pop: 2
97104
- match: \{
98105
scope: punctuation.section.block.begin.html
99106
push:

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Highlighting the JS part as JS. So,
3131

3232
Now it supports Angular control flow.
3333

34+
```
35+
@let myVar = myObservable | async;
36+
```
37+
3438
```
3539
@for (item of items) {
3640
<a [href]="item.link">{{item.title}}</a>

0 commit comments

Comments
 (0)