src/vs/workbench/services/workingCopy/common/workingCopyBackupService.ts/NativeWorkingCopyBackupServiceImpl/resolveIdentifier
class NativeWorkingCopyBackupServiceImpl:	private async resolveIdentifier(backupResource: URI): Promise<IWorkingCopyIdentifier | undefined> {

		// Read the entire backup preamble by reading up to
		// `PREAMBLE_MAX_LENGTH` in the backup file until
		// the `PREAMBLE_END_MARKER` is found
		const backupPreamble = await this.readToMatchingString(backupResource, NativeWorkingCopyBackupServiceImpl.PREAMBLE_END_MARKER, NativeWorkingCopyBackupServiceImpl.PREAMBLE_MAX_LENGTH);
		if (!backupPreamble) {
			return undefined;
		}

		// Figure out the offset in the preamble where meta
		// information possibly starts. This can be `-1` for
		// older backups without meta.
		const metaStartIndex = backupPreamble.indexOf(NativeWorkingCopyBackupServiceImpl.PREAMBLE_META_SEPARATOR);

		// Extract the preamble content for resource and meta
		let resourcePreamble: string;
		let metaPreamble: string | undefined;
		if (metaStartIndex > 0) {
			resourcePreamble = backupPreamble.substring(0, metaStartIndex);
			metaPreamble = backupPreamble.substr(metaStartIndex + 1);
		} else {
			resourcePreamble = backupPreamble;
			metaPreamble = undefined;
		}

		// Try to find the `typeId` in the meta data if possible
		let typeId: string | undefined = undefined;
		if (metaPreamble) {
			try {
				typeId = JSON.parse(metaPreamble).typeId;
			} catch (error) {
				// ignore JSON parse errors
			}
		}

		return {
			typeId: typeId ?? NO_TYPE_ID,
			resource: URI.parse(resourcePreamble)
		};
	}