diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts index 4c19aad3ee..03f7533096 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts @@ -10,7 +10,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { onUnexpectedError } from 'vs/base/common/errors'; import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService'; -const knownSchemes = new Set(['http', 'https', 'file', 'mailto', 'data', 'azuredatastudio', 'azuredatastudio-insiders', 'vscode', 'vscode-insiders', 'vscode-resource']); +const knownSchemes = new Set(['http', 'https', 'file', 'mailto', 'data', 'azuredatastudio', 'azuredatastudio-insiders', 'vscode', 'vscode-insiders', 'vscode-resource', 'onenote']); @Directive({ selector: '[link-handler]', }) @@ -61,7 +61,12 @@ export class LinkHandlerDirective { if (uri.fragment && uri.fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) { this.notebookService.navigateTo(this.notebookUri, uri.fragment); } else { - this.openerService.open(uri).catch(onUnexpectedError); + if (this.forceOpenExternal(uri)) { + this.openerService.open(uri, { openExternal: true }).catch(onUnexpectedError); + } + else { + this.openerService.open(uri).catch(onUnexpectedError); + } } } } @@ -72,4 +77,11 @@ export class LinkHandlerDirective { } return !!this.isTrusted && link.scheme === 'command'; } + + private forceOpenExternal(link: URI): boolean { + if (link.scheme.toLowerCase() === 'onenote') { + return true; + } + return false; + } }