src/vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner.ts/UnusedWorkspaceStorageDataCleaner/cleanUpStorage
class UnusedWorkspaceStorageDataCleaner:	private async cleanUpStorage(): Promise<void> {
		this.logService.trace('[storage cleanup]: Starting to clean up workspace storage folders for unused empty workspaces.');

		try {
			const workspaceStorageFolders = await Promises.readdir(this.environmentService.workspaceStorageHome.fsPath);
			const storageClient = new StorageClient(this.mainProcessService.getChannel('storage'));

			await Promise.all(workspaceStorageFolders.map(async workspaceStorageFolder => {
				const workspaceStoragePath = join(this.environmentService.workspaceStorageHome.fsPath, workspaceStorageFolder);

				if (workspaceStorageFolder.length === NON_EMPTY_WORKSPACE_ID_LENGTH) {
					return; // keep workspace storage for folders/workspaces that can be accessed still
				}

				if (workspaceStorageFolder === EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE.id) {
					return; // keep workspace storage for empty extension development workspaces
				}

				const windows = await this.nativeHostService.getWindows();
				if (windows.some(window => window.workspace?.id === workspaceStorageFolder)) {
					return; // keep workspace storage for empty workspaces opened as window
				}

				const isStorageUsed = await storageClient.isUsed(workspaceStoragePath);
				if (isStorageUsed) {
					return; // keep workspace storage for empty workspaces that are in use
				}

				this.logService.trace(`[storage cleanup]: Deleting workspace storage folder ${workspaceStorageFolder} as it seems to be an unused empty workspace.`);

				await Promises.rm(workspaceStoragePath);
			}));
		} catch (error) {
			onUnexpectedError(error);
		}
	}