File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
arduino-ide-extension/src/browser/theia/core Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,28 @@ import { ShellLayoutRestorer as TheiaShellLayoutRestorer } from '@theia/core/lib
33import { injectable } from '@theia/core/shared/inversify' ;
44import { EditorPreviewWidgetFactory } from '@theia/editor-preview/lib/browser/editor-preview-widget-factory' ;
55import { EditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory' ;
6+ import { FrontendApplication } from './frontend-application' ;
67
78@injectable ( )
89export 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 */
You can’t perform that action at this time.
0 commit comments