From 4149fc4e53d3b5d94d322974790429a447cb98b9 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 20 Dec 2018 08:45:20 +0100 Subject: [PATCH] :lipstick: --- src/vs/code/electron-main/app.ts | 1 + src/vs/code/electron-main/main.ts | 53 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index b25ad242115..582880dfe10 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -346,6 +346,7 @@ export class CodeApplication extends Disposable { const srcUri: any = URI.parse(source).fsPath.toLowerCase(); const rootUri = URI.file(this.environmentService.appRoot).fsPath.toLowerCase(); + return srcUri.startsWith(rootUri + nativeSep); } diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 3c821c87534..60f0cf83c1f 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -49,31 +49,6 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { CommandLineDialogService } from 'vs/platform/dialogs/node/dialogService'; import { createWaitMarkerFile } from 'vs/code/node/wait'; -function createServices(args: ParsedArgs, bufferLogService: BufferLogService): IInstantiationService { - const services = new ServiceCollection(); - - const environmentService = new EnvironmentService(args, process.execPath); - - const logService = new MultiplexLogService([new ConsoleLogMainService(getLogLevel(environmentService)), bufferLogService]); - process.once('exit', () => logService.dispose()); - setTimeout(() => cleanupOlderLogs(environmentService).then(null, err => console.error(err)), 10000); - - services.set(IEnvironmentService, environmentService); - services.set(ILogService, logService); - services.set(IWorkspacesMainService, new SyncDescriptor(WorkspacesMainService)); - services.set(IHistoryMainService, new SyncDescriptor(HistoryMainService)); - services.set(ILifecycleService, new SyncDescriptor(LifecycleService)); - services.set(IStateService, new SyncDescriptor(StateService)); - services.set(IConfigurationService, new SyncDescriptor(ConfigurationService)); - services.set(IRequestService, new SyncDescriptor(RequestService)); - services.set(IURLService, new SyncDescriptor(URLService)); - services.set(IBackupMainService, new SyncDescriptor(BackupMainService)); - services.set(IDialogService, new SyncDescriptor(CommandLineDialogService)); - services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService)); - - return new InstantiationService(services, true); -} - /** * Cleans up older logs, while keeping the 10 most recent ones. */ @@ -322,8 +297,7 @@ function startup(args: ParsedArgs): void { const instanceEnvironment = patchEnvironment(environmentService); // Startup - return instantiationService - .invokeFunction(a => createPaths(a.get(IEnvironmentService))) + return createPaths(environmentService) .then(() => instantiationService.invokeFunction(setupIPC)) .then(mainIpcServer => { bufferLogService.logger = createSpdLogService('main', bufferLogService.getLevel(), environmentService.logsPath); @@ -333,6 +307,31 @@ function startup(args: ParsedArgs): void { }).then(null, err => instantiationService.invokeFunction(quit, err)); } +function createServices(args: ParsedArgs, bufferLogService: BufferLogService): IInstantiationService { + const services = new ServiceCollection(); + + const environmentService = new EnvironmentService(args, process.execPath); + + const logService = new MultiplexLogService([new ConsoleLogMainService(getLogLevel(environmentService)), bufferLogService]); + process.once('exit', () => logService.dispose()); + setTimeout(() => cleanupOlderLogs(environmentService).then(null, err => console.error(err)), 10000); + + services.set(IEnvironmentService, environmentService); + services.set(ILogService, logService); + services.set(IWorkspacesMainService, new SyncDescriptor(WorkspacesMainService)); + services.set(IHistoryMainService, new SyncDescriptor(HistoryMainService)); + services.set(ILifecycleService, new SyncDescriptor(LifecycleService)); + services.set(IStateService, new SyncDescriptor(StateService)); + services.set(IConfigurationService, new SyncDescriptor(ConfigurationService)); + services.set(IRequestService, new SyncDescriptor(RequestService)); + services.set(IURLService, new SyncDescriptor(URLService)); + services.set(IBackupMainService, new SyncDescriptor(BackupMainService)); + services.set(IDialogService, new SyncDescriptor(CommandLineDialogService)); + services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService)); + + return new InstantiationService(services, true); +} + function main(): void { // Set the error handler early enough so that we are not getting the