Skip to content

Commit 6132cb3

Browse files
committed
fixes microsoft#5579: [java] Colorization could be improved for import text
1 parent de4c7a2 commit 6132cb3

5 files changed

Lines changed: 203 additions & 25 deletions

File tree

extensions/java/test/colorize-fixtures/basic.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
package foo;
2+
13
import org.junit.Test;
4+
import org.junit.runners.*;
25

36
/*
47
* Multi line comment

extensions/java/test/colorize-results/basic_java.json

Lines changed: 179 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,48 @@
11
[
2+
{
3+
"c": "package",
4+
"t": "java.keyword.meta.other.package",
5+
"r": {
6+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)",
7+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)",
8+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)",
9+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)",
10+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)"
11+
}
12+
},
13+
{
14+
"c": " ",
15+
"t": "java.meta.package",
16+
"r": {
17+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
18+
"light_plus": ".vs .token rgb(0, 0, 0)",
19+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
20+
"light_vs": ".vs .token rgb(0, 0, 0)",
21+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
22+
}
23+
},
24+
{
25+
"c": "foo",
26+
"t": "java.meta.modifier.package.storage",
27+
"r": {
28+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.package.java rgb(212, 212, 212)",
29+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.package.java rgb(0, 0, 0)",
30+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.package.java rgb(212, 212, 212)",
31+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.package.java rgb(0, 0, 0)",
32+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.package.java rgb(212, 212, 212)"
33+
}
34+
},
35+
{
36+
"c": ";",
37+
"t": "java.meta.package.punctuation.terminator",
38+
"r": {
39+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
40+
"light_plus": ".vs .token rgb(0, 0, 0)",
41+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
42+
"light_vs": ".vs .token rgb(0, 0, 0)",
43+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
44+
}
45+
},
246
{
347
"c": "import",
448
"t": "import.java.keyword.meta.other",
@@ -25,55 +69,165 @@
2569
"c": "org",
2670
"t": "import.java.meta.modifier.storage",
2771
"r": {
28-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)",
29-
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)",
30-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)",
31-
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)",
32-
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)"
72+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
73+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
74+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
75+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
76+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
3377
}
3478
},
3579
{
3680
"c": ".",
3781
"t": "import.java.meta.modifier.punctuation.separator.storage",
3882
"r": {
39-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)",
40-
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)",
41-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)",
42-
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)",
43-
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)"
83+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
84+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
85+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
86+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
87+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
4488
}
4589
},
4690
{
4791
"c": "junit",
4892
"t": "import.java.meta.modifier.storage",
4993
"r": {
50-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)",
51-
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)",
52-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)",
53-
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)",
54-
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)"
94+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
95+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
96+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
97+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
98+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
5599
}
56100
},
57101
{
58102
"c": ".",
59103
"t": "import.java.meta.modifier.punctuation.separator.storage",
60104
"r": {
61-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)",
62-
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)",
63-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)",
64-
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)",
65-
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)"
105+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
106+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
107+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
108+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
109+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
66110
}
67111
},
68112
{
69113
"c": "Test",
70114
"t": "import.java.meta.modifier.storage",
71115
"r": {
72-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)",
73-
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)",
74-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)",
75-
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)",
76-
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)"
116+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
117+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
118+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
119+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
120+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
121+
}
122+
},
123+
{
124+
"c": ";",
125+
"t": "import.java.meta.punctuation.terminator",
126+
"r": {
127+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
128+
"light_plus": ".vs .token rgb(0, 0, 0)",
129+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
130+
"light_vs": ".vs .token rgb(0, 0, 0)",
131+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
132+
}
133+
},
134+
{
135+
"c": "import",
136+
"t": "import.java.keyword.meta.other",
137+
"r": {
138+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)",
139+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)",
140+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)",
141+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)",
142+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)"
143+
}
144+
},
145+
{
146+
"c": " ",
147+
"t": "import.java.meta",
148+
"r": {
149+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
150+
"light_plus": ".vs .token rgb(0, 0, 0)",
151+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
152+
"light_vs": ".vs .token rgb(0, 0, 0)",
153+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
154+
}
155+
},
156+
{
157+
"c": "org",
158+
"t": "import.java.meta.modifier.storage",
159+
"r": {
160+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
161+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
162+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
163+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
164+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
165+
}
166+
},
167+
{
168+
"c": ".",
169+
"t": "import.java.meta.modifier.punctuation.separator.storage",
170+
"r": {
171+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
172+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
173+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
174+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
175+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
176+
}
177+
},
178+
{
179+
"c": "junit",
180+
"t": "import.java.meta.modifier.storage",
181+
"r": {
182+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
183+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
184+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
185+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
186+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
187+
}
188+
},
189+
{
190+
"c": ".",
191+
"t": "import.java.meta.modifier.punctuation.separator.storage",
192+
"r": {
193+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
194+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
195+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
196+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
197+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
198+
}
199+
},
200+
{
201+
"c": "runners",
202+
"t": "import.java.meta.modifier.storage",
203+
"r": {
204+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
205+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
206+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
207+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
208+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
209+
}
210+
},
211+
{
212+
"c": ".",
213+
"t": "import.java.meta.modifier.punctuation.separator.storage",
214+
"r": {
215+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
216+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
217+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
218+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
219+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
220+
}
221+
},
222+
{
223+
"c": "*",
224+
"t": "import.java.meta.modifier.storage",
225+
"r": {
226+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)",
227+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)",
228+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)",
229+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)",
230+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)"
77231
}
78232
},
79233
{

extensions/theme-defaults/themes/dark_vs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@
278278
"settings": {
279279
"foreground": "#b5cea8"
280280
}
281+
},
282+
{
283+
"name": "coloring of the Java import and package identifiers",
284+
"scope": ["storage.modifier.import.java", "storage.modifier.package.java"],
285+
"settings": {
286+
"foreground": "#d4d4d4"
287+
}
281288
}
282289
]
283290
}

extensions/theme-defaults/themes/hc_black.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@
253253
"settings": {
254254
"foreground": "#b5cea8"
255255
}
256+
},
257+
{
258+
"name": "coloring of the Java import and package identifiers",
259+
"scope": ["storage.modifier.import.java", "storage.modifier.package.java"],
260+
"settings": {
261+
"foreground": "#d4d4d4"
262+
}
256263
}
257264
]
258265
}

extensions/theme-defaults/themes/light_vs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@
267267
"settings": {
268268
"foreground": "#09885a"
269269
}
270+
},
271+
{
272+
"name": "coloring of the Java import and package identifiers",
273+
"scope": ["storage.modifier.import.java", "storage.modifier.package.java"],
274+
"settings": {
275+
"foreground": "#000000"
276+
}
270277
}
271278
]
272279
}

0 commit comments

Comments
 (0)