@codingame/monaco-vscode-user-data-profile-service-override 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +31 -0
- package/userDataProfile.js +118 -0
- package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +95 -0
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +84 -0
- package/vscode/src/vs/platform/userDataSync/common/extensionsMerge.js +331 -0
- package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +545 -0
- package/vscode/src/vs/platform/userDataSync/common/globalStateMerge.js +102 -0
- package/vscode/src/vs/platform/userDataSync/common/globalStateSync.js +431 -0
- package/vscode/src/vs/platform/userDataSync/common/keybindingsMerge.js +277 -0
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +328 -0
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +322 -0
- package/vscode/src/vs/platform/userDataSync/common/snippetsMerge.js +126 -0
- package/vscode/src/vs/platform/userDataSync/common/snippetsSync.js +478 -0
- package/vscode/src/vs/platform/userDataSync/common/tasksSync.js +245 -0
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.js +9 -0
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +495 -0
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +159 -0
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilePreview.js +24 -0
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +62 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +328 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +144 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +119 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/media/userDataProfileView.css.js +6 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +140 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +155 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +118 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +1453 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +151 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +180 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +39 -0
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +448 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
3
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
4
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
5
|
+
import { Barrier, Promises } from 'vscode/vscode/vs/base/common/async';
|
|
6
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
7
|
+
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
8
|
+
import { SettingsResourceInitializer } from './settingsResource.js';
|
|
9
|
+
import { GlobalStateResourceInitializer } from './globalStateResource.js';
|
|
10
|
+
import { KeybindingsResourceInitializer } from './keybindingsResource.js';
|
|
11
|
+
import { TasksResourceInitializer } from './tasksResource.js';
|
|
12
|
+
import { SnippetsResourceInitializer } from './snippetsResource.js';
|
|
13
|
+
import { ExtensionsResourceInitializer } from './extensionsResource.js';
|
|
14
|
+
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
15
|
+
import { isString } from 'vscode/vscode/vs/base/common/types';
|
|
16
|
+
import { asJson } from 'vscode/vscode/vs/platform/request/common/request';
|
|
17
|
+
import { IRequestService } from 'vscode/vscode/vs/platform/request/common/request.service';
|
|
18
|
+
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
19
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
20
|
+
|
|
21
|
+
let UserDataProfileInitializer = class UserDataProfileInitializer {
|
|
22
|
+
constructor(environmentService, fileService, userDataProfileService, storageService, logService, uriIdentityService, requestService) {
|
|
23
|
+
this.environmentService = environmentService;
|
|
24
|
+
this.fileService = fileService;
|
|
25
|
+
this.userDataProfileService = userDataProfileService;
|
|
26
|
+
this.storageService = storageService;
|
|
27
|
+
this.logService = logService;
|
|
28
|
+
this.uriIdentityService = uriIdentityService;
|
|
29
|
+
this.requestService = requestService;
|
|
30
|
+
this.initialized = [];
|
|
31
|
+
this.initializationFinished = ( new Barrier());
|
|
32
|
+
}
|
|
33
|
+
async whenInitializationFinished() {
|
|
34
|
+
await this.initializationFinished.wait();
|
|
35
|
+
}
|
|
36
|
+
async requiresInitialization() {
|
|
37
|
+
if (!this.environmentService.options?.profile?.contents) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (!this.storageService.isNew(0 )) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
async initializeRequiredResources() {
|
|
46
|
+
this.logService.trace(`UserDataProfileInitializer#initializeRequiredResources`);
|
|
47
|
+
const promises = [];
|
|
48
|
+
const profileTemplate = await this.getProfileTemplate();
|
|
49
|
+
if (profileTemplate?.settings) {
|
|
50
|
+
promises.push(this.initialize(( new SettingsResourceInitializer(this.userDataProfileService, this.fileService, this.logService)), profileTemplate.settings, "settings" ));
|
|
51
|
+
}
|
|
52
|
+
if (profileTemplate?.globalState) {
|
|
53
|
+
promises.push(this.initialize(( new GlobalStateResourceInitializer(this.storageService)), profileTemplate.globalState, "globalState" ));
|
|
54
|
+
}
|
|
55
|
+
await Promise.all(promises);
|
|
56
|
+
}
|
|
57
|
+
async initializeOtherResources(instantiationService) {
|
|
58
|
+
try {
|
|
59
|
+
this.logService.trace(`UserDataProfileInitializer#initializeOtherResources`);
|
|
60
|
+
const promises = [];
|
|
61
|
+
const profileTemplate = await this.getProfileTemplate();
|
|
62
|
+
if (profileTemplate?.keybindings) {
|
|
63
|
+
promises.push(this.initialize(( new KeybindingsResourceInitializer(this.userDataProfileService, this.fileService, this.logService)), profileTemplate.keybindings, "keybindings" ));
|
|
64
|
+
}
|
|
65
|
+
if (profileTemplate?.tasks) {
|
|
66
|
+
promises.push(this.initialize(( new TasksResourceInitializer(this.userDataProfileService, this.fileService, this.logService)), profileTemplate.tasks, "tasks" ));
|
|
67
|
+
}
|
|
68
|
+
if (profileTemplate?.snippets) {
|
|
69
|
+
promises.push(this.initialize(( new SnippetsResourceInitializer(this.userDataProfileService, this.fileService, this.uriIdentityService)), profileTemplate.snippets, "snippets" ));
|
|
70
|
+
}
|
|
71
|
+
promises.push(this.initializeInstalledExtensions(instantiationService));
|
|
72
|
+
await Promises.settled(promises);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
this.initializationFinished.open();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async initializeInstalledExtensions(instantiationService) {
|
|
79
|
+
if (!this.initializeInstalledExtensionsPromise) {
|
|
80
|
+
const profileTemplate = await this.getProfileTemplate();
|
|
81
|
+
if (profileTemplate?.extensions) {
|
|
82
|
+
this.initializeInstalledExtensionsPromise = this.initialize(instantiationService.createInstance(ExtensionsResourceInitializer), profileTemplate.extensions, "extensions" );
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.initializeInstalledExtensionsPromise = Promise.resolve();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return this.initializeInstalledExtensionsPromise;
|
|
89
|
+
}
|
|
90
|
+
getProfileTemplate() {
|
|
91
|
+
if (!this.profileTemplatePromise) {
|
|
92
|
+
this.profileTemplatePromise = this.doGetProfileTemplate();
|
|
93
|
+
}
|
|
94
|
+
return this.profileTemplatePromise;
|
|
95
|
+
}
|
|
96
|
+
async doGetProfileTemplate() {
|
|
97
|
+
if (!this.environmentService.options?.profile?.contents) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
if (isString(this.environmentService.options.profile.contents)) {
|
|
101
|
+
try {
|
|
102
|
+
return JSON.parse(this.environmentService.options.profile.contents);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
this.logService.error(error);
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
const url = ( URI.revive(this.environmentService.options.profile.contents).toString(true));
|
|
111
|
+
const context = await this.requestService.request({ type: 'GET', url }, CancellationToken.None);
|
|
112
|
+
if (context.res.statusCode === 200) {
|
|
113
|
+
return await asJson(context);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.logService.warn(`UserDataProfileInitializer: Failed to get profile from URL: ${url}. Status code: ${context.res.statusCode}.`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
this.logService.error(error);
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
async initialize(initializer, content, profileResource) {
|
|
125
|
+
try {
|
|
126
|
+
if (this.initialized.includes(profileResource)) {
|
|
127
|
+
this.logService.info(`UserDataProfileInitializer: ${profileResource} initialized already.`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.initialized.push(profileResource);
|
|
131
|
+
this.logService.trace(`UserDataProfileInitializer: Initializing ${profileResource}`);
|
|
132
|
+
await initializer.initialize(content);
|
|
133
|
+
this.logService.info(`UserDataProfileInitializer: Initialized ${profileResource}`);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
this.logService.info(`UserDataProfileInitializer: Error while initializing ${profileResource}`);
|
|
137
|
+
this.logService.error(error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
UserDataProfileInitializer = ( __decorate([
|
|
142
|
+
( __param(0, IBrowserWorkbenchEnvironmentService)),
|
|
143
|
+
( __param(1, IFileService)),
|
|
144
|
+
( __param(2, IUserDataProfileService)),
|
|
145
|
+
( __param(3, IStorageService)),
|
|
146
|
+
( __param(4, ILogService)),
|
|
147
|
+
( __param(5, IUriIdentityService)),
|
|
148
|
+
( __param(6, IRequestService))
|
|
149
|
+
], UserDataProfileInitializer));
|
|
150
|
+
|
|
151
|
+
export { UserDataProfileInitializer };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
|
+
import { CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
4
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { equals } from 'vscode/vscode/vs/base/common/objects';
|
|
6
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
7
|
+
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
8
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
9
|
+
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
10
|
+
import { asJson } from 'vscode/vscode/vs/platform/request/common/request';
|
|
11
|
+
import { IRequestService } from 'vscode/vscode/vs/platform/request/common/request.service';
|
|
12
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
13
|
+
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
14
|
+
import { toWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
15
|
+
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
16
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
17
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
19
|
+
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
20
|
+
|
|
21
|
+
const _moduleId = "vs/workbench/services/userDataProfile/browser/userDataProfileManagement";
|
|
22
|
+
let UserDataProfileManagementService = class UserDataProfileManagementService extends Disposable {
|
|
23
|
+
constructor(userDataProfilesService, userDataProfileService, hostService, dialogService, workspaceContextService, extensionService, environmentService, telemetryService, productService, requestService, logService) {
|
|
24
|
+
super();
|
|
25
|
+
this.userDataProfilesService = userDataProfilesService;
|
|
26
|
+
this.userDataProfileService = userDataProfileService;
|
|
27
|
+
this.hostService = hostService;
|
|
28
|
+
this.dialogService = dialogService;
|
|
29
|
+
this.workspaceContextService = workspaceContextService;
|
|
30
|
+
this.extensionService = extensionService;
|
|
31
|
+
this.environmentService = environmentService;
|
|
32
|
+
this.telemetryService = telemetryService;
|
|
33
|
+
this.productService = productService;
|
|
34
|
+
this.requestService = requestService;
|
|
35
|
+
this.logService = logService;
|
|
36
|
+
this._register(userDataProfilesService.onDidChangeProfiles(e => this.onDidChangeProfiles(e)));
|
|
37
|
+
this._register(userDataProfilesService.onDidResetWorkspaces(() => this.onDidResetWorkspaces()));
|
|
38
|
+
this._register(userDataProfileService.onDidChangeCurrentProfile(e => this.onDidChangeCurrentProfile(e)));
|
|
39
|
+
this._register(userDataProfilesService.onDidChangeProfiles(e => {
|
|
40
|
+
const updatedCurrentProfile = e.updated.find(p => this.userDataProfileService.currentProfile.id === p.id);
|
|
41
|
+
if (updatedCurrentProfile) {
|
|
42
|
+
this.changeCurrentProfile(updatedCurrentProfile, ( localizeWithPath(
|
|
43
|
+
_moduleId,
|
|
44
|
+
0,
|
|
45
|
+
"The current profile has been updated. Please reload to switch back to the updated profile"
|
|
46
|
+
)));
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
onDidChangeProfiles(e) {
|
|
51
|
+
if (( (e.removed.some(profile => profile.id === this.userDataProfileService.currentProfile.id)))) {
|
|
52
|
+
this.changeCurrentProfile(this.userDataProfilesService.defaultProfile, ( localizeWithPath(
|
|
53
|
+
_moduleId,
|
|
54
|
+
1,
|
|
55
|
+
"The current profile has been removed. Please reload to switch back to default profile"
|
|
56
|
+
)));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
onDidResetWorkspaces() {
|
|
61
|
+
if (!this.userDataProfileService.currentProfile.isDefault) {
|
|
62
|
+
this.changeCurrentProfile(this.userDataProfilesService.defaultProfile, ( localizeWithPath(
|
|
63
|
+
_moduleId,
|
|
64
|
+
1,
|
|
65
|
+
"The current profile has been removed. Please reload to switch back to default profile"
|
|
66
|
+
)));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async onDidChangeCurrentProfile(e) {
|
|
71
|
+
if (e.previous.isTransient) {
|
|
72
|
+
await this.userDataProfilesService.cleanUpTransientProfiles();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async createAndEnterProfile(name, options) {
|
|
76
|
+
const profile = await this.userDataProfilesService.createNamedProfile(name, options, toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()));
|
|
77
|
+
await this.changeCurrentProfile(profile);
|
|
78
|
+
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'createAndEnterProfile' });
|
|
79
|
+
return profile;
|
|
80
|
+
}
|
|
81
|
+
async createAndEnterTransientProfile() {
|
|
82
|
+
const profile = await this.userDataProfilesService.createTransientProfile(toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()));
|
|
83
|
+
await this.changeCurrentProfile(profile);
|
|
84
|
+
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'createAndEnterTransientProfile' });
|
|
85
|
+
return profile;
|
|
86
|
+
}
|
|
87
|
+
async updateProfile(profile, updateOptions) {
|
|
88
|
+
if (!( (this.userDataProfilesService.profiles.some(p => p.id === profile.id)))) {
|
|
89
|
+
throw ( (new Error(`Profile ${profile.name} does not exist`)));
|
|
90
|
+
}
|
|
91
|
+
if (profile.isDefault) {
|
|
92
|
+
throw ( (new Error(localizeWithPath(_moduleId, 2, "Cannot rename the default profile"))));
|
|
93
|
+
}
|
|
94
|
+
await this.userDataProfilesService.updateProfile(profile, updateOptions);
|
|
95
|
+
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'updateProfile' });
|
|
96
|
+
}
|
|
97
|
+
async removeProfile(profile) {
|
|
98
|
+
if (!( (this.userDataProfilesService.profiles.some(p => p.id === profile.id)))) {
|
|
99
|
+
throw ( (new Error(`Profile ${profile.name} does not exist`)));
|
|
100
|
+
}
|
|
101
|
+
if (profile.isDefault) {
|
|
102
|
+
throw ( (new Error(localizeWithPath(_moduleId, 3, "Cannot delete the default profile"))));
|
|
103
|
+
}
|
|
104
|
+
await this.userDataProfilesService.removeProfile(profile);
|
|
105
|
+
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'removeProfile' });
|
|
106
|
+
}
|
|
107
|
+
async switchProfile(profile) {
|
|
108
|
+
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
109
|
+
if (!( (this.userDataProfilesService.profiles.some(p => p.id === profile.id)))) {
|
|
110
|
+
throw ( (new Error(`Profile ${profile.name} does not exist`)));
|
|
111
|
+
}
|
|
112
|
+
if (this.userDataProfileService.currentProfile.id === profile.id) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
await this.userDataProfilesService.setProfileForWorkspace(workspaceIdentifier, profile);
|
|
116
|
+
await this.changeCurrentProfile(profile);
|
|
117
|
+
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'switchProfile' });
|
|
118
|
+
}
|
|
119
|
+
async getBuiltinProfileTemplates() {
|
|
120
|
+
if (this.productService.profileTemplatesUrl) {
|
|
121
|
+
try {
|
|
122
|
+
const context = await this.requestService.request({ type: 'GET', url: this.productService.profileTemplatesUrl }, CancellationToken.None);
|
|
123
|
+
if (context.res.statusCode === 200) {
|
|
124
|
+
return (await asJson(context)) || [];
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.logService.error('Could not get profile templates.', context.res.statusCode);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
this.logService.error(error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
136
|
+
async changeCurrentProfile(profile, reloadMessage) {
|
|
137
|
+
const isRemoteWindow = !!this.environmentService.remoteAuthority;
|
|
138
|
+
const shouldRestartExtensionHosts = this.userDataProfileService.currentProfile.id !== profile.id || !equals(this.userDataProfileService.currentProfile.useDefaultFlags, profile.useDefaultFlags);
|
|
139
|
+
if (shouldRestartExtensionHosts) {
|
|
140
|
+
if (!isRemoteWindow) {
|
|
141
|
+
if (!(await this.extensionService.stopExtensionHosts(( localizeWithPath(_moduleId, 4, "Switching to a profile."))))) {
|
|
142
|
+
if (( (this.userDataProfilesService.profiles.some(p => p.id === this.userDataProfileService.currentProfile.id)))) {
|
|
143
|
+
await this.userDataProfilesService.setProfileForWorkspace(toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()), this.userDataProfileService.currentProfile);
|
|
144
|
+
}
|
|
145
|
+
throw ( (new CancellationError()));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
await this.userDataProfileService.updateCurrentProfile(profile);
|
|
150
|
+
if (shouldRestartExtensionHosts) {
|
|
151
|
+
if (isRemoteWindow) {
|
|
152
|
+
const { confirmed } = await this.dialogService.confirm({
|
|
153
|
+
message: reloadMessage ?? ( localizeWithPath(_moduleId, 5, "Switching a profile requires reloading VS Code.")),
|
|
154
|
+
primaryButton: ( localizeWithPath(_moduleId, 6, "&&Reload")),
|
|
155
|
+
});
|
|
156
|
+
if (confirmed) {
|
|
157
|
+
await this.hostService.reload();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
await this.extensionService.startExtensionHosts();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
UserDataProfileManagementService = ( (__decorate([
|
|
167
|
+
( (__param(0, IUserDataProfilesService))),
|
|
168
|
+
( (__param(1, IUserDataProfileService))),
|
|
169
|
+
( (__param(2, IHostService))),
|
|
170
|
+
( (__param(3, IDialogService))),
|
|
171
|
+
( (__param(4, IWorkspaceContextService))),
|
|
172
|
+
( (__param(5, IExtensionService))),
|
|
173
|
+
( (__param(6, IWorkbenchEnvironmentService))),
|
|
174
|
+
( (__param(7, ITelemetryService))),
|
|
175
|
+
( (__param(8, IProductService))),
|
|
176
|
+
( (__param(9, IRequestService))),
|
|
177
|
+
( (__param(10, ILogService)))
|
|
178
|
+
], UserDataProfileManagementService)));
|
|
179
|
+
|
|
180
|
+
export { UserDataProfileManagementService };
|
package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
4
|
+
import { AbstractUserDataProfileStorageService } from '../../../../platform/userDataProfile/common/userDataProfileStorageService.js';
|
|
5
|
+
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
+
import { isProfileUsingDefaultStorage } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
7
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
8
|
+
import { IndexedDBStorageDatabase } from 'vscode/vscode/vs/workbench/services/storage/browser/storageService';
|
|
9
|
+
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
10
|
+
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
+
|
|
12
|
+
let UserDataProfileStorageService = class UserDataProfileStorageService extends AbstractUserDataProfileStorageService {
|
|
13
|
+
constructor(storageService, userDataProfileService, logService) {
|
|
14
|
+
super(storageService);
|
|
15
|
+
this.userDataProfileService = userDataProfileService;
|
|
16
|
+
this.logService = logService;
|
|
17
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
18
|
+
this.onDidChange = this._onDidChange.event;
|
|
19
|
+
const disposables = this._register(( new DisposableStore()));
|
|
20
|
+
this._register(Event.filter(storageService.onDidChangeTarget, e => e.scope === 0 , disposables)(() => this.onDidChangeStorageTargetInCurrentProfile()));
|
|
21
|
+
this._register(storageService.onDidChangeValue(0 , undefined, disposables)(e => this.onDidChangeStorageValueInCurrentProfile(e)));
|
|
22
|
+
}
|
|
23
|
+
onDidChangeStorageTargetInCurrentProfile() {
|
|
24
|
+
this._onDidChange.fire({ targetChanges: [this.userDataProfileService.currentProfile], valueChanges: [] });
|
|
25
|
+
}
|
|
26
|
+
onDidChangeStorageValueInCurrentProfile(e) {
|
|
27
|
+
this._onDidChange.fire({ targetChanges: [], valueChanges: [{ profile: this.userDataProfileService.currentProfile, changes: [e] }] });
|
|
28
|
+
}
|
|
29
|
+
createStorageDatabase(profile) {
|
|
30
|
+
return isProfileUsingDefaultStorage(profile) ? IndexedDBStorageDatabase.createApplicationStorage(this.logService) : IndexedDBStorageDatabase.createProfileStorage(profile, this.logService);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
UserDataProfileStorageService = ( __decorate([
|
|
34
|
+
( __param(0, IStorageService)),
|
|
35
|
+
( __param(1, IUserDataProfileService)),
|
|
36
|
+
( __param(2, ILogService))
|
|
37
|
+
], UserDataProfileStorageService));
|
|
38
|
+
|
|
39
|
+
export { UserDataProfileStorageService };
|