diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2019-05-21 14:04:54 +0300 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2019-05-21 14:19:08 +0300 |
| commit | 9ade271a67a9fae0d89f8138970679c9730e9fce (patch) | |
| tree | 7a3cc5a13d3d71d0d247f5d0b86ecdabfc9f8f35 /editors/code/src | |
| parent | eabfe3902f363ee03bef8421580c6fe8e3730899 (diff) | |
| download | rust-9ade271a67a9fae0d89f8138970679c9730e9fce.tar.gz rust-9ade271a67a9fae0d89f8138970679c9730e9fce.zip | |
Use ThemeColor and add support for light themes
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/highlighting.ts | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 2521dff6221..432f40ff40d 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts @@ -13,23 +13,32 @@ export class Highlighter { string, vscode.TextEditorDecorationType > { - const decor = (color: string) => - vscode.window.createTextEditorDecorationType({ color }); + const colorContrib = ( + tag: string + ): [string, vscode.TextEditorDecorationType] => { + const color = new vscode.ThemeColor('ralsp.' + tag); + const decor = vscode.window.createTextEditorDecorationType({ + color + }); + return [tag, decor]; + }; const decorations: Iterable< [string, vscode.TextEditorDecorationType] > = [ - ['background', decor('#3F3F3F')], - ['comment', decor('#7F9F7F')], - ['string', decor('#CC9393')], - ['keyword', decor('#F0DFAF')], - ['function', decor('#93E0E3')], - ['parameter', decor('#94BFF3')], - ['builtin', decor('#DD6718')], - ['text', decor('#DCDCCC')], - ['attribute', decor('#BFEBBF')], - ['literal', decor('#DFAF8F')], - ['macro', decor('#DFAF8F')] + colorContrib('background'), + colorContrib('comment'), + colorContrib('string'), + colorContrib('unsafe'), + colorContrib('keyword'), + colorContrib('control'), + colorContrib('function'), + colorContrib('parameter'), + colorContrib('builtin'), + colorContrib('text'), + colorContrib('attribute'), + colorContrib('literal'), + colorContrib('macro') ]; return new Map<string, vscode.TextEditorDecorationType>(decorations); |
