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,6 +65,7 @@ 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 {
if (uri.scheme === 'file') {
let exists = await this.fileService.exists(uri); let exists = await this.fileService.exists(uri);
if (!exists) { if (!exists) {
let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath); let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath);
@@ -75,6 +76,7 @@ export class LinkHandlerDirective {
onUnexpectedError(error); onUnexpectedError(error);
} }
} }
}
if (this.forceOpenExternal(uri)) { if (this.forceOpenExternal(uri)) {
this.openerService.open(uri, { openExternal: true }).catch(onUnexpectedError); this.openerService.open(uri, { openExternal: true }).catch(onUnexpectedError);
} }