diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index a50dd26f7ef..c49f109d81c 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -571,7 +571,7 @@ export class CodeApplication extends Disposable { private setupProtocolUrlHandlers(accessor: ServicesAccessor, mainProcessElectronServer: ElectronIPCServer): IInitialProtocolUrls | undefined { const windowsMainService = this.windowsMainService = accessor.get(IWindowsMainService); const urlService = accessor.get(IURLService); - const nativeHostMainService = accessor.get(INativeHostMainService); + const nativeHostMainService = this.nativeHostMainService = accessor.get(INativeHostMainService); // Install URL handlers that deal with protocl URLs either // from this process by opening windows and/or by forwarding @@ -603,20 +603,19 @@ export class CodeApplication extends Disposable { private resolveInitialProtocolUrls(): IInitialProtocolUrls | undefined { /** - * Protocol URL handling on startup is complex, - * refer to {@link IInitialProtocolUrls} for an - * explainer. + * Protocol URL handling on startup is complex, refer to + * {@link IInitialProtocolUrls} for an explainer. */ // Windows/Linux: protocol handler invokes CLI with --open-url const protocolUrlsFromCommandLine = this.environmentMainService.args['open-url'] ? this.environmentMainService.args._urls || [] : []; - if (protocolUrlsFromCommandLine.length) { + if (protocolUrlsFromCommandLine.length > 0) { this.logService.trace('app#resolveInitialProtocolUrls() protocol urls from command line:', protocolUrlsFromCommandLine); } // macOS: open-url events that were received before the app is ready const protocolUrlsFromEvent = ((global).getOpenUrls() || []) as string[]; - if (protocolUrlsFromEvent.length) { + if (protocolUrlsFromEvent.length > 0) { this.logService.trace(`app#resolveInitialProtocolUrls() protocol urls from macOS 'open-url' event:`, protocolUrlsFromEvent); } diff --git a/src/vs/platform/url/electron-main/url.ts b/src/vs/platform/url/electron-main/url.ts index 683e65943af..a199e0ab87e 100644 --- a/src/vs/platform/url/electron-main/url.ts +++ b/src/vs/platform/url/electron-main/url.ts @@ -25,12 +25,11 @@ export interface IProtocolUrl { * form of the protocol URL: * * On the high level, there are 2 types of protocol URLs: - * - those that need to be handled within a window for - * example because they need to be forwarded to an - * extension + * - those that need to be handled within a window because + * they need to be forwarded to an extension for example * - those that can be handled directly as window to open * - * The former are for example of the form: + * The former can be of the form: * ``` * :/// * ``` diff --git a/src/vs/workbench/services/url/electron-sandbox/urlService.ts b/src/vs/workbench/services/url/electron-sandbox/urlService.ts index 62f25c15a6e..840562f12b7 100644 --- a/src/vs/workbench/services/url/electron-sandbox/urlService.ts +++ b/src/vs/workbench/services/url/electron-sandbox/urlService.ts @@ -68,11 +68,11 @@ export class RelayURLService extends NativeURLService implements IURLHandler, IO const result = await super.open(uri, options); if (result) { - this.logService.trace('[URL #handleURL()] handled', uri.toString(true)); + this.logService.trace('URLService#handleURL(): handled', uri.toString(true)); await this.nativeHostService.focusWindow({ force: true /* Application may not be active */ }); } else { - this.logService.trace('[URL #handleURL()] not handled', uri.toString(true)); + this.logService.trace('URLService#handleURL(): not handled', uri.toString(true)); } return result;