Skip to content

Commit 5c4ce45

Browse files
author
deathaxe
committed
Merge pull request #46 from SublimeText/develop
Align mustache tag scope with other languages
2 parents 229ed9e + 5014134 commit 5c4ce45

4 files changed

+131
-119
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1+
# MacOS specific ignores
12
.DS_Store
3+
4+
# development
5+
.sublime/
6+
.venv/
7+
.vscode/
8+
9+
# python cache files
10+
__pycache__/
11+
*.pyc

Vue Component.sublime-syntax

+24-22
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ contexts:
6767

6868
prototype:
6969
- meta_prepend: true
70-
- include: mustache-templates
70+
- include: mustache-interpolations
7171

7272
tag-html:
7373
- meta_prepend: true
@@ -717,36 +717,38 @@ contexts:
717717
cdata-content:
718718
- meta_prepend: true
719719
- meta_include_prototype: false
720-
- include: mustache-interpolations
720+
- include: mustache-string-interpolations
721721

722722
strings-common-content:
723723
- meta_prepend: true
724-
- include: mustache-interpolations
724+
- include: mustache-string-interpolations
725725

726726
###[ MUSTAGE TEMPLATES ]######################################################
727727

728-
mustache-interpolations:
729-
- match: (?={{)
730-
push: mustache-interpolation-content
728+
mustache-string-interpolations:
729+
- match: '{{'
730+
scope: meta.embedded.expression.vue punctuation.section.embedded.begin.html
731+
push: mustache-string-interpolation-body
731732

732-
mustache-interpolation-content:
733+
mustache-string-interpolation-body:
733734
- clear_scopes: 1
734-
- include: mustache-templates
735-
- include: immediately-pop
735+
- meta_include_prototype: false
736+
- meta_content_scope: meta.embedded.expression.vue source.js.embedded.vue
737+
- include: mustache-interpolation-body
736738

737-
mustache-templates:
739+
mustache-interpolations:
738740
- match: '{{'
739-
scope: meta.interpolation.vue punctuation.section.interpolation.begin.html
740-
push:
741-
- mustache-template-end
742-
- scope:source.js#expression
741+
scope: meta.embedded.expression.vue punctuation.section.embedded.begin.html
742+
push: mustache-interpolation-body
743743

744-
mustache-template-end:
744+
mustache-interpolation-body:
745745
- meta_include_prototype: false
746-
- meta_content_scope: meta.interpolation.vue source.js.embedded.vue
746+
- meta_content_scope: meta.embedded.expression.vue source.js.embedded.vue
747747
- match: '}}'
748-
scope: meta.interpolation.vue punctuation.section.interpolation.end.html
748+
scope: meta.embedded.expression.vue punctuation.section.embedded.end.html
749749
pop: 1
750+
- match: (?=\S)
751+
push: scope:source.js#expression
750752

751753
###[ VUE DIRECTIVES ]#########################################################
752754

@@ -791,7 +793,7 @@ contexts:
791793
- meta_include_prototype: false
792794
# https://vuejs.org/guide/essentials/template-syntax.html#dynamic-arguments
793795
- match: \[
794-
scope: punctuation.section.interpolation.begin.vue
796+
scope: punctuation.section.embedded.begin.vue
795797
set:
796798
- vue-dynamic-parameter-name-end
797799
- scope:source.js#expression
@@ -800,10 +802,10 @@ contexts:
800802

801803
vue-dynamic-parameter-name-end:
802804
- meta_include_prototype: false
803-
- meta_scope: meta.directive.parameter.vue meta.interpolation.vue
805+
- meta_scope: meta.directive.parameter.vue meta.embedded.expression.vue
804806
- meta_content_scope: source.js.embedded.vue
805807
- match: \]
806-
scope: punctuation.section.interpolation.end.vue
808+
scope: punctuation.section.embedded.end.vue
807809
set: vue-directive-modifiers
808810

809811
vue-static-parameter-name:
@@ -843,7 +845,7 @@ contexts:
843845
vue-directive-double-quoted-value:
844846
- meta_include_prototype: false
845847
- meta_scope: meta.directive.value.vue meta.string.vue
846-
- meta_content_scope: meta.interpolation.vue source.js.embedded.vue
848+
- meta_content_scope: meta.embedded.expression.vue source.js.embedded.vue
847849
- match: \"
848850
scope: string.quoted.double.vue punctuation.definition.string.end.vue
849851
pop: 1
@@ -853,7 +855,7 @@ contexts:
853855
vue-directive-single-quoted-value:
854856
- meta_include_prototype: false
855857
- meta_scope: meta.directive.value.vue meta.string.vue
856-
- meta_content_scope: meta.interpolation.vue source.js.embedded.vue
858+
- meta_content_scope: meta.embedded.expression.vue source.js.embedded.vue
857859
- match: \'
858860
scope: string.quoted.single.vue punctuation.definition.string.end.vue
859861
pop: 1

0 commit comments

Comments
 (0)