Skip to content

Commit 568d91b

Browse files
authored
code highlight themes and file preview tweaks (#2384)
1 parent acd8667 commit 568d91b

File tree

4 files changed

+70
-52
lines changed

4 files changed

+70
-52
lines changed

styles/shiki/rnd-dark.json

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -296,19 +296,23 @@
296296
{
297297
"scope": [
298298
"punctuation.terminator.statement",
299+
"punctuation.accessor",
299300
"punctuation.bracket",
300301
"punctuation.definition",
301302
"punctuation.section.arguments",
302303
"punctuation.section.angle-brackets",
303304
"punctuation.section.block",
305+
"punctuation.section.class",
306+
"punctuation.section.collection-type",
304307
"punctuation.section.embedded.begin",
305308
"punctuation.section.embedded.end",
309+
"punctuation.section.function",
306310
"punctuation.section.group.begin",
307311
"punctuation.section.group.end",
312+
"punctuation.section.method",
308313
"punctuation.section.parameters.begin",
309314
"punctuation.section.parameters.end",
310315
"punctuation.section.parens",
311-
"punctuation.section.function",
312316
"punctuation.section.scope",
313317
"punctuation.separator",
314318
"meta.brace.round",
@@ -340,7 +344,15 @@
340344
}
341345
},
342346
{
343-
"scope": ["entity.name.tag", "support.class.component"],
347+
"scope": [
348+
"entity.name.tag",
349+
"entity.name.type",
350+
"support.class",
351+
"support.type",
352+
"keyword.type",
353+
"storage.type.primitive",
354+
"storage.type.java"
355+
],
344356
"settings": {
345357
"foreground": "#7ee787"
346358
}
@@ -349,22 +361,23 @@
349361
"scope": [
350362
"keyword.soft",
351363
"keyword.hard",
352-
"keyword.operator",
353364
"keyword.control",
354-
"keyword.other"
365+
"keyword.operator.new",
366+
"keyword.operator.expression",
367+
"keyword.operator.cast",
368+
"keyword.operator.sizeof",
369+
"keyword.other",
370+
"support.type.object",
371+
"storage",
372+
"storage.modifier.attribute",
373+
"storage.modifier"
355374
],
356375
"settings": {
357376
"foreground": "#ff7b72"
358377
}
359378
},
360379
{
361-
"scope": ["storage", "storage.type", "storage.modifier.attribute"],
362-
"settings": {
363-
"foreground": "#ff7b72"
364-
}
365-
},
366-
{
367-
"scope": ["storage.modifier.package", "storage.modifier.import", "storage.type.java"],
380+
"scope": ["storage.modifier.package", "storage.modifier.import"],
368381
"settings": {
369382
"foreground": "#e6edf3"
370383
}
@@ -376,13 +389,12 @@
376389
}
377390
},
378391
{
379-
"scope": "support",
380-
"settings": {
381-
"foreground": "#79c0ff"
382-
}
383-
},
384-
{
385-
"scope": "meta.property-name",
392+
"scope": [
393+
"support",
394+
"entity.name.type.class",
395+
"meta.property-name",
396+
"entity.name.type.namespace"
397+
],
386398
"settings": {
387399
"foreground": "#79c0ff"
388400
}
@@ -473,13 +485,7 @@
473485
}
474486
},
475487
{
476-
"scope": "support.constant",
477-
"settings": {
478-
"foreground": "#79c0ff"
479-
}
480-
},
481-
{
482-
"scope": "support.variable",
488+
"scope": ["support.constant", "support.variable", "support.class"],
483489
"settings": {
484490
"foreground": "#79c0ff"
485491
}

styles/shiki/rnd-light.json

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -281,19 +281,23 @@
281281
{
282282
"scope": [
283283
"punctuation.terminator.statement",
284+
"punctuation.accessor",
284285
"punctuation.bracket",
285286
"punctuation.definition",
286287
"punctuation.section.arguments",
287288
"punctuation.section.angle-brackets",
288289
"punctuation.section.block",
290+
"punctuation.section.class",
291+
"punctuation.section.collection-type",
289292
"punctuation.section.embedded.begin",
290293
"punctuation.section.embedded.end",
294+
"punctuation.section.function",
291295
"punctuation.section.group.begin",
292296
"punctuation.section.group.end",
297+
"punctuation.section.method",
293298
"punctuation.section.parameters.begin",
294299
"punctuation.section.parameters.end",
295300
"punctuation.section.parens",
296-
"punctuation.section.function",
297301
"punctuation.section.scope",
298302
"punctuation.separator",
299303
"meta.brace.round",
@@ -325,7 +329,15 @@
325329
}
326330
},
327331
{
328-
"scope": ["entity.name.tag", "support.class.component"],
332+
"scope": [
333+
"entity.name.tag",
334+
"entity.name.type",
335+
"support.class",
336+
"support.type",
337+
"keyword.type",
338+
"storage.type.primitive",
339+
"storage.type.java"
340+
],
329341
"settings": {
330342
"foreground": "#116329"
331343
}
@@ -334,22 +346,23 @@
334346
"scope": [
335347
"keyword.soft",
336348
"keyword.hard",
337-
"keyword.operator",
338349
"keyword.control",
339-
"keyword.other"
350+
"keyword.operator.new",
351+
"keyword.operator.expression",
352+
"keyword.operator.cast",
353+
"keyword.operator.sizeof",
354+
"keyword.other",
355+
"support.type.object",
356+
"storage",
357+
"storage.modifier.attribute",
358+
"storage.modifier"
340359
],
341360
"settings": {
342-
"foreground": "#cf222e"
361+
"foreground": "#d4635b"
343362
}
344363
},
345364
{
346-
"scope": ["storage", "storage.type", "storage.modifier.attribute"],
347-
"settings": {
348-
"foreground": "#cf222e"
349-
}
350-
},
351-
{
352-
"scope": ["storage.modifier.package", "storage.modifier.import", "storage.type.java"],
365+
"scope": ["storage.modifier.package", "storage.modifier.import"],
353366
"settings": {
354367
"foreground": "#1f2328"
355368
}
@@ -361,13 +374,12 @@
361374
}
362375
},
363376
{
364-
"scope": "support",
365-
"settings": {
366-
"foreground": "#0550ae"
367-
}
368-
},
369-
{
370-
"scope": "meta.property-name",
377+
"scope": [
378+
"support",
379+
"entity.name.type.class",
380+
"meta.property-name",
381+
"entity.name.type.namespace"
382+
],
371383
"settings": {
372384
"foreground": "#0550ae"
373385
}
@@ -458,13 +470,7 @@
458470
}
459471
},
460472
{
461-
"scope": "support.constant",
462-
"settings": {
463-
"foreground": "#0550ae"
464-
}
465-
},
466-
{
467-
"scope": "support.variable",
473+
"scope": ["support.constant", "support.variable", "support.class"],
468474
"settings": {
469475
"foreground": "#0550ae"
470476
}

util/codeBrowser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const PREVIEW_DISABLED_FILES = [
3232
'xcuserstate',
3333
];
3434

35-
export const IMAGE_FILES = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'];
35+
export const IMAGE_FILES = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'ico'];
3636

3737
export const FILE_WARNINGS = [
3838
{

util/shiki.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
export const SHIKI_OPTS = {
22
langAlias: {
33
appxmanifest: 'xml',
4+
bat: 'sh',
5+
cbp: 'xml',
46
cc: 'cpp',
57
cfg: 'ini',
68
cl: 'cpp',
9+
ets: 'ts',
710
filters: 'xml',
811
flow: 'tsx',
912
gradle: 'groovy',
@@ -12,6 +15,8 @@ export const SHIKI_OPTS = {
1215
iml: 'xml',
1316
map: 'json',
1417
m: 'objective-c',
18+
mak: 'sh',
19+
mk: 'sh',
1520
md: 'mdx',
1621
mm: 'objective-cpp',
1722
plist: 'xml',
@@ -21,6 +26,7 @@ export const SHIKI_OPTS = {
2126
props: 'xml',
2227
sln: 'ini',
2328
svg: 'xml',
29+
workspace: 'xml',
2430
vcxproj: 'xml',
2531
targets: 'xml',
2632
tsbuildinfo: 'json',

0 commit comments

Comments
 (0)