Skip to content

Commit

Permalink
fix(vscode): fix "as"/"instanceof" expressions syntax highlight (#4412)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk authored May 23, 2024
1 parent 9a61776 commit ff2788d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions extensions/vscode/syntaxes/vue.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@
"name": "source.ts.embedded.html.vue",
"patterns": [
{
"include": "source.ts"
"include": "source.ts#expression"
}
]
}
Expand All @@ -1092,7 +1092,7 @@
"name": "source.ts.embedded.html.vue",
"patterns": [
{
"include": "source.ts"
"include": "source.ts#expression"
}
]
}
Expand Down Expand Up @@ -1257,7 +1257,7 @@
"name": "source.ts.embedded.html.vue",
"patterns": [
{
"include": "source.ts"
"include": "source.ts#expression"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions test-workspace/language-service/syntax/directives.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div @click></div>
<div @click="{}"></div>
<div @click="log('hello'); log('world');"></div>
<div #default></div>
<div #default="args"></div>
<div #></div>
Expand All @@ -15,12 +16,12 @@
<div :foo="':foo=123'"></div>
<div :foo="[{ bar: []}]"></div>
<div .prop="[1, 2]"></div>
<div style="width: 100%; height: auto;"></div>
</template>

<template lang="pug">
div(@click)
div(@click="{}")
div(@click="log('hello'); log('world');")
div(#default)
div(#default="args")
div(#)
Expand All @@ -35,7 +36,6 @@ 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>

<template lang="pug">
Expand All @@ -48,6 +48,7 @@ h1#myId(class="text-right") hello
<template lang="html">
<div @click></div>
<div @click="{}"></div>
<div @click="log('hello'); log('world');"></div>
<div #default></div>
<div #default="args"></div>
<div #></div>
Expand All @@ -62,5 +63,4 @@ h1#myId(class="text-right") hello
<div :foo="':foo=123'"></div>
<div :foo="[{ bar: []}]"></div>
<div .prop="[1, 2]"></div>
<div style="width: 100%; height: auto;"></div>
</template>
1 change: 1 addition & 0 deletions test-workspace/language-service/syntax/generic.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script setup generic="T"></script>
7 changes: 7 additions & 0 deletions test-workspace/language-service/syntax/inline-style.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div style="width: 100%; height: auto;"></div>
</template>

<template lang="pug">
div(style="width: 100%; height: auto;")
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div v-if="var as XXX"></div>
<div v-if="var instanceof XXX"></div>
<div v-if="typeof xxx"></div>
<div v-if="typeof XXX"></div>
<div v-if="''.toString('xxx')"></div>
</template>

0 comments on commit ff2788d

Please sign in to comment.