Skip to content

Commit 085f7eb

Browse files
author
Akos Kitta
committed
fix: theme registration order
Custom theme registration must happen right before restore. Signed-off-by: Akos Kitta <[email protected]>
1 parent 4a524ea commit 085f7eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arduino-ide-extension/src/browser/theia/monaco/monaco-theming-service.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { ArduinoThemes } from '../core/theming';
44

55
@injectable()
66
export class MonacoThemingService extends TheiaMonacoThemingService {
7-
override initialize(): void {
8-
super.initialize();
7+
protected override restore(): Promise<void> {
98
const { Light, Dark } = ArduinoThemes;
109
this.registerParsedTheme({
1110
id: Light.id,
@@ -19,5 +18,10 @@ export class MonacoThemingService extends TheiaMonacoThemingService {
1918
uiTheme: 'vs-dark',
2019
json: require('../../../../src/browser/data/dark.color-theme.json'),
2120
});
21+
// The custom theme registration must happen before restoring the themes.
22+
// Otherwise, the theme content change is not picked up by Theia.
23+
// There is a indexedDB getAll before the DB put.
24+
// https://github.com/arduino/arduino-ide/issues/1251#issuecomment-1436737702
25+
return super.restore();
2226
}
2327
}

0 commit comments

Comments
 (0)