Check for file scheme in linkhandler (#10090)

This commit is contained in:
Chris LaFreniere
2020-04-20 17:18:38 -07:00
committed by GitHub
parent 33e7641400
commit 4f1d4276a0

View File

@@ -65,14 +65,16 @@ export class LinkHandlerDirective {
if (uri.fragment && uri.fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) { if (uri.fragment && uri.fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) {
this.notebookService.navigateTo(this.notebookUri, uri.fragment); this.notebookService.navigateTo(this.notebookUri, uri.fragment);
} else { } else {
let exists = await this.fileService.exists(uri); if (uri.scheme === 'file') {
if (!exists) { let exists = await this.fileService.exists(uri);
let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath); if (!exists) {
let path = resolve(this.notebookUri.fsPath, relPath); let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath);
try { let path = resolve(this.notebookUri.fsPath, relPath);
uri = URI.file(path); try {
} catch (error) { uri = URI.file(path);
onUnexpectedError(error); } catch (error) {
onUnexpectedError(error);
}
} }
} }
if (this.forceOpenExternal(uri)) { if (this.forceOpenExternal(uri)) {