UNPKG

sussudio

Version:

An unofficial VS Code Internal API

63 lines (62 loc) 3.64 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; import { revive } from "../../../base/common/marshalling.mjs"; import { URI } from "../../../base/common/uri.mjs"; import { INativeEnvironmentService } from "../../environment/common/environment.mjs"; import { IFileService } from "../../files/common/files.mjs"; import { ILogService } from "../../log/common/log.mjs"; import { IStateService } from "../../state/node/state.mjs"; import { IUriIdentityService } from "../../uriIdentity/common/uriIdentity.mjs"; import { UserDataProfilesService as BaseUserDataProfilesService } from "../common/userDataProfile.mjs"; let ServerUserDataProfilesService = class ServerUserDataProfilesService extends BaseUserDataProfilesService { nativeEnvironmentService; constructor(uriIdentityService, nativeEnvironmentService, fileService, logService) { super(nativeEnvironmentService, fileService, uriIdentityService, logService); this.nativeEnvironmentService = nativeEnvironmentService; } getDefaultProfileExtensionsLocation() { return this.uriIdentityService.extUri.joinPath(URI.file(this.nativeEnvironmentService.extensionsPath).with({ scheme: this.profilesHome.scheme }), 'extensions.json'); } }; ServerUserDataProfilesService = __decorate([ __param(0, IUriIdentityService), __param(1, INativeEnvironmentService), __param(2, IFileService), __param(3, ILogService) ], ServerUserDataProfilesService); export { ServerUserDataProfilesService }; let UserDataProfilesService = class UserDataProfilesService extends ServerUserDataProfilesService { stateService; constructor(stateService, uriIdentityService, nativeEnvironmentService, fileService, logService) { super(uriIdentityService, nativeEnvironmentService, fileService, logService); this.stateService = stateService; } getStoredProfiles() { return revive(this.stateService.getItem(UserDataProfilesService.PROFILES_KEY, [])); } getStoredProfileAssociations() { return revive(this.stateService.getItem(UserDataProfilesService.PROFILE_ASSOCIATIONS_KEY, {})); } getDefaultProfileExtensionsLocation() { return this.uriIdentityService.extUri.joinPath(URI.file(this.nativeEnvironmentService.extensionsPath).with({ scheme: this.profilesHome.scheme }), 'extensions.json'); } }; UserDataProfilesService = __decorate([ __param(0, IStateService), __param(1, IUriIdentityService), __param(2, INativeEnvironmentService), __param(3, IFileService), __param(4, ILogService) ], UserDataProfilesService); export { UserDataProfilesService };