Skip to content

Commit a2dc54a

Browse files
author
deathaxe
authored
Fix interpolation scope (#28)
This commit... 1. applies `meta.interpolation` to `{{` and `}}` interpolation punctuation. 2. adds `source.js.embedded` to interpolation content, so java script specific settings and completions apply.
1 parent 0b4c149 commit a2dc54a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

NgxHTML.sublime-syntax

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ contexts:
1919

2020
interpolation:
2121
- match: '{{'
22-
scope: punctuation.section.interpolation.begin.ngx.html
22+
scope: meta.interpolation.ngx.html punctuation.section.interpolation.begin.ngx.html
2323
embed: scope:source.js
24-
embed_scope: meta.interpolation.ngx.html
24+
embed_scope: meta.interpolation.ngx.html source.js.embedded.ngx.html
2525
escape: '}}'
2626
escape_captures:
27-
0: punctuation.section.interpolation.end.ngx.html
27+
0: meta.interpolation.ngx.html punctuation.section.interpolation.end.ngx.html
2828

2929
tag-attributes:
3030
- meta_prepend: true

tests/syntax_test_control_flow.component.html

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<!-- <- punctuation.section.interpolation.begin.ngx.html -->
2525
<!-- <- punctuation.section.interpolation.end.ngx.html -->
2626
<!-- <- punctuation.section.interpolation.end.ngx.html -->
27+
<!-- ^^ meta.interpolation.ngx.html punctuation.section.interpolation.begin.ngx.html - source.js -->
28+
<!-- ^^^ meta.interpolation.ngx.html source.js.embedded.ngx.html -->
29+
<!-- ^^ meta.interpolation.ngx.html punctuation.section.interpolation.end.ngx.html - source.js -->
2730
}
2831

2932
@if (a > b) {

0 commit comments

Comments
 (0)