Skip to content

Commit bb68aa4

Browse files
committed
Merge branch 'develop'
2 parents 922a753 + 36cc10c commit bb68aa4

File tree

2 files changed

+48
-31
lines changed

2 files changed

+48
-31
lines changed

Vue Component.sublime-syntax

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -714,35 +714,41 @@ contexts:
714714
- meta_content_scope: meta.directive.vue
715715
- match: =
716716
scope: meta.directive.vue punctuation.separator.key-value.vue
717-
set: vue-directive-value
717+
set:
718+
- immediately-pop
719+
- vue-directive-value
718720
- include: else-pop
719721

720722
vue-directive-value:
721-
- meta_content_scope: meta.directive.vue
722723
- match: \"
723-
scope: string.quoted.double.vue punctuation.definition.string.begin.vue
724-
set: vue-directive-double-quoted-value
725-
- match: \'
726-
scope: string.quoted.single.vue punctuation.definition.string.begin.vue
727-
set: vue-directive-single-quoted-value
728-
- include: else-pop
729-
730-
vue-directive-double-quoted-value:
731-
- meta_include_prototype: false
732-
- meta_scope: meta.directive.value.vue meta.string.vue
733-
- meta_content_scope: meta.embedded.expression.vue source.js.embedded.vue
734-
- match: \"
735-
scope: string.quoted.double.vue punctuation.definition.string.end.vue
724+
scope:
725+
meta.directive.value.vue meta.string.vue
726+
string.quoted.double.vue punctuation.definition.string.begin.vue
727+
embed: javascript-expressions
728+
embed_scope:
729+
meta.directive.value.vue meta.string.vue
730+
meta.embedded.expression.vue source.js.embedded.vue
731+
escape: \"
732+
escape_captures:
733+
0: meta.directive.value.vue meta.string.vue
734+
string.quoted.double.vue punctuation.definition.string.end.vue
736735
pop: 1
737-
- match: (?=\S)
738-
push: scope:source.js#expression
739-
740-
vue-directive-single-quoted-value:
741-
- meta_include_prototype: false
742-
- meta_scope: meta.directive.value.vue meta.string.vue
743-
- meta_content_scope: meta.embedded.expression.vue source.js.embedded.vue
744736
- match: \'
745-
scope: string.quoted.single.vue punctuation.definition.string.end.vue
737+
scope:
738+
meta.directive.value.vue meta.string.vue
739+
string.quoted.single.vue punctuation.definition.string.begin.vue
740+
embed: javascript-expressions
741+
embed_scope:
742+
meta.directive.value.vue meta.string.vue
743+
meta.embedded.expression.vue source.js.embedded.vue
744+
escape: \'
745+
escape_captures:
746+
0: meta.directive.value.vue meta.string.vue
747+
string.quoted.single.vue punctuation.definition.string.end.vue
746748
pop: 1
749+
- include: else-pop
750+
751+
javascript-expressions:
752+
# required until ST4176
747753
- match: (?=\S)
748754
push: scope:source.js#expression

tests/syntax_test_directive.vue

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,6 @@
247247
// ^^^^^^^ meta.string.js string.quoted.double.js
248248
// ^ keyword.operator.ternary.js
249249
// ^^^^^ meta.string.js string.quoted.double.js
250-
width: `'${width + "double" + 'single' + quoted}px'` // note the single quotes!
251-
// ^^ meta.string string.quoted.other.js
252-
// ^^^^^^^^^^ meta.string meta.interpolation.js - string
253-
// ^^^^^^^^ meta.interpolation.js string.quoted.double.js
254-
// ^^^ meta.string meta.interpolation.js - string
255-
// ^^^^^^^^ meta.interpolation.js string.quoted.single.js
256-
// ^^^^^^^^^^ meta.string meta.interpolation.js - string
257-
// ^^^^ meta.string string.quoted.other.js
258250
}'>
259251
//^^^ meta.directive.value.vue meta.string.vue meta.embedded.expression.vue source.js.embedded.vue meta.mapping.js
260252
// ^ meta.directive.value.vue meta.string.vue string.quoted.single.vue punctuation.definition.string.end.vue
@@ -385,3 +377,22 @@
385377
// ^ meta.tag.template.begin.html meta.directive.vue
386378
// ^ meta.tag.template.begin.html - meta.directive
387379
// ^ - meta.tag
380+
381+
382+
// https://github.com/SublimeText/Vue/issues/48
383+
384+
<Component :name="obj?.name!" />
385+
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.other.html
386+
// ^ punctuation.definition.tag.begin.html
387+
// ^^^^^^^^^ entity.name.tag.other.html
388+
// ^ meta.directive.vue keyword.other.directive.vue
389+
// ^^^^ meta.directive.parameter.vue entity.other.attribute-name.vue
390+
// ^ meta.directive.vue punctuation.separator.key-value.vue
391+
// ^ meta.directive.value.vue meta.string.vue string.quoted.double.vue punctuation.definition.string.begin.vue
392+
// ^^^^^^^^^^ meta.directive.value.vue meta.string.vue meta.embedded.expression.vue source.js.embedded.vue
393+
// ^^^ variable.other.readwrite.js
394+
// ^^ punctuation.accessor.js
395+
// ^^^^ meta.property.object.js
396+
// ^ keyword.operator.logical.js
397+
// ^ meta.directive.value.vue meta.string.vue string.quoted.double.vue punctuation.definition.string.end.vue
398+
// ^^ punctuation.definition.tag.end.html

0 commit comments

Comments
 (0)