src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts/WorkingCopyHistoryModel/store
class WorkingCopyHistoryModel:	async store(token: CancellationToken): Promise<void> {
		const historyEntriesFolder = assertIsDefined(this.historyEntriesFolder);

		if (!this.shouldStore) {
			return; // fast return to avoid disk access when nothing changed
		}

		// Make sure to await resolving when persisting
		await this.resolveEntriesOnce();

		if (token.isCancellationRequested) {
			return undefined;
		}

		// Cleanup based on max-entries setting
		await this.cleanUpEntries();

		// Without entries, remove the history folder
		if (this.entries.length === 0) {
			try {
				await this.fileService.del(historyEntriesFolder, { recursive: true });
			} catch (error) {
				this.traceError(error);
			}
		}

		// If we still have entries, update the entries meta file
		else {
			await this.writeEntriesFile();
		}

		// Mark as being up to date on disk
		this.shouldStore = false;
	}