1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-14 09:42:10 -04:00

matugen: fix vscode editor color reload

This commit is contained in:
bbedward
2025-12-17 23:40:09 -05:00
parent f0f5bcc630
commit 8745f98c95
2 changed files with 22 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ function activate(context) {
if (!watcher) return; if (!watcher) return;
const reloadTheme = (uri) => { const reloadTheme = () => {
if (reloadTimeout) clearTimeout(reloadTimeout); if (reloadTimeout) clearTimeout(reloadTimeout);
reloadTimeout = setTimeout(async () => { reloadTimeout = setTimeout(async () => {
@@ -47,13 +47,28 @@ function activate(context) {
return; return;
} }
if (!themeData?.colors) return; const themeKey = `[${currentTheme}]`;
await config.update( if (themeData.colors) {
"colorCustomizations", const colorConfig = config.get("colorCustomizations") || {};
{ "[Dynamic Base16 DankShell]": themeData.colors }, colorConfig[themeKey] = themeData.colors;
vscode.ConfigurationTarget.Global await config.update(
); "colorCustomizations",
colorConfig,
vscode.ConfigurationTarget.Global
);
}
if (themeData.tokenColors) {
const editorConfig = vscode.workspace.getConfiguration("editor");
const tokenConfig = editorConfig.get("tokenColorCustomizations") || {};
tokenConfig[themeKey] = { textMateRules: themeData.tokenColors };
await editorConfig.update(
"tokenColorCustomizations",
tokenConfig,
vscode.ConfigurationTarget.Global
);
}
}, 150); }, 150);
}; };