mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Fix ADS Web notebook cross linking (#16926)
* fix cross linking files * use host location instead
This commit is contained in:
@@ -10,6 +10,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { relative, resolve } from 'vs/base/common/path';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { isWeb } from 'vs/base/common/platform';
|
||||
|
||||
const knownSchemes = new Set(['http', 'https', 'file', 'mailto', 'data', 'azuredatastudio', 'azuredatastudio-insiders', 'vscode', 'vscode-insiders', 'vscode-resource', 'onenote']);
|
||||
@Directive({
|
||||
@@ -60,6 +61,16 @@ export class LinkHandlerDirective {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
// Web mode linking to open files
|
||||
if (isWeb) {
|
||||
// only change scheme for file links (file links in web mode scheme are also http)
|
||||
// therefore we will use the authority to understand if its a local file path
|
||||
if (window.location.host === uri.authority) {
|
||||
uri = uri.with({ scheme: 'vscode-remote' });
|
||||
this.openerService.open(uri);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (uri && this.openerService && this.isSupportedLink(uri)) {
|
||||
if (uri.fragment && uri.fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) {
|
||||
this.notebookService.navigateTo(this.notebookUri, uri.fragment);
|
||||
|
||||
Reference in New Issue
Block a user