diff options
author | eaglgenes101 <[email protected]> | 2020-02-20 17:40:12 +0000 |
---|---|---|
committer | eaglgenes101 <[email protected]> | 2020-02-20 17:40:12 +0000 |
commit | 358b9d685fc289e0ad2bff5cb0508e8ad383b7ff (patch) | |
tree | 194148f2a06ba395ddff95e3a4b65cb724ffbd92 /editors/code/src | |
parent | 4e288c64ff83ff8de04c86037ce7f6f4c265e148 (diff) |
Improved compatibility with themes
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/color_theme.ts | 8 | ||||
-rw-r--r-- | editors/code/src/highlighting.ts | 8 |
2 files changed, 10 insertions, 6 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 | } |
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index c4d286aef..b34e49c17 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts | |||
@@ -233,16 +233,16 @@ const TAG_TO_SCOPES = new Map<string, string[]>([ | |||
233 | ["type", ["entity.name.type"]], | 233 | ["type", ["entity.name.type"]], |
234 | ["type.builtin", ["entity.name.type", "support.type.primitive"]], | 234 | ["type.builtin", ["entity.name.type", "support.type.primitive"]], |
235 | ["type.self", ["entity.name.type.parameter.self"]], | 235 | ["type.self", ["entity.name.type.parameter.self"]], |
236 | ["type.param", ["entity.name.type.parameter"]], | 236 | ["type.param", ["entity.name.type.parameter", "entity.name.type.param.rust"]], |
237 | ["type.lifetime", ["entity.name.type.lifetime"]], | 237 | ["type.lifetime", ["entity.name.type.lifetime", "entity.name.lifetime.rust"]], |
238 | 238 | ||
239 | ["literal.byte", ["constant.character.byte"]], | 239 | ["literal.byte", ["constant.character.byte"]], |
240 | ["literal.char", ["constant.character"]], | 240 | ["literal.char", ["constant.character.rust"]], |
241 | ["literal.numeric", ["constant.numeric"]], | 241 | ["literal.numeric", ["constant.numeric"]], |
242 | 242 | ||
243 | ["comment", ["comment"]], | 243 | ["comment", ["comment"]], |
244 | ["string", ["string.quoted"]], | 244 | ["string", ["string.quoted"]], |
245 | ["attribute", ["meta.attribute"]], | 245 | ["attribute", ["meta.attribute.rust"]], |
246 | 246 | ||
247 | ["keyword", ["keyword"]], | 247 | ["keyword", ["keyword"]], |
248 | ["keyword.unsafe", ["keyword.other.unsafe"]], | 248 | ["keyword.unsafe", ["keyword.other.unsafe"]], |