prepare for server profiles (#174232)

* prepare for server profiles
- make state service available in server
- Intrdouce save stragey in state service - state shall be saved immediately in server
- use UserDataProfilesService that can save profiles in server

* feedback

* - add tests
- register IStateReadService in main
This commit is contained in:
Sandeep Somavarapu
2023-02-14 08:58:44 +01:00
committed by GitHub
parent af4a70d991
commit 11fcbd051a
27 changed files with 340 additions and 228 deletions
+4 -6
View File
@@ -48,8 +48,7 @@ import product from 'vs/platform/product/common/product';
import { IProductService } from 'vs/platform/product/common/productService';
import { IRequestService } from 'vs/platform/request/common/request';
import { RequestService } from 'vs/platform/request/node/requestService';
import { IStateService } from 'vs/platform/state/node/state';
import { StateService } from 'vs/platform/state/node/stateService';
import { SaveStrategy, StateReadonlyService } from 'vs/platform/state/node/stateService';
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
@@ -59,7 +58,7 @@ import { buildTelemetryMessage } from 'vs/platform/telemetry/node/telemetry';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
import { UserDataProfilesService } from 'vs/platform/userDataProfile/node/userDataProfile';
import { UserDataProfilesReadonlyService } from 'vs/platform/userDataProfile/node/userDataProfile';
import { resolveMachineId } from 'vs/platform/telemetry/node/telemetryUtils';
import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService';
import { LogService } from 'vs/platform/log/common/logService';
@@ -144,15 +143,14 @@ class CliMain extends Disposable {
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
// State
const stateService = new StateService(environmentService, logService, fileService);
services.set(IStateService, stateService);
// Uri Identity
const uriIdentityService = new UriIdentityService(fileService);
services.set(IUriIdentityService, uriIdentityService);
// User Data Profiles
const userDataProfilesService = new UserDataProfilesService(stateService, uriIdentityService, environmentService, fileService, logService);
const stateService = new StateReadonlyService(SaveStrategy.DELAYED, environmentService, logService, fileService);
const userDataProfilesService = new UserDataProfilesReadonlyService(stateService, uriIdentityService, environmentService, fileService, logService);
services.set(IUserDataProfilesService, userDataProfilesService);
// Policy