mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-27 21:09:31 +01:00
remove bad duplicate implementation
This commit is contained in:
+1
-19
@@ -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<string, string>();
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user