Skip to content

Commit

Permalink
Fix interpolation scope (#28)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
deathaxe authored Oct 27, 2024
1 parent 0b4c149 commit a2dc54a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NgxHTML.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ contexts:

interpolation:
- match: '{{'
scope: punctuation.section.interpolation.begin.ngx.html
scope: meta.interpolation.ngx.html punctuation.section.interpolation.begin.ngx.html
embed: scope:source.js
embed_scope: meta.interpolation.ngx.html
embed_scope: meta.interpolation.ngx.html source.js.embedded.ngx.html
escape: '}}'
escape_captures:
0: punctuation.section.interpolation.end.ngx.html
0: meta.interpolation.ngx.html punctuation.section.interpolation.end.ngx.html

tag-attributes:
- meta_prepend: true
Expand Down
3 changes: 3 additions & 0 deletions tests/syntax_test_control_flow.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<!-- <- punctuation.section.interpolation.begin.ngx.html -->
<!-- <- punctuation.section.interpolation.end.ngx.html -->
<!-- <- punctuation.section.interpolation.end.ngx.html -->
<!-- ^^ meta.interpolation.ngx.html punctuation.section.interpolation.begin.ngx.html - source.js -->
<!-- ^^^ meta.interpolation.ngx.html source.js.embedded.ngx.html -->
<!-- ^^ meta.interpolation.ngx.html punctuation.section.interpolation.end.ngx.html - source.js -->
}

@if (a > b) {
Expand Down

0 comments on commit a2dc54a

Please sign in to comment.