From 77e4fdd407031714c925b1b1c32f8942f95b2c6f Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Fri, 19 Nov 2021 11:25:23 -0800 Subject: [PATCH] Fix open external not working (#17717) --- .../services/query/common/resultSerializer.ts | 2 +- src/vs/workbench/electron-sandbox/window.ts | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/sql/workbench/services/query/common/resultSerializer.ts b/src/sql/workbench/services/query/common/resultSerializer.ts index e26fa68e7e..ab560bfd80 100644 --- a/src/sql/workbench/services/query/common/resultSerializer.ts +++ b/src/sql/workbench/services/query/common/resultSerializer.ts @@ -327,7 +327,7 @@ export class ResultSerializer { } else { this._notificationService.prompt( Severity.Info, - nls.localize('msgSaveSucceeded', "Successfully saved results to {0}", filePath.path), + nls.localize('msgSaveSucceeded', "Successfully saved results to {0}", filePath.fsPath), [{ label: nls.localize('openFile', "Open file"), run: () => { diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index c3e4fbe7c2..cb0e123aac 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -519,18 +519,20 @@ export class NativeWindow extends Disposable { } } - // Assume `uri` this is a workspace uri, let's see if we can handle it - await this.fileService.activateProvider(uri.scheme); + if (!options?.openExternal) { + // Assume `uri` this is a workspace uri, let's see if we can handle it + await this.fileService.activateProvider(uri.scheme); - if (this.fileService.canHandleResource(uri)) { - return { - resolved: URI.from({ - scheme: this.productService.urlProtocol, - path: 'workspace', - query: uri.toString() - }), - dispose() { } - }; + if (this.fileService.canHandleResource(uri)) { + return { + resolved: URI.from({ + scheme: this.productService.urlProtocol, + path: 'workspace', + query: uri.toString() + }), + dispose() { } + }; + } } return undefined;