src/vs/workbench/contrib/debug/common/debugSource.ts/getUriFromSource
export function getUriFromSource(raw: DebugProtocol.Source, path: string | undefined, sessionId: string, uriIdentityService: IUriIdentityService): URI {
	if (typeof raw.sourceReference === 'number' && raw.sourceReference > 0) {
		return URI.from({
			scheme: DEBUG_SCHEME,
			path,
			query: `session=${sessionId}&ref=${raw.sourceReference}`
		});
	}

	if (path && isUri(path)) {	// path looks like a uri
		return uriIdentityService.asCanonicalUri(URI.parse(path));
	}
	// assume a filesystem path
	if (path && isAbsolute(path)) {
		return uriIdentityService.asCanonicalUri(URI.file(path));
	}
	// path is relative: since VS Code cannot deal with this by itself
	// create a debug url that will result in a DAP 'source' request when the url is resolved.
	return uriIdentityService.asCanonicalUri(URI.from({
		scheme: DEBUG_SCHEME,
		path,
		query: `session=${sessionId}`
	}));
}