diff options
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r-- | editors/code/src/highlighting.ts | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 2521dff62..e1a68544a 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts | |||
@@ -13,23 +13,31 @@ export class Highlighter { | |||
13 | string, | 13 | string, |
14 | vscode.TextEditorDecorationType | 14 | vscode.TextEditorDecorationType |
15 | > { | 15 | > { |
16 | const decor = (color: string) => | 16 | const colorContrib = ( |
17 | vscode.window.createTextEditorDecorationType({ color }); | 17 | tag: string |
18 | ): [string, vscode.TextEditorDecorationType] => { | ||
19 | const color = new vscode.ThemeColor('ralsp.' + tag); | ||
20 | const decor = vscode.window.createTextEditorDecorationType({ | ||
21 | color | ||
22 | }); | ||
23 | return [tag, decor]; | ||
24 | }; | ||
18 | 25 | ||
19 | const decorations: Iterable< | 26 | const decorations: Iterable< |
20 | [string, vscode.TextEditorDecorationType] | 27 | [string, vscode.TextEditorDecorationType] |
21 | > = [ | 28 | > = [ |
22 | ['background', decor('#3F3F3F')], | 29 | colorContrib('comment'), |
23 | ['comment', decor('#7F9F7F')], | 30 | colorContrib('string'), |
24 | ['string', decor('#CC9393')], | 31 | colorContrib('keyword'), |
25 | ['keyword', decor('#F0DFAF')], | 32 | colorContrib('keyword.control'), |
26 | ['function', decor('#93E0E3')], | 33 | colorContrib('keyword.unsafe'), |
27 | ['parameter', decor('#94BFF3')], | 34 | colorContrib('function'), |
28 | ['builtin', decor('#DD6718')], | 35 | colorContrib('parameter'), |
29 | ['text', decor('#DCDCCC')], | 36 | colorContrib('builtin'), |
30 | ['attribute', decor('#BFEBBF')], | 37 | colorContrib('text'), |
31 | ['literal', decor('#DFAF8F')], | 38 | colorContrib('attribute'), |
32 | ['macro', decor('#DFAF8F')] | 39 | colorContrib('literal'), |
40 | colorContrib('macro') | ||
33 | ]; | 41 | ]; |
34 | 42 | ||
35 | return new Map<string, vscode.TextEditorDecorationType>(decorations); | 43 | return new Map<string, vscode.TextEditorDecorationType>(decorations); |