diff --git a/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.ts b/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.ts index 7901ccc3e16..597bcfab6fd 100644 --- a/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.ts +++ b/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.ts @@ -37,7 +37,7 @@ export class NotebookKernelHistoryService extends Disposable implements INoteboo this._loadState(); this._register(this._storageService.onWillSaveState(() => this._saveState())); this._register(this._storageService.onDidChangeValue(StorageScope.WORKSPACE, NotebookKernelHistoryService.STORAGE_KEY, this._register(new DisposableStore()))(() => { - this._restoreState(); + this._loadState(); })); } @@ -88,24 +88,6 @@ export class NotebookKernelHistoryService extends Disposable implements INoteboo } } - private _restoreState(): void { - const serialized = this._storageService.get(NotebookKernelHistoryService.STORAGE_KEY, StorageScope.WORKSPACE); - if (serialized) { - try { - for (const [viewType, kernels] of JSON.parse(serialized)) { - const linkedMap = this._mostRecentKernelsMap[viewType] ?? new LinkedMap(); - for (const entry of kernels.entries) { - linkedMap.set(entry, entry, Touch.AsOld); - } - - this._mostRecentKernelsMap[viewType] = linkedMap; - } - } catch (e) { - console.error('Deserialize notebook kernel history failed', e); - } - } - } - private _loadState(): void { const serialized = this._storageService.get(NotebookKernelHistoryService.STORAGE_KEY, StorageScope.WORKSPACE); if (serialized) {