src/vs/base/node/pfs.ts/rimrafMove
async function rimrafMove(path: string): Promise<void> {
	try {
		const pathInTemp = randomPath(tmpdir());
		try {
			// Intentionally using `fs.promises` here to skip
			// the patched graceful-fs method that can result
			// in very long running `rename` calls when the
			// folder is locked by a file watcher. We do not
			// really want to slow down this operation more
			// than necessary and we have a fallback to delete
			// via unlink.
			// https://github.com/microsoft/vscode/issues/139908
			await fs.promises.rename(path, pathInTemp);
		} catch (error) {
			if (error.code === 'ENOENT') {
				return; // ignore - path to delete did not exist
			}

			return rimrafUnlink(path); // otherwise fallback to unlink
		}

		// Delete but do not return as promise
		rimrafUnlink(pathInTemp).catch(error => {/* ignore */ });
	} catch (error) {
		if (error.code !== 'ENOENT') {
			throw error;
		}
	}
}