mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 01:32:29 -04:00
matugen: fix vscode editor color reload
This commit is contained in:
Binary file not shown.
@@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user