Theia 18 hotfixes (#528)

* Restore monaco suggestion highlights

* remove duplicated tabs on startup

* fix rename and delete sketch

* remove '.only(...)' in tests

Co-authored-by: Alberto Iannaccone <a.iannaccone@arduino.cc>
This commit is contained in:
Francesco Stasi
2021-10-06 17:50:02 +02:00
committed by GitHub
parent fc0f67493b
commit 846c22cb03
4 changed files with 44 additions and 10 deletions

View File

@@ -22,4 +22,30 @@ export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
}
}
}
async restoreLayout(app: FrontendApplication): Promise<boolean> {
this.logger.info('>>> Restoring the layout state...');
const serializedLayoutData = await this.storageService.getData<string>(
this.storageKey
);
if (serializedLayoutData === undefined) {
this.logger.info('<<< Nothing to restore.');
return false;
}
const layoutData = await this.inflate(serializedLayoutData);
// workaround to remove duplicated tabs
if ((layoutData as any)?.mainPanel?.main?.widgets) {
(layoutData as any).mainPanel.main.widgets = (
layoutData as any
).mainPanel.main.widgets.filter(
(widget: any) =>
widget.constructionOptions.factoryId !== 'code-editor-opener'
);
}
await app.shell.setLayoutData(layoutData);
this.logger.info('<<< The layout has been successfully restored.');
return true;
}
}