Skip to content

Commit

Permalink
fix: syntax highlighting for .prop shorthand (vuejs#3729)
Browse files Browse the repository at this point in the history
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
  • Loading branch information
so1ve and johnsoncodehk committed Dec 4, 2023
1 parent c341646 commit 76aeb2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/vscode/syntaxes/vue.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@
]
},
"vue-directives-original": {
"begin": "(?:\\b(v-)|(:)|(@)|(#))(\\[?)([\\w\\-]*)(\\]?)(?:\\.([\\w\\-]*))*",
"begin": "(?:\\b(v-)|([:\\.])|(@)|(#))(\\[?)([\\w\\-]*)(\\]?)(?:\\.([\\w\\-]*))*",
"beginCaptures": {
"1": {
"name": "entity.other.attribute-name.html.vue"
Expand Down
3 changes: 3 additions & 0 deletions test-workspace/language-service/syntax/directives.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<div v-if="true" v-else-if="true" v-else></div>
<div :foo="':foo=123'"></div>
<div :foo="[{ bar: []}]"></div>
<div .prop="[1, 2]"></div>
<div style="width: 100%; height: auto;"></div>
</template>

Expand All @@ -33,6 +34,7 @@ div(v-for="n in []")
div(v-if="true" v-else-if="true" v-else)
div(:foo="':foo=123'")
div(:foo="[{ bar: []}]")
div(.prop="[1, 2]")
div(style="width: 100%; height: auto;")
</template>

Expand All @@ -59,5 +61,6 @@ h1#myId(class="text-right") hello
<div v-if="true" v-else-if="true" v-else></div>
<div :foo="':foo=123'"></div>
<div :foo="[{ bar: []}]"></div>
<div .prop="[1, 2]"></div>
<div style="width: 100%; height: auto;"></div>
</template>

0 comments on commit 76aeb2c

Please sign in to comment.