@@ -10,13 +10,12 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
1010import { IThemeService } from 'vs/platform/theme/common/themeService' ;
1111import { CancellationToken } from 'vs/base/common/cancellation' ;
1212import { IEditorGroup , IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService' ;
13- import { IStorageService } from 'vs/platform/storage /common/storage ' ;
13+ import { INextStorage2Service , StorageScope } from 'vs/platform/storage2 /common/storage2 ' ;
1414import { LRUCache } from 'vs/base/common/map' ;
1515import { URI } from 'vs/base/common/uri' ;
1616import { once , Event } from 'vs/base/common/event' ;
1717import { isEmptyObject } from 'vs/base/common/types' ;
1818import { DEFAULT_EDITOR_MIN_DIMENSIONS , DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor' ;
19- import { Scope } from 'vs/workbench/common/memento' ;
2019
2120/**
2221 * The base class of editors in the workbench. Editors register themselves for specific editor inputs.
@@ -50,9 +49,10 @@ export abstract class BaseEditor extends Panel implements IEditor {
5049 constructor (
5150 id : string ,
5251 telemetryService : ITelemetryService ,
53- themeService : IThemeService
52+ themeService : IThemeService ,
53+ nextStorage2Service : INextStorage2Service
5454 ) {
55- super ( id , telemetryService , themeService ) ;
55+ super ( id , telemetryService , themeService , nextStorage2Service ) ;
5656 }
5757
5858 get input ( ) : EditorInput {
@@ -143,28 +143,26 @@ export abstract class BaseEditor extends Panel implements IEditor {
143143 this . _group = group ;
144144 }
145145
146- protected getEditorMemento < T > ( storageService : IStorageService , editorGroupService : IEditorGroupsService , key : string , limit : number = 10 ) : IEditorMemento < T > {
146+ protected getEditorMemento < T > ( editorGroupService : IEditorGroupsService , key : string , limit : number = 10 ) : IEditorMemento < T > {
147147 const mementoKey = `${ this . getId ( ) } ${ key } ` ;
148148
149149 let editorMemento = BaseEditor . EDITOR_MEMENTOS . get ( mementoKey ) ;
150150 if ( ! editorMemento ) {
151- editorMemento = new EditorMemento ( this . getId ( ) , key , this . getMemento ( storageService , Scope . WORKSPACE ) , limit , editorGroupService ) ;
151+ editorMemento = new EditorMemento ( this . getId ( ) , key , this . getMemento ( StorageScope . WORKSPACE ) , limit , editorGroupService ) ;
152152 BaseEditor . EDITOR_MEMENTOS . set ( mementoKey , editorMemento ) ;
153153 }
154154
155155 return editorMemento ;
156156 }
157157
158- shutdown ( ) : void {
158+ protected saveState ( ) : void {
159159
160- // Shutdown all editor memento for this editor type
160+ // Save all editor memento for this editor type
161161 BaseEditor . EDITOR_MEMENTOS . forEach ( editorMemento => {
162162 if ( editorMemento . id === this . getId ( ) ) {
163- editorMemento . shutdown ( ) ;
163+ editorMemento . save ( ) ;
164164 }
165165 } ) ;
166-
167- super . shutdown ( ) ;
168166 }
169167
170168 dispose ( ) : void {
@@ -279,7 +277,7 @@ export class EditorMemento<T> implements IEditorMemento<T> {
279277 return this . cache ;
280278 }
281279
282- shutdown ( ) : void {
280+ save ( ) : void {
283281 const cache = this . doLoad ( ) ;
284282
285283 // Cleanup once during shutdown
0 commit comments