Skip to content

Commit d6a6ccd

Browse files
author
Akos Kitta
committed
temp logging.
Signed-off-by: Akos Kitta <[email protected]>
1 parent 1fde017 commit d6a6ccd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: arduino-ide-extension/src/browser/theia/core/shell-layout-restorer.ts

+19
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,28 @@ import { ShellLayoutRestorer as TheiaShellLayoutRestorer } from '@theia/core/lib
33
import { injectable } from '@theia/core/shared/inversify';
44
import { EditorPreviewWidgetFactory } from '@theia/editor-preview/lib/browser/editor-preview-widget-factory';
55
import { EditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory';
6+
import { FrontendApplication } from './frontend-application';
67

78
@injectable()
89
export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
10+
override async restoreLayout(app: FrontendApplication): Promise<boolean> {
11+
this.logger.info('>>> Restoring the layout state...');
12+
const serializedLayoutData = await this.storageService.getData<string>(
13+
this.storageKey
14+
);
15+
if (serializedLayoutData === undefined) {
16+
this.logger.info('<<< Nothing to restore.');
17+
return false;
18+
}
19+
console.log('------- SERIALIZED LAYOUT DATA -------');
20+
console.log(serializedLayoutData);
21+
console.log('------- END SERIALIZED LAYOUT DATA -------');
22+
const layoutData = await this.inflate(serializedLayoutData);
23+
await app.shell.setLayoutData(layoutData);
24+
this.logger.info('<<< The layout has been successfully restored.');
25+
return true;
26+
}
27+
928
/**
1029
* Customized to filter out duplicate editor tabs.
1130
*/

0 commit comments

Comments
 (0)