Skip to content

Commit 55476af

Browse files
author
Benjamin Pasero
committed
sandbox - make native workbench environment service a real one
1 parent 1b13e16 commit 55476af

35 files changed

Lines changed: 50 additions & 74 deletions

File tree

src/vs/workbench/contrib/codeEditor/electron-browser/startDebugTextMate.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { Constants } from 'vs/base/common/uint';
2121
import { IHostService } from 'vs/workbench/services/host/browser/host';
2222
import { join } from 'vs/base/common/path';
2323
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
24-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2524

2625
class StartDebugTextMate extends Action {
2726

@@ -38,7 +37,7 @@ class StartDebugTextMate extends Action {
3837
@IEditorService private readonly _editorService: IEditorService,
3938
@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,
4039
@IHostService private readonly _hostService: IHostService,
41-
@IWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
40+
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
4241
) {
4342
super(id, label);
4443
}

src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as
77
import { Registry } from 'vs/platform/registry/common/platform';
88
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
99
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
10-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
1110
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
1211
import { DefaultConfigurationExportHelper } from 'vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper';
1312

1413
export class ExtensionPoints implements IWorkbenchContribution {
1514

1615
constructor(
1716
@IInstantiationService instantiationService: IInstantiationService,
18-
@IWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService
17+
@INativeWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService
1918
) {
2019
// Config Exporter
2120
if (environmentService.configuration['export-default-configuration']) {

src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
76
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
87
import { Registry } from 'vs/platform/registry/common/platform';
98
import { IConfigurationNode, IConfigurationRegistry, Extensions, IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';
@@ -33,7 +32,7 @@ interface IConfigurationExport {
3332
export class DefaultConfigurationExportHelper {
3433

3534
constructor(
36-
@IWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService,
35+
@INativeWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService,
3736
@IExtensionService private readonly extensionService: IExtensionService,
3837
@ICommandService private readonly commandService: ICommandService,
3938
@IFileService private readonly fileService: IFileService,

src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { ExtensionHostProfileService } from 'vs/workbench/contrib/extensions/ele
2020
import { RuntimeExtensionsInput } from 'vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsInput';
2121
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
2222
import { ExtensionsAutoProfiler } from 'vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler';
23-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2423
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
2524
import { OpenExtensionsFolderAction } from 'vs/workbench/contrib/extensions/electron-sandbox/extensionsActions';
2625
import { ExtensionsLabel } from 'vs/platform/extensionManagement/common/extensionManagement';
@@ -68,9 +67,9 @@ actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ShowRuntimeExte
6867
class ExtensionsContributions implements IWorkbenchContribution {
6968

7069
constructor(
71-
@IWorkbenchEnvironmentService workbenchEnvironmentService: INativeWorkbenchEnvironmentService
70+
@INativeWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService
7271
) {
73-
if (workbenchEnvironmentService.extensionsPath) {
72+
if (environmentService.extensionsPath) {
7473
const openExtensionsFolderActionDescriptor = SyncActionDescriptor.from(OpenExtensionsFolderAction);
7574
actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel);
7675
}

src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
2222
import { createSlowExtensionAction } from 'vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions';
2323
import { ExtensionHostProfiler } from 'vs/workbench/services/extensions/electron-browser/extensionHostProfiler';
2424
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
25-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2625

2726
export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchContribution {
2827

@@ -37,7 +36,7 @@ export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchCont
3736
@INotificationService private readonly _notificationService: INotificationService,
3837
@IEditorService private readonly _editorService: IEditorService,
3938
@IInstantiationService private readonly _instantiationService: IInstantiationService,
40-
@IWorkbenchEnvironmentService private readonly _environmentServie: INativeWorkbenchEnvironmentService
39+
@INativeWorkbenchEnvironmentService private readonly _environmentServie: INativeWorkbenchEnvironmentService
4140
) {
4241
super();
4342
this._register(_extensionService.onDidChangeResponsiveChange(this._onDidChangeResponsiveChange, this));

src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { localize } from 'vs/nls';
77
import { Action } from 'vs/base/common/actions';
88
import { IFileService } from 'vs/platform/files/common/files';
99
import { URI } from 'vs/base/common/uri';
10-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
1110
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
1211
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
1312
import { Schemas } from 'vs/base/common/network';
@@ -22,7 +21,7 @@ export class OpenExtensionsFolderAction extends Action {
2221
label: string,
2322
@INativeHostService private readonly nativeHostService: INativeHostService,
2423
@IFileService private readonly fileService: IFileService,
25-
@IWorkbenchEnvironmentService private readonly environmentService: INativeWorkbenchEnvironmentService
24+
@INativeWorkbenchEnvironmentService private readonly environmentService: INativeWorkbenchEnvironmentService
2625
) {
2726
super(id, label, undefined, true);
2827
}

src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import Severity from 'vs/base/common/severity';
1919
import { IOpenerService } from 'vs/platform/opener/common/opener';
2020
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
2121
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
22-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2322

2423
abstract class RepoInfo {
2524
abstract get base(): string;
@@ -123,7 +122,7 @@ class ReportExtensionSlowAction extends Action {
123122
@IOpenerService private readonly _openerService: IOpenerService,
124123
@IProductService private readonly _productService: IProductService,
125124
@INativeHostService private readonly _nativeHostService: INativeHostService,
126-
@IWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
125+
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
127126
) {
128127
super('report.slow', localize('cmd.report', "Report Issue"));
129128
}
@@ -167,7 +166,7 @@ class ShowExtensionSlowAction extends Action {
167166
readonly profile: IExtensionHostProfile,
168167
@IDialogService private readonly _dialogService: IDialogService,
169168
@IOpenerService private readonly _openerService: IOpenerService,
170-
@IWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
169+
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
171170
) {
172171
super('show.slow', localize('cmd.show', "Show Issues"));
173172
}

src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { ILabelService, IFormatterChangeEvent } from 'vs/platform/label/common/l
4040
import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService';
4141
import { IProductService } from 'vs/platform/product/common/productService';
4242
import { Schemas } from 'vs/base/common/network';
43-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
4443
import { IProgressService } from 'vs/platform/progress/common/progress';
4544
import { ProgressService } from 'vs/workbench/services/progress/browser/progressService';
4645
import { IStorageKeysSyncRegistryService, StorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
@@ -100,7 +99,7 @@ async function setupTest() {
10099
instantiationService.stub(IExtensionManagementServerService, new class extends ExtensionManagementServerService {
101100
#localExtensionManagementServer: IExtensionManagementServer = { extensionManagementService: instantiationService.get(IExtensionManagementService), label: 'local', id: 'vscode-local' };
102101
constructor() {
103-
super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(ILabelService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IProductService), instantiationService.get(IConfigurationService), instantiationService.get(ILogService), instantiationService.get(IWorkbenchEnvironmentService) as INativeWorkbenchEnvironmentService);
102+
super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(ILabelService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IProductService), instantiationService.get(IConfigurationService), instantiationService.get(ILogService), instantiationService.get(INativeWorkbenchEnvironmentService));
104103
}
105104
get localExtensionManagementServer(): IExtensionManagementServer { return this.#localExtensionManagementServer; }
106105
set localExtensionManagementServer(server: IExtensionManagementServer) { }
@@ -1904,7 +1903,7 @@ suite('RemoteInstallAction', () => {
19041903
// multi server setup
19051904
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
19061905
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]));
1907-
instantiationService.stub(IWorkbenchEnvironmentService, { disableExtensions: true } as IWorkbenchEnvironmentService);
1906+
instantiationService.stub(INativeWorkbenchEnvironmentService, { disableExtensions: true } as INativeWorkbenchEnvironmentService);
19081907
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
19091908
instantiationService.stub(IWorkbenchExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
19101909
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
@@ -2283,7 +2282,7 @@ suite('LocalInstallAction', () => {
22832282
test('Test local install action is disabled for remote ui extension which is disabled in env', async () => {
22842283
// multi server setup
22852284
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
2286-
instantiationService.stub(IWorkbenchEnvironmentService, { disableExtensions: true } as IWorkbenchEnvironmentService);
2285+
instantiationService.stub(INativeWorkbenchEnvironmentService, { disableExtensions: true } as INativeWorkbenchEnvironmentService);
22872286
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension]));
22882287
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
22892288
instantiationService.stub(IWorkbenchExtensionEnablementService, new TestExtensionEnablementService(instantiationService));

src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import { IMenuService } from 'vs/platform/actions/common/actions';
4545
import { TestContextService } from 'vs/workbench/test/common/workbenchTestServices';
4646
import { IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views';
4747
import { IProductService } from 'vs/platform/product/common/productService';
48-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
4948
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
5049

5150
suite('ExtensionsListView Tests', () => {
@@ -106,7 +105,7 @@ suite('ExtensionsListView Tests', () => {
106105
instantiationService.stub(IExtensionManagementServerService, new class extends ExtensionManagementServerService {
107106
#localExtensionManagementServer: IExtensionManagementServer = { extensionManagementService: instantiationService.get(IExtensionManagementService), label: 'local', id: 'vscode-local' };
108107
constructor() {
109-
super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(ILabelService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IProductService), instantiationService.get(IConfigurationService), instantiationService.get(ILogService), instantiationService.get(IWorkbenchEnvironmentService) as INativeWorkbenchEnvironmentService);
108+
super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(ILabelService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IProductService), instantiationService.get(IConfigurationService), instantiationService.get(ILogService), instantiationService.get(INativeWorkbenchEnvironmentService));
110109
}
111110
get localExtensionManagementServer(): IExtensionManagementServer { return this.#localExtensionManagementServer; }
112111
set localExtensionManagementServer(server: IExtensionManagementServer) { }

src/vs/workbench/contrib/issue/electron-sandbox/issueService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { IExtensionManagementService } from 'vs/platform/extensionManagement/com
1212
import { IWorkbenchExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
1313
import { getZoomLevel } from 'vs/base/browser/browser';
1414
import { IWorkbenchIssueService } from 'vs/workbench/contrib/issue/electron-sandbox/issue';
15-
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
1615
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
1716
import { ExtensionType } from 'vs/platform/extensions/common/extensions';
1817
import { platform, PlatformToString } from 'vs/base/common/platform';
@@ -26,7 +25,7 @@ export class WorkbenchIssueService implements IWorkbenchIssueService {
2625
@IThemeService private readonly themeService: IThemeService,
2726
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
2827
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService,
29-
@IWorkbenchEnvironmentService private readonly environmentService: INativeWorkbenchEnvironmentService,
28+
@INativeWorkbenchEnvironmentService private readonly environmentService: INativeWorkbenchEnvironmentService,
3029
@IProductService private readonly productService: IProductService
3130
) { }
3231

0 commit comments

Comments
 (0)