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) {
this.notebookService.navigateTo(this.notebookUri, uri.fragment);
} else {
let exists = await this.fileService.exists(uri);
if (!exists) {
let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath);
let path = resolve(this.notebookUri.fsPath, relPath);
try {
uri = URI.file(path);
} catch (error) {
onUnexpectedError(error);
if (uri.scheme === 'file') {
let exists = await this.fileService.exists(uri);
if (!exists) {
let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath);
let path = resolve(this.notebookUri.fsPath, relPath);
try {
uri = URI.file(path);
} catch (error) {
onUnexpectedError(error);
}
}
}
if (this.forceOpenExternal(uri)) {