Skip to content

Commit 0d6ca70

Browse files
committed
feat: support syntax highlighting for lang="json", lang="jsonc"
#127
1 parent ca11f53 commit 0d6ca70

File tree

2 files changed

+95
-2
lines changed

2 files changed

+95
-2
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@
173173
"source.ts": "typescript",
174174
"source.jsx": "javascriptreact",
175175
"source.tsx": "typescriptreact",
176-
"css.embbeded.vue": "css"
176+
"source.json.comments": "jsonc",
177+
"source.json": "json"
177178
}
178179
},
179180
{

syntaxes/vue.tmLanguage.json

+93-1
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,98 @@
546546
}
547547
]
548548
},
549+
{
550+
"begin": "(<)(?:([a-zA-Z0-9:-]+))\\b(?=[^>]*\\blang\\s*=\\s*('json'|\"json\"))",
551+
"beginCaptures": {
552+
"1": {
553+
"name": "punctuation.definition.tag.begin.html"
554+
},
555+
"2": {
556+
"name": "entity.name.tag.custom.html"
557+
}
558+
},
559+
"end": "(?<=^<\/)([a-zA-Z0-9:-]+)(>)",
560+
"endCaptures": {
561+
"1": {
562+
"name": "entity.name.tag.custom.html"
563+
},
564+
"2": {
565+
"name": "punctuation.definition.tag.html"
566+
}
567+
},
568+
"patterns": [
569+
{
570+
"include": "#tag-stuff"
571+
},
572+
{
573+
"begin": "(>)",
574+
"captures": {
575+
"1": {
576+
"name": "punctuation.definition.tag.begin.html"
577+
}
578+
},
579+
"end": "(^<\/)",
580+
"patterns": [
581+
{
582+
"begin": "\\G",
583+
"end": "(?=^<\/)",
584+
"name": "source.json.embedded.html",
585+
"patterns": [
586+
{
587+
"include": "source.json"
588+
}
589+
]
590+
}
591+
]
592+
}
593+
]
594+
},
595+
{
596+
"begin": "(<)(?:([a-zA-Z0-9:-]+))\\b(?=[^>]*\\blang\\s*=\\s*('jsonc'|\"jsonc\"))",
597+
"beginCaptures": {
598+
"1": {
599+
"name": "punctuation.definition.tag.begin.html"
600+
},
601+
"2": {
602+
"name": "entity.name.tag.custom.html"
603+
}
604+
},
605+
"end": "(?<=^<\/)([a-zA-Z0-9:-]+)(>)",
606+
"endCaptures": {
607+
"1": {
608+
"name": "entity.name.tag.custom.html"
609+
},
610+
"2": {
611+
"name": "punctuation.definition.tag.html"
612+
}
613+
},
614+
"patterns": [
615+
{
616+
"include": "#tag-stuff"
617+
},
618+
{
619+
"begin": "(>)",
620+
"captures": {
621+
"1": {
622+
"name": "punctuation.definition.tag.begin.html"
623+
}
624+
},
625+
"end": "(^<\/)",
626+
"patterns": [
627+
{
628+
"begin": "\\G",
629+
"end": "(?=^<\/)",
630+
"name": "source.json.comments.embedded.html",
631+
"patterns": [
632+
{
633+
"include": "source.json.comments"
634+
}
635+
]
636+
}
637+
]
638+
}
639+
]
640+
},
549641
{
550642
"begin": "(<\/?)([a-zA-Z0-9:-]+)",
551643
"beginCaptures": {
@@ -865,7 +957,7 @@
865957
"name": "punctuation.definition.string.end.html"
866958
}
867959
],
868-
"name": "css.embbeded.vue",
960+
"name": "source.css.embedded.html",
869961
"patterns": [
870962
{
871963
"include": "source.css#comment-block"

0 commit comments

Comments
 (0)