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 @@ -4,9 +4,28 @@ import { ShellLayoutRestorer as TheiaShellLayoutRestorer } from '@theia/core/lib
4
4
import { injectable } from '@theia/core/shared/inversify' ;
5
5
import { EditorPreviewWidgetFactory } from '@theia/editor-preview/lib/browser/editor-preview-widget-factory' ;
6
6
import { EditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory' ;
7
+ import { FrontendApplication } from './frontend-application' ;
7
8
8
9
@injectable ( )
9
10
export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
11
+ override async restoreLayout ( app : FrontendApplication ) : Promise < boolean > {
12
+ this . logger . info ( '>>> Restoring the layout state...' ) ;
13
+ const serializedLayoutData = await this . storageService . getData < string > (
14
+ this . storageKey
15
+ ) ;
16
+ if ( serializedLayoutData === undefined ) {
17
+ this . logger . info ( '<<< Nothing to restore.' ) ;
18
+ return false ;
19
+ }
20
+ console . log ( '------- SERIALIZED LAYOUT DATA -------' ) ;
21
+ console . log ( serializedLayoutData ) ;
22
+ console . log ( '------- END SERIALIZED LAYOUT DATA -------' ) ;
23
+ const layoutData = await this . inflate ( serializedLayoutData ) ;
24
+ await app . shell . setLayoutData ( layoutData ) ;
25
+ this . logger . info ( '<<< The layout has been successfully restored.' ) ;
26
+ return true ;
27
+ }
28
+
10
29
/**
11
30
* Customized to filter out duplicate editor tabs.
12
31
*/
You can’t perform that action at this time.
0 commit comments