File tree 1 file changed +19
-0
lines changed
arduino-ide-extension/src/browser/theia/core
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
3
3
import { injectable } from '@theia/core/shared/inversify' ;
4
4
import { EditorPreviewWidgetFactory } from '@theia/editor-preview/lib/browser/editor-preview-widget-factory' ;
5
5
import { EditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory' ;
6
+ import { FrontendApplication } from './frontend-application' ;
6
7
7
8
@injectable ( )
8
9
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
+
9
28
/**
10
29
* Customized to filter out duplicate editor tabs.
11
30
*/
You can’t perform that action at this time.
0 commit comments