aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/color_theme.ts
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-20 17:50:39 +0000
committerGitHub <[email protected]>2020-02-20 17:50:39 +0000
commit04dacb994349848873f9b2576d53685630883300 (patch)
tree09c442a5a857b0dc47ad972aea84235f70dbf60c /editors/code/src/color_theme.ts
parentf761ed2abb3faa07f9a835e9ba767954ca2e684b (diff)
parentbf99a6eb084ea6a2ad105bc7328334a769db788c (diff)
Merge #3252
3252: Improve integration with token color configuration r=matklad a=eaglgenes101 First, the extension now checks theme token color customizations as well as global token color customizations when determining what colors to highlight syntax with. Theme token color customizations take precedence over both global token color customizations and the theme token colors. Second, a few additional token color customization keys used by other themes are added. The original paths still take precedence, but now turning on rust analyzer syntax highlighting should now not unexpectedly homogenize token colors when custom themes are used. Co-authored-by: eaglgenes101 <[email protected]>
Diffstat (limited to 'editors/code/src/color_theme.ts')
-rw-r--r--editors/code/src/color_theme.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/editors/code/src/color_theme.ts b/editors/code/src/color_theme.ts
index a6957a76e..2f2a39877 100644
--- a/editors/code/src/color_theme.ts
+++ b/editors/code/src/color_theme.ts
@@ -83,8 +83,12 @@ function loadThemeNamed(themeName: string): ColorTheme {
83 res.mergeFrom(loadThemeFile(themePath)); 83 res.mergeFrom(loadThemeFile(themePath));
84 } 84 }
85 85
86 const customizations: any = vscode.workspace.getConfiguration('editor').get('tokenColorCustomizations'); 86 const global_customizations: any = vscode.workspace.getConfiguration('editor').get('tokenColorCustomizations');
87 res.mergeFrom(ColorTheme.fromRules(customizations?.textMateRules ?? [])); 87 res.mergeFrom(ColorTheme.fromRules(global_customizations?.textMateRules ?? []));
88
89 const theme_customizations: any = vscode.workspace.getConfiguration('editor.tokenColorCustomizations').get(`[${themeName}]`);
90 res.mergeFrom(ColorTheme.fromRules(theme_customizations?.textMateRules ?? []));
91
88 92
89 return res; 93 return res;
90} 94}