Skip to content

Commit f5d517f

Browse files
lucario387theHamsta
authored andcommitted
Fix(vue): Invalid match queries
1 parent 8abb563 commit f5d517f

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

queries/vue/injections.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
(start_tag) @_no_attribute
44
(raw_text) @css)
55
(#match? @_no_attribute "^\\<\\s*style\\s*\\>$")
6+
; unsure why, but without escaping &lt; and &gt; the query breaks
67
)
78

89
(
Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,68 @@
11
<template>
2-
<span>{{"Some text"}}</span>
2+
<span>{{"Text inside interpolation"}}</span>
33
<!-- ^ javascript
44
-->
55

66
<template lang="pug">
77
ul
88
li(v-for="item in items")
9-
a(v-if="item.type == 'link'" :href="item.url") some link title:
9+
a(v-if="item.type == 'link'" :href="item.url") some link title in pug:
1010
<!-- ^ pug
1111
-->
1212
</template>
1313

14-
<template v-if="true"></template>
14+
<template v-if="'text inside directives'"></template>
1515
<!-- ^ javascript
1616
-->
1717
</template>
1818
<script>
1919
const foo = "1"
2020
// ^ javascript
2121
</script>
22-
<script defer lang="js">
22+
<script defer>
2323
const foo = "1"
2424
// ^ javascript
2525
</script>
26-
<script lang="ts">
26+
<script lang="js">
2727
const foo = "1"
28-
// ^ typescript
28+
// ^ javascript
29+
</script>
30+
<script lang="ts">
31+
const foo: number = "1"
32+
// ^ typescript
2933
</script>
3034
<style>
3135
.bar {
32-
/* ^ css*/
36+
/* ^ css
37+
*/
38+
}
39+
</style>
40+
<style scoped>
41+
.page.page--news {
42+
padding: calc(var(--header-height)) 1rem 0 1rem;
43+
display: flex;
44+
justify-content: center;
45+
align-items: center;
46+
width: 100vw;
47+
min-height: calc(var(--vh, 1vh) * 100 - var(--header-height));
48+
background: rebeccapurple;
49+
/* ^ css
50+
*/
51+
}
52+
</style>
53+
<style lang="css">
54+
.bar {
55+
justify-content: center;
56+
/* ^ css
57+
*/
3358
}
3459
</style>
3560
<style lang="scss">
3661
.bar {
3762
&-baz {
63+
&.page{
3864
// ^ scss
65+
}
3966
}
4067
}
4168
</style>

0 commit comments

Comments
 (0)