This repository has been archived by the owner on Jul 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.tmLanguage.yaml
80 lines (73 loc) · 2.02 KB
/
astro.tmLanguage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Astro
scopeName: text.html.astro
fileTypes:
- '.astro'
patterns:
- include: '#javascript'
- include: '#html'
repository:
javascript:
patterns:
- name: meta.block.js
begin: '\A\s*^---$'
end: '(?=^---$)'
patterns:
- include: 'source.js'
html:
patterns:
- name: meta.block.html
begin: '(?<!\A)\s*^---$'
end: '.\Z'
patterns:
- include: '#astro'
- include: 'text.html.basic'
astro:
patterns:
- include: '#inline-javascript'
- include: '#embedded'
- include: '#components'
repository:
inline-javascript:
patterns:
- name: meta.inline.js
begin: '(?<!\\){'
end: '(?<!\\)}'
patterns:
- include: 'source.js'
embedded:
patterns:
- name: meta.block.embedded.js
begin: '<script>'
end: '</script>'
patterns:
- include: 'source.js'
- name: meta.block.embedded.css
begin: '<style>'
end: '</style>'
patterns:
- include: 'source.css'
components:
patterns:
- name: meta.component.astro
begin: '</?(?=[A-Z])'
end: '/?>'
captures:
'0': { name: punctuation.definition.tag.component.astro }
patterns:
- include: '#component-name'
- include: '#attribute-name'
- include: '#attribute-value'
repository:
component-name:
name: entity.name.type.component.astro
match: '(?<=</?)[A-Z]\w*'
attribute-name:
name: entity.other.attribute-name.astro
match: '(?<=[\s":])\w+'
attribute-value:
patterns:
- name: string.quoted.attribute-value.astro
begin: '(?<==)"'
end: '(?<!\\)"'
- name: string.unquoted.attribute-value.astro
match: '(?<==)\S+'