Skip to content

Commit 17b559c

Browse files
author
Benjamin Pasero
committed
debt - move more things out of services
1 parent 9cfc937 commit 17b559c

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/vs/platform/lifecycle/electron-browser/lifecycleService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export class LifecycleService extends Disposable implements ILifecycleService {
5252
this._startupKind = this.resolveStartupKind();
5353

5454
this.registerListeners();
55+
56+
this._phase = LifecyclePhase.Ready;
5557
}
5658

5759
private resolveStartupKind(): StartupKind {

src/vs/workbench/electron-browser/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { domContentLoaded, addDisposableListener, EventType, scheduleAtNextAnima
1414
import { onUnexpectedError } from 'vs/base/common/errors';
1515
import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
1616
import { URI as uri } from 'vs/base/common/uri';
17-
import { WorkspaceService } from 'vs/workbench/services/configuration/node/configurationService';
17+
import { WorkspaceService, DefaultConfigurationExportHelper } from 'vs/workbench/services/configuration/node/configurationService';
1818
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
1919
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
2020
import { stat } from 'vs/base/node/pfs';
@@ -136,6 +136,11 @@ class CodeRendererMain extends Disposable {
136136
if (this.configuration.driverHandle) {
137137
registerWindowDriver(electronMainClient, this.configuration.windowId, instantiationService).then(disposable => this._register(disposable));
138138
}
139+
140+
// Config Exporter
141+
if (this.configuration.args['export-default-configuration']) {
142+
instantiationService.createInstance(DefaultConfigurationExportHelper);
143+
}
139144
});
140145
});
141146
}

src/vs/workbench/electron-browser/workbench.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ import { WorkbenchContextKeysHandler } from 'vs/workbench/browser/contextkeys';
142142

143143
// import@node
144144
import { BackupFileService, InMemoryBackupFileService } from 'vs/workbench/services/backup/node/backupFileService';
145-
import { WorkspaceService, DefaultConfigurationExportHelper } from 'vs/workbench/services/configuration/node/configurationService';
145+
import { WorkspaceService } from 'vs/workbench/services/configuration/node/configurationService';
146146
import { JSONEditingService } from 'vs/workbench/services/configuration/node/jsonEditingService';
147147
import { WorkspaceEditingService } from 'vs/workbench/services/workspace/node/workspaceEditingService';
148148
import { getDelayedChannel } from 'vs/base/parts/ipc/node/ipc';
@@ -524,8 +524,6 @@ export class Workbench extends Disposable implements IPartService {
524524

525525
// Lifecycle
526526
this.lifecycleService = this.instantiationService.createInstance(LifecycleService);
527-
this.lifecycleService.phase = LifecyclePhase.Ready; // Set lifecycle phase to `Ready`
528-
529527
serviceCollection.set(ILifecycleService, this.lifecycleService);
530528

531529
this._register(this.lifecycleService.onWillShutdown(event => this._onWillShutdown.fire(event)));
@@ -753,8 +751,6 @@ export class Workbench extends Disposable implements IPartService {
753751
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).start(this.instantiationService, this.lifecycleService);
754752
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories).setInstantiationService(this.instantiationService);
755753

756-
this.instantiationService.createInstance(DefaultConfigurationExportHelper);
757-
758754
this.configurationService.acquireInstantiationService(this.instantiationService);
759755
}
760756

0 commit comments

Comments
 (0)