Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove bad duplicate implementation #194815

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}));
}

Expand Down Expand Up @@ -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) {
Expand Down