提交 072f94fb 编写于 作者: A Alex Dima

Fixes #40205: Generate a color map for the time until vscode-textmate is loaded

上级 c66a91bc
......@@ -140,6 +140,23 @@ export class TextMateService implements ITextMateService {
}
});
// Generate some color map until the grammar registry is loaded
let colorTheme = this._themeService.getColorTheme();
let defaultForeground: Color = Color.transparent;
let defaultBackground: Color = Color.transparent;
for (let i = 0, len = colorTheme.tokenColors.length; i < len; i++) {
let rule = colorTheme.tokenColors[i];
if (!rule.scope) {
if (rule.settings.foreground) {
defaultForeground = Color.fromHex(rule.settings.foreground);
}
if (rule.settings.background) {
defaultBackground = Color.fromHex(rule.settings.background);
}
}
}
TokenizationRegistry.setColorMap([null, defaultForeground, defaultBackground]);
this._modeService.onDidCreateMode((mode) => {
let modeId = mode.getId();
if (this._languageToScope.has(modeId)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册