Skip to content

Commit 0e87ea1

Browse files
committed
jsonc strings are wrong color. Fixes microsoft#53010
1 parent 7d8a845 commit 0e87ea1

5 files changed

Lines changed: 64 additions & 65 deletions

File tree

extensions/json/build/update-grammars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function adaptJSON(grammar, replacementScope) {
3333

3434
var tsGrammarRepo = 'Microsoft/vscode-JSON.tmLanguage';
3535
updateGrammar.update(tsGrammarRepo, 'JSON.tmLanguage', './syntaxes/JSON.tmLanguage.json');
36-
updateGrammar.update(tsGrammarRepo, 'JSON.tmLanguage', './syntaxes/JSONC.tmLanguage.json', grammar => adaptJSON(grammar, '.jsonc'));
36+
updateGrammar.update(tsGrammarRepo, 'JSON.tmLanguage', './syntaxes/JSONC.tmLanguage.json', grammar => adaptJSON(grammar, '.json.comments'));
3737

3838

3939

extensions/json/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
{
6060
"language": "jsonc",
61-
"scopeName": "source.jsonc",
61+
"scopeName": "source.json.comments",
6262
"path": "./syntaxes/JSONC.tmLanguage.json"
6363
}
6464
],

extensions/json/syntaxes/JSONC.tmLanguage.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"version": "https://github.com/Microsoft/vscode-JSON.tmLanguage/commit/9bd83f1c252b375e957203f21793316203f61f70",
88
"name": "JSON with comments",
9-
"scopeName": "source.jsonc",
9+
"scopeName": "source.json.comments",
1010
"patterns": [
1111
{
1212
"include": "#value"
@@ -17,27 +17,27 @@
1717
"begin": "\\[",
1818
"beginCaptures": {
1919
"0": {
20-
"name": "punctuation.definition.array.begin.jsonc"
20+
"name": "punctuation.definition.array.begin.json.comments"
2121
}
2222
},
2323
"end": "\\]",
2424
"endCaptures": {
2525
"0": {
26-
"name": "punctuation.definition.array.end.jsonc"
26+
"name": "punctuation.definition.array.end.json.comments"
2727
}
2828
},
29-
"name": "meta.structure.array.jsonc",
29+
"name": "meta.structure.array.json.comments",
3030
"patterns": [
3131
{
3232
"include": "#value"
3333
},
3434
{
3535
"match": ",",
36-
"name": "punctuation.separator.array.jsonc"
36+
"name": "punctuation.separator.array.json.comments"
3737
},
3838
{
3939
"match": "[^\\s\\]]",
40-
"name": "invalid.illegal.expected-array-separator.jsonc"
40+
"name": "invalid.illegal.expected-array-separator.json.comments"
4141
}
4242
]
4343
},
@@ -47,26 +47,26 @@
4747
"begin": "/\\*\\*(?!/)",
4848
"captures": {
4949
"0": {
50-
"name": "punctuation.definition.comment.jsonc"
50+
"name": "punctuation.definition.comment.json.comments"
5151
}
5252
},
5353
"end": "\\*/",
54-
"name": "comment.block.documentation.jsonc"
54+
"name": "comment.block.documentation.json.comments"
5555
},
5656
{
5757
"begin": "/\\*",
5858
"captures": {
5959
"0": {
60-
"name": "punctuation.definition.comment.jsonc"
60+
"name": "punctuation.definition.comment.json.comments"
6161
}
6262
},
6363
"end": "\\*/",
64-
"name": "comment.block.jsonc"
64+
"name": "comment.block.json.comments"
6565
},
6666
{
6767
"captures": {
6868
"1": {
69-
"name": "punctuation.definition.comment.jsonc"
69+
"name": "punctuation.definition.comment.json.comments"
7070
}
7171
},
7272
"match": "(//).*$\\n?",
@@ -76,26 +76,26 @@
7676
},
7777
"constant": {
7878
"match": "\\b(?:true|false|null)\\b",
79-
"name": "constant.language.jsonc"
79+
"name": "constant.language.json.comments"
8080
},
8181
"number": {
8282
"match": "(?x) # turn on extended mode\n -? # an optional minus\n (?:\n 0 # a zero\n | # ...or...\n [1-9] # a 1-9 character\n \\d* # followed by zero or more digits\n )\n (?:\n (?:\n \\. # a period\n \\d+ # followed by one or more digits\n )?\n (?:\n [eE] # an e character\n [+-]? # followed by an option +/-\n \\d+ # followed by one or more digits\n )? # make exponent optional\n )? # make decimal portion optional",
83-
"name": "constant.numeric.jsonc"
83+
"name": "constant.numeric.json.comments"
8484
},
8585
"object": {
8686
"begin": "\\{",
8787
"beginCaptures": {
8888
"0": {
89-
"name": "punctuation.definition.dictionary.begin.jsonc"
89+
"name": "punctuation.definition.dictionary.begin.json.comments"
9090
}
9191
},
9292
"end": "\\}",
9393
"endCaptures": {
9494
"0": {
95-
"name": "punctuation.definition.dictionary.end.jsonc"
95+
"name": "punctuation.definition.dictionary.end.json.comments"
9696
}
9797
},
98-
"name": "meta.structure.dictionary.jsonc",
98+
"name": "meta.structure.dictionary.json.comments",
9999
"patterns": [
100100
{
101101
"comment": "the JSON object key",
@@ -108,47 +108,47 @@
108108
"begin": ":",
109109
"beginCaptures": {
110110
"0": {
111-
"name": "punctuation.separator.dictionary.key-value.jsonc"
111+
"name": "punctuation.separator.dictionary.key-value.json.comments"
112112
}
113113
},
114114
"end": "(,)|(?=\\})",
115115
"endCaptures": {
116116
"1": {
117-
"name": "punctuation.separator.dictionary.pair.jsonc"
117+
"name": "punctuation.separator.dictionary.pair.json.comments"
118118
}
119119
},
120-
"name": "meta.structure.dictionary.value.jsonc",
120+
"name": "meta.structure.dictionary.value.json.comments",
121121
"patterns": [
122122
{
123123
"comment": "the JSON object value",
124124
"include": "#value"
125125
},
126126
{
127127
"match": "[^\\s,]",
128-
"name": "invalid.illegal.expected-dictionary-separator.jsonc"
128+
"name": "invalid.illegal.expected-dictionary-separator.json.comments"
129129
}
130130
]
131131
},
132132
{
133133
"match": "[^\\s\\}]",
134-
"name": "invalid.illegal.expected-dictionary-separator.jsonc"
134+
"name": "invalid.illegal.expected-dictionary-separator.json.comments"
135135
}
136136
]
137137
},
138138
"string": {
139139
"begin": "\"",
140140
"beginCaptures": {
141141
"0": {
142-
"name": "punctuation.definition.string.begin.jsonc"
142+
"name": "punctuation.definition.string.begin.json.comments"
143143
}
144144
},
145145
"end": "\"",
146146
"endCaptures": {
147147
"0": {
148-
"name": "punctuation.definition.string.end.jsonc"
148+
"name": "punctuation.definition.string.end.json.comments"
149149
}
150150
},
151-
"name": "string.quoted.double.jsonc",
151+
"name": "string.quoted.double.json.comments",
152152
"patterns": [
153153
{
154154
"include": "#stringcontent"
@@ -159,16 +159,16 @@
159159
"begin": "\"",
160160
"beginCaptures": {
161161
"0": {
162-
"name": "punctuation.support.type.property-name.begin.jsonc"
162+
"name": "punctuation.support.type.property-name.begin.json.comments"
163163
}
164164
},
165165
"end": "\"",
166166
"endCaptures": {
167167
"0": {
168-
"name": "punctuation.support.type.property-name.end.jsonc"
168+
"name": "punctuation.support.type.property-name.end.json.comments"
169169
}
170170
},
171-
"name": "string.jsonc support.type.property-name.jsonc",
171+
"name": "string.json.comments support.type.property-name.json.comments",
172172
"patterns": [
173173
{
174174
"include": "#stringcontent"
@@ -179,11 +179,11 @@
179179
"patterns": [
180180
{
181181
"match": "(?x) # turn on extended mode\n \\\\ # a literal backslash\n (?: # ...followed by...\n [\"\\\\/bfnrt] # one of these characters\n | # ...or...\n u # a u\n [0-9a-fA-F]{4}) # and four hex digits",
182-
"name": "constant.character.escape.jsonc"
182+
"name": "constant.character.escape.json.comments"
183183
},
184184
{
185185
"match": "\\\\.",
186-
"name": "invalid.illegal.unrecognized-string-escape.jsonc"
186+
"name": "invalid.illegal.unrecognized-string-escape.json.comments"
187187
}
188188
]
189189
},

extensions/theme-defaults/themes/light_vs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@
291291
},
292292
{
293293
"scope": [
294-
"support.type.property-name.json",
295-
"support.type.property-name.jsonc"
294+
"support.type.property-name.json"
296295
],
297296
"settings": {
298297
"foreground": "#0451a5"

0 commit comments

Comments
 (0)