Skip to content

Commit 46d9458

Browse files
sebthomvrubezhny
authored andcommitted
Update Vue syntax files
1 parent ebf3a6a commit 46d9458

File tree

9 files changed

+230
-44
lines changed

9 files changed

+230
-44
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021-present Johnson Chu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This is a copy from https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue/syntaxes/
1+
This is a copy from https://github.com/vuejs/language-tools/tree/v2.2.8/extensions/vscode/syntaxes

org.eclipse.wildwebdeveloper/grammars/vue/markdown-vue.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"name": "fenced_code.block.language.markdown"
2121
},
2222
"5": {
23-
"name": "fenced_code.block.language.attributes.markdown"
23+
"name": "fenced_code.block.language.attributes.markdown",
24+
"patterns": []
2425
}
2526
},
2627
"endCaptures": {
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"fileTypes": [ ],
3+
"scopeName": "mdx.vue.codeblock",
4+
"injectionSelector": "L:source.mdx",
5+
"patterns": [
6+
{
7+
"include": "#vue-code-block"
8+
}
9+
],
10+
"repository": {
11+
"vue-code-block": {
12+
"patterns": [
13+
{
14+
"begin": "(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:(?:.*\\.)?vue))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)",
15+
"beginCaptures": {
16+
"1": {
17+
"name": "string.other.begin.code.fenced.mdx"
18+
},
19+
"2": {
20+
"name": "entity.name.function.mdx"
21+
}
22+
},
23+
"contentName": "meta.embedded.vue",
24+
"end": "(\\1)(?:[\\t ]*$)",
25+
"endCaptures": {
26+
"1": {
27+
"name": "string.other.end.code.fenced.mdx"
28+
}
29+
},
30+
"name": "markup.code.vue.mdx",
31+
"patterns": [
32+
{
33+
"include": "source.vue"
34+
}
35+
]
36+
},
37+
{
38+
"begin": "(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:(?:.*\\.)?vue))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)",
39+
"beginCaptures": {
40+
"1": {
41+
"name": "string.other.begin.code.fenced.mdx"
42+
},
43+
"2": {
44+
"name": "entity.name.function.mdx"
45+
}
46+
},
47+
"contentName": "meta.embedded.vue",
48+
"end": "(\\1)(?:[\\t ]*$)",
49+
"endCaptures": {
50+
"1": {
51+
"name": "string.other.end.code.fenced.mdx"
52+
}
53+
},
54+
"name": "markup.code.vue.mdx",
55+
"patterns": [
56+
{
57+
"include": "source.vue"
58+
}
59+
]
60+
}
61+
]
62+
}
63+
}
64+
}

org.eclipse.wildwebdeveloper/grammars/vue/vue-directives.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
33
"fileTypes": [],
4-
"injectionSelector": "L:meta.tag -meta.attribute -entity.name.tag.pug -attribute_value -source.tsx -source.js.jsx, L:meta.element -meta.attribute",
4+
"injectionSelector": "L:meta.tag -meta.attribute -meta.ng-binding -entity.name.tag.pug -attribute_value -source.tsx -source.js.jsx, L:meta.element -meta.attribute",
55
"patterns": [
66
{
77
"include": "source.vue#vue-directives"

org.eclipse.wildwebdeveloper/grammars/vue/vue.tmLanguage.json

Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"name": "Vue",
44
"scopeName": "source.vue",
55
"patterns": [
6+
{
7+
"include": "#vue-comments"
8+
},
69
{
710
"include": "text.html.basic#comment"
811
},
@@ -439,6 +442,38 @@
439442
}
440443
]
441444
},
445+
{
446+
"begin": "([a-zA-Z0-9:-]+)\\b(?=[^>]*\\blang\\s*=\\s*(['\"]?)coffee\\b\\2)",
447+
"beginCaptures": {
448+
"1": {
449+
"name": "entity.name.tag.$1.html.vue"
450+
}
451+
},
452+
"end": "(</)(\\1)\\s*(?=>)",
453+
"endCaptures": {
454+
"1": {
455+
"name": "punctuation.definition.tag.begin.html.vue"
456+
},
457+
"2": {
458+
"name": "entity.name.tag.$2.html.vue"
459+
}
460+
},
461+
"patterns": [
462+
{
463+
"include": "#tag-stuff"
464+
},
465+
{
466+
"begin": "(?<=>)",
467+
"end": "(?=<\\/)",
468+
"name": "source.coffee",
469+
"patterns": [
470+
{
471+
"include": "source.coffee"
472+
}
473+
]
474+
}
475+
]
476+
},
442477
{
443478
"begin": "([a-zA-Z0-9:-]+)\\b(?=[^>]*\\blang\\s*=\\s*(['\"]?)json\\b\\2)",
444479
"beginCaptures": {
@@ -953,44 +988,58 @@
953988
]
954989
},
955990
"vue-directives-original": {
956-
"begin": "(?:\\b(v-)|(:)|(@)|(#))(\\[?)([\\w\\-]*)(\\]?)(?:\\.([\\w\\-]*))*",
991+
"begin": "(?:(?:(v-[\\w-]+)(:)?)|([:\\.])|(@)|(#))(?:(?:(\\[)([^\\]]*)(\\]))|([\\w-]+))?",
957992
"beginCaptures": {
958993
"1": {
959994
"name": "entity.other.attribute-name.html.vue"
960995
},
961996
"2": {
962-
"name": "punctuation.attribute-shorthand.bind.html.vue"
997+
"name": "punctuation.separator.key-value.html.vue"
963998
},
964999
"3": {
965-
"name": "punctuation.attribute-shorthand.event.html.vue"
1000+
"name": "punctuation.attribute-shorthand.bind.html.vue"
9661001
},
9671002
"4": {
968-
"name": "punctuation.attribute-shorthand.slot.html.vue"
1003+
"name": "punctuation.attribute-shorthand.event.html.vue"
9691004
},
9701005
"5": {
971-
"name": "punctuation.separator.key-value.html.vue"
1006+
"name": "punctuation.attribute-shorthand.slot.html.vue"
9721007
},
9731008
"6": {
974-
"name": "entity.other.attribute-name.html.vue"
1009+
"name": "punctuation.separator.key-value.html.vue"
9751010
},
9761011
"7": {
977-
"name": "punctuation.separator.key-value.html.vue"
1012+
"name": "source.ts.embedded.html.vue",
1013+
"patterns": [
1014+
{
1015+
"include": "source.ts#expression"
1016+
}
1017+
]
9781018
},
9791019
"8": {
980-
"name": "entity.other.attribute-name.html.vue"
1020+
"name": "punctuation.separator.key-value.html.vue"
9811021
},
9821022
"9": {
983-
"name": "punctuation.separator.key-value.html.vue"
1023+
"name": "entity.other.attribute-name.html.vue"
9841024
}
9851025
},
986-
"end": "(?=\\s*+[^=\\s])",
1026+
"end": "(?=\\s*[^=\\s])",
9871027
"endCaptures": {
9881028
"1": {
9891029
"name": "punctuation.definition.string.end.html.vue"
9901030
}
9911031
},
9921032
"name": "meta.attribute.directive.vue",
9931033
"patterns": [
1034+
{
1035+
"match": "(\\.)([\\w-]*)",
1036+
"1": {
1037+
"name": "punctuation.separator.key-value.html.vue"
1038+
},
1039+
"2": {
1040+
"name": "entity.other.attribute-name.html.vue"
1041+
}
1042+
},
9941043
{
9951044
"include": "#vue-directives-expression"
9961045
}
@@ -1039,7 +1088,7 @@
10391088
"name": "source.ts.embedded.html.vue",
10401089
"patterns": [
10411090
{
1042-
"include": "source.ts"
1091+
"include": "source.ts#expression"
10431092
}
10441093
]
10451094
}
@@ -1060,7 +1109,7 @@
10601109
"name": "source.ts.embedded.html.vue",
10611110
"patterns": [
10621111
{
1063-
"include": "source.ts"
1112+
"include": "source.ts#expression"
10641113
}
10651114
]
10661115
}
@@ -1225,13 +1274,46 @@
12251274
"name": "source.ts.embedded.html.vue",
12261275
"patterns": [
12271276
{
1228-
"include": "source.ts"
1277+
"include": "source.ts#expression"
12291278
}
12301279
]
12311280
}
12321281
]
12331282
}
12341283
]
1284+
},
1285+
"vue-comments": {
1286+
"patterns": [
1287+
{
1288+
"include": "#vue-comments-key-value"
1289+
}
1290+
]
1291+
},
1292+
"vue-comments-key-value": {
1293+
"begin": "(<!--)\\s*(@)([\\w$]+)(?=\\s)",
1294+
"beginCaptures": {
1295+
"1": {
1296+
"name": "punctuation.definition.comment.vue"
1297+
},
1298+
"2": {
1299+
"name": "punctuation.definition.block.tag.comment.vue"
1300+
},
1301+
"3": {
1302+
"name": "storage.type.class.comment.vue"
1303+
}
1304+
},
1305+
"end": "(-->)",
1306+
"endCaptures": {
1307+
"1": {
1308+
"name": "punctuation.definition.comment.vue"
1309+
}
1310+
},
1311+
"name": "comment.block.vue",
1312+
"patterns": [
1313+
{
1314+
"include": "source.json#value"
1315+
}
1316+
]
12351317
}
12361318
}
12371319
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021-present Johnson Chu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This is a copy from https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue/languages
1+
This is a copy from https://github.com/vuejs/language-tools/tree/v2.2.8/extensions/vscode/languages

org.eclipse.wildwebdeveloper/plugin.xml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -541,33 +541,30 @@
541541
label="VUE Language Server"/>
542542
<contentTypeMapping contentType="org.eclipse.wildwebdeveloper.vue" languageId="vue" id="org.eclipse.wildwebdeveloper.vue"/>
543543
</extension>
544-
<extension
545-
point="org.eclipse.tm4e.registry.grammars">
546-
<grammar
547-
path="grammars/vue/vue.tmLanguage.json"
548-
scopeName="source.vue">
549-
</grammar>
550-
<scopeNameContentTypeBinding
551-
contentTypeId="org.eclipse.wildwebdeveloper.vue"
552-
scopeName="source.vue">
553-
</scopeNameContentTypeBinding>
554-
<grammar
555-
556-
path="grammars/vue/markdown-vue.json"
557-
scopeName="markdown.vue.codeblock">
558-
</grammar>
559-
<grammar
560-
path="grammars/vue/vue-directives.json"
561-
scopeName="vue.directives">
562-
</grammar>
563-
<grammar
564-
path="grammars/vue/vue-interpolations.json"
565-
scopeName="vue.interpolations">
566-
</grammar>
567-
<grammar
568-
path="grammars/vue/vue-sfc-style-variable-injection.json"
569-
scopeName="vue.sfc.style.variable.injection">
570-
</grammar>
544+
<extension point="org.eclipse.tm4e.registry.grammars">
545+
<grammar path="grammars/vue/vue.tmLanguage.json" scopeName="source.vue" />
546+
<scopeNameContentTypeBinding contentTypeId="org.eclipse.wildwebdeveloper.vue" scopeName="source.vue" />
547+
548+
<grammar path="grammars/vue/markdown-vue.json" scopeName="markdown.vue.codeblock" />
549+
<injection scopeName="markdown.vue.codeblock" injectTo="text.html.markdown" />
550+
551+
<grammar path="grammars/vue/mdx-vue.json" scopeName="mdx.vue.codeblock" />
552+
<injection scopeName="mdx.vue.codeblock" injectTo="source.mdx" />
553+
554+
<grammar path="grammars/vue/vue-directives.json" scopeName="vue.directives" />
555+
<injection scopeName="vue.directives" injectTo="source.vue" />
556+
<injection scopeName="vue.directives" injectTo="text.html.markdown" />
557+
<injection scopeName="vue.directives" injectTo="text.html.derivative" />
558+
<injection scopeName="vue.directives" injectTo="text.pug" />
559+
560+
<grammar path="grammars/vue/vue-interpolations.json" scopeName="vue.interpolations" />
561+
<injection scopeName="vue.interpolations" injectTo="source.vue" />
562+
<injection scopeName="vue.interpolations" injectTo="text.html.markdown" />
563+
<injection scopeName="vue.interpolations" injectTo="text.html.derivative" />
564+
<injection scopeName="vue.interpolations" injectTo="text.pug" />
565+
566+
<grammar path="grammars/vue/vue-sfc-style-variable-injection.json" scopeName="vue.sfc.style.variable.injection"/>
567+
<injection scopeName="vue.sfc.style.variable.injection" injectTo="source.vue" />
571568
</extension>
572569

573570
<extension

0 commit comments

Comments
 (0)