mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Check for file scheme in linkhandler (#10090)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user