Skip to content

Commit 0c4c83e

Browse files
ColengmsColen Garoutte-Carson
authored andcommitted
Improve scope names used by Enhanced Colorization (#3896)
1 parent a369ede commit 0c4c83e

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed

Documentation/LanguageServer/colorization.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ Colors are associated with [TextMate scopes](https://macromates.com/manual/en/la
1919

2020
| Token | Scope |
2121
| ------------- |:-------------:|
22-
| Class Template | entity.name.class.template |
22+
| Class Template | entity.name.type.class.templated |
2323
| Enumerator | variable.other.enummember |
2424
| Event (C++/CLI) | variable.other.event |
2525
| Function | entity.name.function |
26-
| Function Template | entity.name.function.template |
27-
| Generic Type (C++/CLI) | entity.name.class.generic |
26+
| Function Template | entity.name.function.templated |
27+
| Generic Type (C++/CLI) | entity.name.type.class.generic |
2828
| Global Variable | variable.other.global |
2929
| Label | entity.name.label |
3030
| Local Variable | variable.other.local |
3131
| Macro | entity.name.function.preprocessor |
32-
| Member Field | variable.other.member |
32+
| Member Field | variable.other.property |
3333
| Member Function | entity.name.function.member |
34-
| Member Operator | keyword.operator.member |
35-
| Namespace | entity.name.type.namespace |
34+
| Namespace | entity.name.namespace |
3635
| New / Delete | keyword.operator.new |
37-
| Operator Function | entity.name.function.operator |
36+
| Operator Overload Function | entity.name.function.operator |
37+
| Operator Overload Member | entity.name.function.operator.member |
3838
| Parameter | variable.parameter |
39-
| Property (C++/CLI) | variable.other.property |
40-
| Reference Type (C++/CLI) | entity.name.class.reference |
41-
| Static Member Field | variable.other.member.static |
39+
| Property (C++/CLI) | variable.other.property.cli |
40+
| Reference Type (C++/CLI) | entity.name.type.class.reference |
41+
| Static Member Field | variable.other.property.static |
4242
| Static Member Function | entity.name.function.member.static |
43-
| Type | entity.name.type |
44-
| User-Defined Literal - Number | entity.name.user-defined-literal.number |
45-
| User-Defined Literal - Raw | entity.name.user-defined-literal |
46-
| User-Defined Literal - String | entity.name.user-defined-literal.string |
47-
| Value Type (C++/CLI) | entity.name.class.value |
43+
| Type | entity.name.type.class |
44+
| User-Defined Literal - Number | entity.name.operator.custom-literal.number |
45+
| User-Defined Literal - Raw | entity.name.operator.custom-literal |
46+
| User-Defined Literal - String | entity.name.operator.custom-literal.string |
47+
| Value Type (C++/CLI) | entity.name.type.class.value |
4848

4949
Many of the tokens recognized by IntelliSense do not directly map to existing scopes in the VS Code's default C/C++ TextMate grammar, so are likely not colored by existing VS Code themes.
5050

@@ -55,7 +55,7 @@ Colors can also be overridden globally, in settings:
5555
"editor.tokenColorCustomizations": {
5656
"textMateRules": [
5757
{
58-
"scope": "entity.name.type",
58+
"scope": "entity.name.type.class",
5959
"settings": {
6060
"foreground": "#FF0000",
6161
"fontStyle": "italic bold underline"
@@ -70,7 +70,7 @@ Or, overridden on a per-theme basis:
7070
"[Visual Studio Dark]": {
7171
"textMateRules": [
7272
{
73-
"scope": "entity.name.type",
73+
"scope": "entity.name.type.class",
7474
"settings": {
7575
"foreground": "#FF0000",
7676
"fontStyle": "italic bold underline"
@@ -171,19 +171,19 @@ Use the following to augment the Visual Studio Dark theme to match what Visual S
171171
}
172172
},
173173
{
174-
"scope": "entity.name.type",
174+
"scope": "entity.name.type.class",
175175
"settings": {
176176
"foreground": "#4EC9B0"
177177
}
178178
},
179179
{
180-
"scope": "entity.name.class.reference",
180+
"scope": "entity.name.type.class.reference",
181181
"settings": {
182182
"foreground": "#4EC9B0"
183183
}
184184
},
185185
{
186-
"scope": "entity.name.class.value",
186+
"scope": "entity.name.type.class.value",
187187
"settings": {
188188
"foreground": "#4EC9B0"
189189
}
@@ -201,7 +201,7 @@ Use the following to augment the Visual Studio Dark theme to match what Visual S
201201
}
202202
},
203203
{
204-
"scope": "variable.other.member",
204+
"scope": "variable.other.property",
205205
"settings": {
206206
"foreground": "#DADADA"
207207
}
@@ -213,7 +213,7 @@ Use the following to augment the Visual Studio Dark theme to match what Visual S
213213
}
214214
},
215215
{
216-
"scope": "variable.other.member.static",
216+
"scope": "variable.other.property.static",
217217
"settings": {
218218
"foreground": "#C8C8C8"
219219
}
@@ -225,19 +225,19 @@ Use the following to augment the Visual Studio Dark theme to match what Visual S
225225
}
226226
},
227227
{
228-
"scope": "entity.name.class.template",
228+
"scope": "entity.name.type.class.templated",
229229
"settings": {
230230
"foreground": "#4EC9B0"
231231
}
232232
},
233233
{
234-
"scope": "entity.name.class.generic",
234+
"scope": "entity.name.type.class.generic",
235235
"settings": {
236236
"foreground": "#4EC9B0"
237237
}
238238
},
239239
{
240-
"scope": "entity.name.function.template",
240+
"scope": "entity.name.function.templated",
241241
"settings": {
242242
"foreground": "#C8C8C8"
243243
}
@@ -255,19 +255,19 @@ Use the following to augment the Visual Studio Dark theme to match what Visual S
255255
}
256256
},
257257
{
258-
"scope": "entity.name.user-defined-literal",
258+
"scope": "entity.name.operator.custom-literal",
259259
"settings": {
260260
"foreground": "#DADADA"
261261
}
262262
},
263263
{
264-
"scope": "entity.name.user-defined-literal.string",
264+
"scope": "entity.name.operator.custom-literal.string",
265265
"settings": {
266266
"foreground": "#D69D85"
267267
}
268268
},
269269
{
270-
"scope": "entity.name.user-defined-literal.number",
270+
"scope": "entity.name.operator.custom-literal.number",
271271
"settings": {
272272
"foreground": "#B5CEA8"
273273
}
@@ -386,19 +386,19 @@ Use the following to augment the Visual Studio Light theme to match what Visual
386386
}
387387
},
388388
{
389-
"scope": "entity.name.type",
389+
"scope": "entity.name.type.class",
390390
"settings": {
391391
"foreground": "#2B91AF"
392392
}
393393
},
394394
{
395-
"scope": "entity.name.class.reference",
395+
"scope": "entity.name.type.class.reference",
396396
"settings": {
397397
"foreground": "#2B91AF"
398398
}
399399
},
400400
{
401-
"scope": "entity.name.class.value",
401+
"scope": "entity.name.type.class.value",
402402
"settings": {
403403
"foreground": "#2B91AF"
404404
}
@@ -416,7 +416,7 @@ Use the following to augment the Visual Studio Light theme to match what Visual
416416
}
417417
},
418418
{
419-
"scope": "variable.other.member",
419+
"scope": "variable.other.property",
420420
"settings": {
421421
"foreground": "#000000"
422422
}
@@ -428,7 +428,7 @@ Use the following to augment the Visual Studio Light theme to match what Visual
428428
}
429429
},
430430
{
431-
"scope": "variable.other.member.static",
431+
"scope": "variable.other.property.static",
432432
"settings": {
433433
"foreground": "#000000"
434434
}
@@ -440,19 +440,19 @@ Use the following to augment the Visual Studio Light theme to match what Visual
440440
}
441441
},
442442
{
443-
"scope": "entity.name.class.template",
443+
"scope": "entity.name.type.class.templated",
444444
"settings": {
445445
"foreground": "#2B91AF"
446446
}
447447
},
448448
{
449-
"scope": "entity.name.class.generic",
449+
"scope": "entity.name.type.class.generic",
450450
"settings": {
451451
"foreground": "#2B91AF"
452452
}
453453
},
454454
{
455-
"scope": "entity.name.function.template",
455+
"scope": "entity.name.function.templated",
456456
"settings": {
457457
"foreground": "#000000"
458458
}
@@ -470,19 +470,19 @@ Use the following to augment the Visual Studio Light theme to match what Visual
470470
}
471471
},
472472
{
473-
"scope": "entity.name.user-defined-literal",
473+
"scope": "entity.name.operator.custom-literal",
474474
"settings": {
475475
"foreground": "#000000"
476476
}
477477
},
478478
{
479-
"scope": "entity.name.user-defined-literal.string",
479+
"scope": "entity.name.operator.custom-literal.string",
480480
"settings": {
481481
"foreground": "#A31515"
482482
}
483483
},
484484
{
485-
"scope": "entity.name.user-defined-literal.number",
485+
"scope": "entity.name.operator.custom-literal.number",
486486
"settings": {
487487
"foreground": "#000000"
488488
}

Extension/src/LanguageServer/colorization.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -213,26 +213,26 @@ export class ColorizationSettings {
213213
this.calculateStyleForToken(TokenKind.GlobalVariable, "variable.other.global", themeName, textMateRules);
214214
this.calculateStyleForToken(TokenKind.LocalVariable, "variable.other.local", themeName, textMateRules);
215215
this.calculateStyleForToken(TokenKind.Parameter, "variable.parameter", themeName, textMateRules);
216-
this.calculateStyleForToken(TokenKind.Type, "entity.name.type", themeName, textMateRules);
217-
this.calculateStyleForToken(TokenKind.RefType, "entity.name.class.reference", themeName, textMateRules);
218-
this.calculateStyleForToken(TokenKind.ValueType, "entity.name.class.value", themeName, textMateRules);
216+
this.calculateStyleForToken(TokenKind.Type, "entity.name.type.class", themeName, textMateRules);
217+
this.calculateStyleForToken(TokenKind.RefType, "entity.name.type.class.reference", themeName, textMateRules);
218+
this.calculateStyleForToken(TokenKind.ValueType, "entity.name.type.class.value", themeName, textMateRules);
219219
this.calculateStyleForToken(TokenKind.Function, "entity.name.function", themeName, textMateRules);
220220
this.calculateStyleForToken(TokenKind.MemberFunction, "entity.name.function.member", themeName, textMateRules);
221-
this.calculateStyleForToken(TokenKind.MemberField, "variable.other.member", themeName, textMateRules);
221+
this.calculateStyleForToken(TokenKind.MemberField, "variable.other.property", themeName, textMateRules);
222222
this.calculateStyleForToken(TokenKind.StaticMemberFunction, "entity.name.function.member.static", themeName, textMateRules);
223-
this.calculateStyleForToken(TokenKind.StaticMemberField, "variable.other.member.static", themeName, textMateRules);
224-
this.calculateStyleForToken(TokenKind.Property, "variable.other.property", themeName, textMateRules);
223+
this.calculateStyleForToken(TokenKind.StaticMemberField, "variable.other.property.static", themeName, textMateRules);
224+
this.calculateStyleForToken(TokenKind.Property, "variable.other.property.cli", themeName, textMateRules);
225225
this.calculateStyleForToken(TokenKind.Event, "variable.other.event", themeName, textMateRules);
226-
this.calculateStyleForToken(TokenKind.ClassTemplate, "entity.name.class.template", themeName, textMateRules);
227-
this.calculateStyleForToken(TokenKind.GenericType, "entity.name.class.generic", themeName, textMateRules);
228-
this.calculateStyleForToken(TokenKind.FunctionTemplate, "entity.name.function.template", themeName, textMateRules);
229-
this.calculateStyleForToken(TokenKind.Namespace, "entity.name.type.namespace", themeName, textMateRules);
226+
this.calculateStyleForToken(TokenKind.ClassTemplate, "entity.name.type.class.templated", themeName, textMateRules);
227+
this.calculateStyleForToken(TokenKind.GenericType, "entity.name.type.class.generic", themeName, textMateRules);
228+
this.calculateStyleForToken(TokenKind.FunctionTemplate, "entity.name.function.templated", themeName, textMateRules);
229+
this.calculateStyleForToken(TokenKind.Namespace, "entity.name.namespace", themeName, textMateRules);
230230
this.calculateStyleForToken(TokenKind.Label, "entity.name.label", themeName, textMateRules);
231-
this.calculateStyleForToken(TokenKind.UdlRaw, "entity.name.user-defined-literal", themeName, textMateRules);
232-
this.calculateStyleForToken(TokenKind.UdlNumber, "entity.name.user-defined-literal.number", themeName, textMateRules);
233-
this.calculateStyleForToken(TokenKind.UdlString, "entity.name.user-defined-literal.string", themeName, textMateRules);
231+
this.calculateStyleForToken(TokenKind.UdlRaw, "entity.name.operator.custom-literal", themeName, textMateRules);
232+
this.calculateStyleForToken(TokenKind.UdlNumber, "entity.name.operator.custom-literal.number", themeName, textMateRules);
233+
this.calculateStyleForToken(TokenKind.UdlString, "entity.name.operator.custom-literal.string", themeName, textMateRules);
234234
this.calculateStyleForToken(TokenKind.OperatorFunction, "entity.name.function.operator", themeName, textMateRules);
235-
this.calculateStyleForToken(TokenKind.MemberOperator, "keyword.operator.member", themeName, textMateRules);
235+
this.calculateStyleForToken(TokenKind.MemberOperator, "entity.name.function.operator.member", themeName, textMateRules);
236236
this.calculateStyleForToken(TokenKind.NewDelete, "keyword.operator.new", themeName, textMateRules);
237237
}
238238

0 commit comments

Comments
 (0)