@codingame/monaco-vscode-user-data-profile-service-override 9.0.3 → 10.0.1
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/_virtual/semver.js +5 -0
- package/package.json +2 -2
- package/userDataProfile.js +10 -5
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +10 -8
- package/vscode/src/vs/platform/userDataSync/common/extensionsMerge.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +20 -20
- package/vscode/src/vs/platform/userDataSync/common/globalStateSync.js +25 -26
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +27 -28
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +21 -24
- package/vscode/src/vs/platform/userDataSync/common/snippetsSync.js +40 -40
- package/vscode/src/vs/platform/userDataSync/common/tasksSync.js +14 -14
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +26 -24
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +577 -138
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +242 -103
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +1 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +11 -11
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +9 -11
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +5 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +7 -8
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +5 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +5 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +44 -46
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +7 -9
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +75 -34
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +3 -4
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +13 -15
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-user-data-profile-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/userDataProfile.js
CHANGED
|
@@ -78,23 +78,28 @@ InjectedUserDataInitializationService = __decorate([
|
|
|
78
78
|
], InjectedUserDataInitializationService);
|
|
79
79
|
function getCurrentProfile(workspace, userDataProfilesService, environmentService) {
|
|
80
80
|
if (environmentService.options?.profile != null) {
|
|
81
|
-
const profile = userDataProfilesService.profiles.find(p => p.name === environmentService.options?.profile?.name);
|
|
81
|
+
const profile = userDataProfilesService.profiles.find((p) => p.name === environmentService.options?.profile?.name);
|
|
82
82
|
if (profile != null) {
|
|
83
83
|
return profile;
|
|
84
84
|
}
|
|
85
85
|
return userDataProfilesService.defaultProfile;
|
|
86
86
|
}
|
|
87
|
-
return userDataProfilesService.getProfileForWorkspace(workspace) ??
|
|
87
|
+
return (userDataProfilesService.getProfileForWorkspace(workspace) ??
|
|
88
|
+
userDataProfilesService.defaultProfile);
|
|
88
89
|
}
|
|
89
90
|
let InjectedUserDataProfileService = class InjectedUserDataProfileService extends UserDataProfileService {
|
|
90
91
|
constructor(environmentService, userDataProfilesService, logService) {
|
|
91
92
|
const workspace = getWorkspaceIdentifier();
|
|
92
93
|
const profile = getCurrentProfile(workspace, userDataProfilesService, environmentService);
|
|
93
94
|
super(profile);
|
|
94
|
-
if (profile === userDataProfilesService.defaultProfile &&
|
|
95
|
-
|
|
95
|
+
if (profile === userDataProfilesService.defaultProfile &&
|
|
96
|
+
environmentService.options?.profile != null) {
|
|
97
|
+
userDataProfilesService
|
|
98
|
+
.createNamedProfile(environmentService.options.profile.name, undefined, workspace)
|
|
99
|
+
.then(async (profile) => {
|
|
96
100
|
await this.updateCurrentProfile(profile);
|
|
97
|
-
})
|
|
101
|
+
})
|
|
102
|
+
.catch((err) => {
|
|
98
103
|
logService.error(err);
|
|
99
104
|
});
|
|
100
105
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable, DisposableMap, toDisposable, isDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { Storage } from 'vscode/vscode/vs/base/parts/storage/common/storage';
|
|
4
|
-
import {
|
|
4
|
+
import { AbstractStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
5
5
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
6
6
|
import 'vscode/vscode/vs/base/common/event';
|
|
7
7
|
import 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
@@ -55,16 +55,18 @@ let AbstractUserDataProfileStorageService = class AbstractUserDataProfileStorage
|
|
|
55
55
|
getItems(storageService) {
|
|
56
56
|
const result = ( new Map());
|
|
57
57
|
const populate = (target) => {
|
|
58
|
-
for (const key of ( storageService.keys(
|
|
59
|
-
result.set(key, { value: storageService.get(key,
|
|
58
|
+
for (const key of ( storageService.keys(0, target))) {
|
|
59
|
+
result.set(key, { value: storageService.get(key, 0 ), target });
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
populate(
|
|
63
|
-
populate(
|
|
62
|
+
populate(0 );
|
|
63
|
+
populate(1 );
|
|
64
64
|
return result;
|
|
65
65
|
}
|
|
66
66
|
writeItems(storageService, items, target) {
|
|
67
|
-
storageService.storeAll(( Array.from(items.entries()).map(
|
|
67
|
+
storageService.storeAll(( Array.from(items.entries()).map(
|
|
68
|
+
([key, value]) => ({ key, value, scope: 0 , target })
|
|
69
|
+
)), true);
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
72
|
AbstractUserDataProfileStorageService = ( __decorate([
|
|
@@ -79,7 +81,7 @@ class StorageService extends AbstractStorageService {
|
|
|
79
81
|
const profileStorageDatabase = await this.profileStorageDatabase;
|
|
80
82
|
const profileStorage = ( new Storage(profileStorageDatabase));
|
|
81
83
|
this._register(profileStorage.onDidChangeStorage(e => {
|
|
82
|
-
this.emitDidChangeValue(
|
|
84
|
+
this.emitDidChangeValue(0 , e);
|
|
83
85
|
}));
|
|
84
86
|
this._register(toDisposable(() => {
|
|
85
87
|
profileStorage.close();
|
|
@@ -92,7 +94,7 @@ class StorageService extends AbstractStorageService {
|
|
|
92
94
|
return this.profileStorage.init();
|
|
93
95
|
}
|
|
94
96
|
getStorage(scope) {
|
|
95
|
-
return scope ===
|
|
97
|
+
return scope === 0 ? this.profileStorage : undefined;
|
|
96
98
|
}
|
|
97
99
|
getLogDetails() { return undefined; }
|
|
98
100
|
async switchToProfile() { }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deepClone, equals } from 'vscode/vscode/vs/base/common/objects';
|
|
2
|
-
import { semverExports } from '
|
|
2
|
+
import { semverExports } from '../../../../../../_virtual/semver.js';
|
|
3
3
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
4
4
|
|
|
5
5
|
function merge(localExtensions, remoteExtensions, lastSyncExtensions, skippedExtensions, ignoredExtensions, lastSyncBuiltinExtensions) {
|
|
@@ -9,12 +9,12 @@ import { compare } from 'vscode/vscode/vs/base/common/strings';
|
|
|
9
9
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
10
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
11
11
|
import { GlobalExtensionEnablementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionEnablementService';
|
|
12
|
-
import { DISABLED_EXTENSIONS_STORAGE_PATH, EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT, EXTENSION_INSTALL_SOURCE_CONTEXT,
|
|
12
|
+
import { DISABLED_EXTENSIONS_STORAGE_PATH, EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT, EXTENSION_INSTALL_SOURCE_CONTEXT, ExtensionManagementError } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
13
13
|
import { IExtensionManagementService, IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
14
14
|
import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
15
15
|
import { ExtensionStorageService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionStorage';
|
|
16
16
|
import { IExtensionStorageService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionStorage.service';
|
|
17
|
-
import {
|
|
17
|
+
import { isApplicationScopedExtension } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
18
18
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
19
19
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
20
20
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
@@ -26,7 +26,7 @@ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProf
|
|
|
26
26
|
import { AbstractSynchroniser, getSyncResourceLogLabel, AbstractInitializer } from 'vscode/vscode/vs/platform/userDataSync/common/abstractSynchronizer';
|
|
27
27
|
import { merge } from './extensionsMerge.js';
|
|
28
28
|
import { IIgnoredExtensionsManagementService } from 'vscode/vscode/vs/platform/userDataSync/common/ignoredExtensions.service';
|
|
29
|
-
import {
|
|
29
|
+
import { USER_DATA_SYNC_SCHEME } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
30
30
|
import { IUserDataSyncStoreService, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
31
31
|
import { IUserDataProfileStorageService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfileStorageService.service';
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ async function parseAndMigrateExtensions(syncData, extensionManagementService) {
|
|
|
34
34
|
const extensions = JSON.parse(syncData.content);
|
|
35
35
|
if (syncData.version === 1
|
|
36
36
|
|| syncData.version === 2) {
|
|
37
|
-
const builtinExtensions = (await extensionManagementService.getInstalled(
|
|
37
|
+
const builtinExtensions = (await extensionManagementService.getInstalled(0 )).filter(e => e.isBuiltin);
|
|
38
38
|
for (const extension of extensions) {
|
|
39
39
|
if (syncData.version === 1) {
|
|
40
40
|
if (extension.enabled === false) {
|
|
@@ -69,7 +69,7 @@ function stringify(extensions, format) {
|
|
|
69
69
|
let ExtensionsSynchroniser = class ExtensionsSynchroniser extends AbstractSynchroniser {
|
|
70
70
|
constructor(
|
|
71
71
|
profile, collection, environmentService, fileService, storageService, userDataSyncStoreService, userDataSyncLocalStoreService, extensionManagementService, ignoredExtensionsManagementService, logService, configurationService, userDataSyncEnablementService, telemetryService, extensionStorageService, uriIdentityService, userDataProfileStorageService, instantiationService) {
|
|
72
|
-
super({ syncResource:
|
|
72
|
+
super({ syncResource: "extensions" , profile }, collection, fileService, environmentService, storageService, userDataSyncStoreService, userDataSyncLocalStoreService, userDataSyncEnablementService, telemetryService, logService, configurationService, uriIdentityService);
|
|
73
73
|
this.extensionManagementService = extensionManagementService;
|
|
74
74
|
this.ignoredExtensionsManagementService = ignoredExtensionsManagementService;
|
|
75
75
|
this.instantiationService = instantiationService;
|
|
@@ -100,8 +100,8 @@ let ExtensionsSynchroniser = class ExtensionsSynchroniser extends AbstractSynchr
|
|
|
100
100
|
const previewResult = {
|
|
101
101
|
local, remote,
|
|
102
102
|
content: this.getPreviewContent(localExtensions, local.added, local.updated, local.removed),
|
|
103
|
-
localChange: local.added.length > 0 || local.removed.length > 0 || local.updated.length > 0 ?
|
|
104
|
-
remoteChange: remote !== null ?
|
|
103
|
+
localChange: local.added.length > 0 || local.removed.length > 0 || local.updated.length > 0 ? 2 : 0 ,
|
|
104
|
+
remoteChange: remote !== null ? 2 : 0 ,
|
|
105
105
|
};
|
|
106
106
|
const localContent = this.stringify(localExtensions, false);
|
|
107
107
|
return [{
|
|
@@ -171,8 +171,8 @@ let ExtensionsSynchroniser = class ExtensionsSynchroniser extends AbstractSynchr
|
|
|
171
171
|
content: resourcePreview.localContent,
|
|
172
172
|
local,
|
|
173
173
|
remote,
|
|
174
|
-
localChange: local.added.length > 0 || local.removed.length > 0 || local.updated.length > 0 ?
|
|
175
|
-
remoteChange: remote !== null ?
|
|
174
|
+
localChange: local.added.length > 0 || local.removed.length > 0 || local.updated.length > 0 ? 2 : 0 ,
|
|
175
|
+
remoteChange: remote !== null ? 2 : 0 ,
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
async acceptRemote(resourcePreview) {
|
|
@@ -186,8 +186,8 @@ let ExtensionsSynchroniser = class ExtensionsSynchroniser extends AbstractSynchr
|
|
|
186
186
|
content: resourcePreview.remoteContent,
|
|
187
187
|
local,
|
|
188
188
|
remote,
|
|
189
|
-
localChange: local.added.length > 0 || local.removed.length > 0 || local.updated.length > 0 ?
|
|
190
|
-
remoteChange: remote !== null ?
|
|
189
|
+
localChange: local.added.length > 0 || local.removed.length > 0 || local.updated.length > 0 ? 2 : 0 ,
|
|
190
|
+
remoteChange: remote !== null ? 2 : 0 ,
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
else {
|
|
@@ -195,18 +195,18 @@ let ExtensionsSynchroniser = class ExtensionsSynchroniser extends AbstractSynchr
|
|
|
195
195
|
content: resourcePreview.remoteContent,
|
|
196
196
|
local: { added: [], removed: [], updated: [] },
|
|
197
197
|
remote: null,
|
|
198
|
-
localChange:
|
|
199
|
-
remoteChange:
|
|
198
|
+
localChange: 0 ,
|
|
199
|
+
remoteChange: 0 ,
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
async applyResult(remoteUserData, lastSyncUserData, resourcePreviews, force) {
|
|
204
204
|
let { skippedExtensions, builtinExtensions, localExtensions } = resourcePreviews[0][0];
|
|
205
205
|
const { local, remote, localChange, remoteChange } = resourcePreviews[0][1];
|
|
206
|
-
if (localChange ===
|
|
206
|
+
if (localChange === 0 && remoteChange === 0 ) {
|
|
207
207
|
this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing extensions.`);
|
|
208
208
|
}
|
|
209
|
-
if (localChange !==
|
|
209
|
+
if (localChange !== 0 ) {
|
|
210
210
|
await this.backupLocal(JSON.stringify(localExtensions));
|
|
211
211
|
skippedExtensions = await this.localExtensionsProvider.updateLocalExtensions(local.added, local.removed, local.updated, skippedExtensions, this.syncResource.profile);
|
|
212
212
|
}
|
|
@@ -323,7 +323,7 @@ let LocalExtensionsProvider = class LocalExtensionsProvider {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
catch (error) {
|
|
326
|
-
this.logService.info(`${getSyncResourceLogLabel(
|
|
326
|
+
this.logService.info(`${getSyncResourceLogLabel("extensions" , profile)}: Error while parsing extension state`, getErrorMessage(error));
|
|
327
327
|
}
|
|
328
328
|
return syncExntesion;
|
|
329
329
|
}));
|
|
@@ -331,7 +331,7 @@ let LocalExtensionsProvider = class LocalExtensionsProvider {
|
|
|
331
331
|
return { localExtensions, ignoredExtensions };
|
|
332
332
|
}
|
|
333
333
|
async updateLocalExtensions(added, removed, updated, skippedExtensions, profile) {
|
|
334
|
-
const syncResourceLogLabel = getSyncResourceLogLabel(
|
|
334
|
+
const syncResourceLogLabel = getSyncResourceLogLabel("extensions" , profile);
|
|
335
335
|
const extensionsToInstall = [];
|
|
336
336
|
const syncExtensionsToInstall = ( new Map());
|
|
337
337
|
const removeFromSkipped = [];
|
|
@@ -397,7 +397,7 @@ let LocalExtensionsProvider = class LocalExtensionsProvider {
|
|
|
397
397
|
installPreReleaseVersion: e.preRelease,
|
|
398
398
|
profileLocation: profile.extensionsResource,
|
|
399
399
|
isApplicationScoped: e.isApplicationScoped,
|
|
400
|
-
context: { [EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT]: true, [EXTENSION_INSTALL_SOURCE_CONTEXT]:
|
|
400
|
+
context: { [EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT]: true, [EXTENSION_INSTALL_SOURCE_CONTEXT]: "settingsSync" }
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
syncExtensionsToInstall.set(extension.identifier.id.toLowerCase(), e);
|
|
@@ -443,7 +443,7 @@ let LocalExtensionsProvider = class LocalExtensionsProvider {
|
|
|
443
443
|
addToSkipped.push(e);
|
|
444
444
|
this.logService.info(`${syncResourceLogLabel}: Skipped synchronizing extension`, gallery.displayName || gallery.identifier.id);
|
|
445
445
|
}
|
|
446
|
-
if (error instanceof ExtensionManagementError && [
|
|
446
|
+
if (error instanceof ExtensionManagementError && ["Incompatible" , "IncompatibleApi" , "IncompatibleTargetPlatform" ].includes(error.code)) {
|
|
447
447
|
this.logService.info(`${syncResourceLogLabel}: Skipped synchronizing extension because the compatible extension is not found.`, gallery.displayName || gallery.identifier.id);
|
|
448
448
|
}
|
|
449
449
|
else if (error) {
|
|
@@ -500,7 +500,7 @@ LocalExtensionsProvider = ( __decorate([
|
|
|
500
500
|
], LocalExtensionsProvider));
|
|
501
501
|
let AbstractExtensionsInitializer = class AbstractExtensionsInitializer extends AbstractInitializer {
|
|
502
502
|
constructor(extensionManagementService, ignoredExtensionsManagementService, fileService, userDataProfilesService, environmentService, logService, storageService, uriIdentityService) {
|
|
503
|
-
super(
|
|
503
|
+
super("extensions" , userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService);
|
|
504
504
|
this.extensionManagementService = extensionManagementService;
|
|
505
505
|
this.ignoredExtensionsManagementService = ignoredExtensionsManagementService;
|
|
506
506
|
}
|
|
@@ -11,14 +11,13 @@ import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/commo
|
|
|
11
11
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
12
12
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
13
13
|
import { getServiceMachineId } from 'vscode/vscode/vs/platform/externalServices/common/serviceMachineId';
|
|
14
|
-
import { StorageTarget, StorageScope } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
15
14
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
16
15
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
17
16
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
18
17
|
import { AbstractSynchroniser, getSyncResourceLogLabel, AbstractInitializer, isSyncData } from 'vscode/vscode/vs/platform/userDataSync/common/abstractSynchronizer';
|
|
19
18
|
import { edit } from 'vscode/vscode/vs/platform/userDataSync/common/content';
|
|
20
19
|
import { merge } from './globalStateMerge.js';
|
|
21
|
-
import {
|
|
20
|
+
import { USER_DATA_SYNC_SCHEME, ALL_SYNC_RESOURCES, getEnablementKey, SYNC_SERVICE_URL_TYPE, createSyncHeaders, UserDataSyncError } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
22
21
|
import { IUserDataSyncStoreService, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
23
22
|
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
24
23
|
import { IUserDataProfileStorageService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfileStorageService.service';
|
|
@@ -36,7 +35,7 @@ function stringify(globalState, format) {
|
|
|
36
35
|
const GLOBAL_STATE_DATA_VERSION = 1;
|
|
37
36
|
let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSynchroniser {
|
|
38
37
|
constructor(profile, collection, userDataProfileStorageService, fileService, userDataSyncStoreService, userDataSyncLocalStoreService, logService, environmentService, userDataSyncEnablementService, telemetryService, configurationService, storageService, uriIdentityService, instantiationService) {
|
|
39
|
-
super({ syncResource:
|
|
38
|
+
super({ syncResource: "globalState" , profile }, collection, fileService, environmentService, storageService, userDataSyncStoreService, userDataSyncLocalStoreService, userDataSyncEnablementService, telemetryService, logService, configurationService, uriIdentityService);
|
|
40
39
|
this.userDataProfileStorageService = userDataProfileStorageService;
|
|
41
40
|
this.version = GLOBAL_STATE_DATA_VERSION;
|
|
42
41
|
this.previewResource = this.extUri.joinPath(this.syncPreviewFolder, 'globalState.json');
|
|
@@ -52,7 +51,7 @@ let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSync
|
|
|
52
51
|
return true;
|
|
53
52
|
}
|
|
54
53
|
if (( e.valueChanges.some(
|
|
55
|
-
({ profile, changes }) => this.syncResource.profile.id === profile.id && ( changes.some(change => change.target ===
|
|
54
|
+
({ profile, changes }) => this.syncResource.profile.id === profile.id && ( changes.some(change => change.target === 0 ))
|
|
56
55
|
))) {
|
|
57
56
|
return true;
|
|
58
57
|
}
|
|
@@ -76,8 +75,8 @@ let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSync
|
|
|
76
75
|
content: null,
|
|
77
76
|
local,
|
|
78
77
|
remote,
|
|
79
|
-
localChange: ( Object.keys(local.added)).length > 0 || ( Object.keys(local.updated)).length > 0 || local.removed.length > 0 ?
|
|
80
|
-
remoteChange: remote.all !== null ?
|
|
78
|
+
localChange: ( Object.keys(local.added)).length > 0 || ( Object.keys(local.updated)).length > 0 || local.removed.length > 0 ? 2 : 0 ,
|
|
79
|
+
remoteChange: remote.all !== null ? 2 : 0 ,
|
|
81
80
|
};
|
|
82
81
|
const localContent = stringify(localGlobalState, false);
|
|
83
82
|
return [{
|
|
@@ -126,8 +125,8 @@ let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSync
|
|
|
126
125
|
content: resourcePreview.localContent,
|
|
127
126
|
local: { added: {}, removed: [], updated: {} },
|
|
128
127
|
remote: { added: ( Object.keys(resourcePreview.localUserData.storage)), removed: [], updated: [], all: resourcePreview.localUserData.storage },
|
|
129
|
-
localChange:
|
|
130
|
-
remoteChange:
|
|
128
|
+
localChange: 0 ,
|
|
129
|
+
remoteChange: 2 ,
|
|
131
130
|
};
|
|
132
131
|
}
|
|
133
132
|
async acceptRemote(resourcePreview) {
|
|
@@ -138,8 +137,8 @@ let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSync
|
|
|
138
137
|
content: resourcePreview.remoteContent,
|
|
139
138
|
local,
|
|
140
139
|
remote,
|
|
141
|
-
localChange: ( Object.keys(local.added)).length > 0 || ( Object.keys(local.updated)).length > 0 || local.removed.length > 0 ?
|
|
142
|
-
remoteChange: remote !== null ?
|
|
140
|
+
localChange: ( Object.keys(local.added)).length > 0 || ( Object.keys(local.updated)).length > 0 || local.removed.length > 0 ? 2 : 0 ,
|
|
141
|
+
remoteChange: remote !== null ? 2 : 0 ,
|
|
143
142
|
};
|
|
144
143
|
}
|
|
145
144
|
else {
|
|
@@ -147,24 +146,24 @@ let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSync
|
|
|
147
146
|
content: resourcePreview.remoteContent,
|
|
148
147
|
local: { added: {}, removed: [], updated: {} },
|
|
149
148
|
remote: { added: [], removed: [], updated: [], all: null },
|
|
150
|
-
localChange:
|
|
151
|
-
remoteChange:
|
|
149
|
+
localChange: 0 ,
|
|
150
|
+
remoteChange: 0 ,
|
|
152
151
|
};
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
async applyResult(remoteUserData, lastSyncUserData, resourcePreviews, force) {
|
|
156
155
|
const { localUserData } = resourcePreviews[0][0];
|
|
157
156
|
const { local, remote, localChange, remoteChange } = resourcePreviews[0][1];
|
|
158
|
-
if (localChange ===
|
|
157
|
+
if (localChange === 0 && remoteChange === 0 ) {
|
|
159
158
|
this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing ui state.`);
|
|
160
159
|
}
|
|
161
|
-
if (localChange !==
|
|
160
|
+
if (localChange !== 0 ) {
|
|
162
161
|
this.logService.trace(`${this.syncResourceLogLabel}: Updating local ui state...`);
|
|
163
162
|
await this.backupLocal(JSON.stringify(localUserData));
|
|
164
163
|
await this.localGlobalStateProvider.writeLocalGlobalState(local, this.syncResource.profile);
|
|
165
164
|
this.logService.info(`${this.syncResourceLogLabel}: Updated local ui state`);
|
|
166
165
|
}
|
|
167
|
-
if (remoteChange !==
|
|
166
|
+
if (remoteChange !== 0 ) {
|
|
168
167
|
this.logService.trace(`${this.syncResourceLogLabel}: Updating remote ui state...`);
|
|
169
168
|
const content = JSON.stringify({ storage: remote.all });
|
|
170
169
|
remoteUserData = await this.updateRemoteUserData(content, force ? null : remoteUserData.ref);
|
|
@@ -201,10 +200,10 @@ let GlobalStateSynchroniser = class GlobalStateSynchroniser extends AbstractSync
|
|
|
201
200
|
const storageData = await this.userDataProfileStorageService.readStorageData(this.syncResource.profile);
|
|
202
201
|
const user = [], machine = [];
|
|
203
202
|
for (const [key, value] of storageData) {
|
|
204
|
-
if (value.target ===
|
|
203
|
+
if (value.target === 0 ) {
|
|
205
204
|
user.push(key);
|
|
206
205
|
}
|
|
207
|
-
else if (value.target ===
|
|
206
|
+
else if (value.target === 1 ) {
|
|
208
207
|
machine.push(key);
|
|
209
208
|
}
|
|
210
209
|
}
|
|
@@ -252,7 +251,7 @@ let LocalGlobalStateProvider = class LocalGlobalStateProvider {
|
|
|
252
251
|
}
|
|
253
252
|
const storageData = await this.userDataProfileStorageService.readStorageData(profile);
|
|
254
253
|
for (const [key, value] of storageData) {
|
|
255
|
-
if (value.value && value.target ===
|
|
254
|
+
if (value.value && value.target === 0 ) {
|
|
256
255
|
storage[key] = { version: 1, value: value.value };
|
|
257
256
|
}
|
|
258
257
|
}
|
|
@@ -271,7 +270,7 @@ let LocalGlobalStateProvider = class LocalGlobalStateProvider {
|
|
|
271
270
|
return '{}';
|
|
272
271
|
}
|
|
273
272
|
async writeLocalGlobalState({ added, removed, updated }, profile) {
|
|
274
|
-
const syncResourceLogLabel = getSyncResourceLogLabel(
|
|
273
|
+
const syncResourceLogLabel = getSyncResourceLogLabel("globalState" , profile);
|
|
275
274
|
const argv = {};
|
|
276
275
|
const updatedStorage = ( new Map());
|
|
277
276
|
const storageData = await this.userDataProfileStorageService.readStorageData(profile);
|
|
@@ -313,7 +312,7 @@ let LocalGlobalStateProvider = class LocalGlobalStateProvider {
|
|
|
313
312
|
}
|
|
314
313
|
if (updatedStorage.size) {
|
|
315
314
|
this.logService.trace(`${syncResourceLogLabel}: Updating global state...`);
|
|
316
|
-
await this.userDataProfileStorageService.updateStorageData(profile, updatedStorage,
|
|
315
|
+
await this.userDataProfileStorageService.updateStorageData(profile, updatedStorage, 0 );
|
|
317
316
|
this.logService.info(`${syncResourceLogLabel}: Updated global state`, [...( updatedStorage.keys())]);
|
|
318
317
|
}
|
|
319
318
|
}
|
|
@@ -326,7 +325,7 @@ LocalGlobalStateProvider = ( __decorate([
|
|
|
326
325
|
], LocalGlobalStateProvider));
|
|
327
326
|
let GlobalStateInitializer = class GlobalStateInitializer extends AbstractInitializer {
|
|
328
327
|
constructor(storageService, fileService, userDataProfilesService, environmentService, logService, uriIdentityService) {
|
|
329
|
-
super(
|
|
328
|
+
super("globalState" , userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService);
|
|
330
329
|
}
|
|
331
330
|
async doInitialize(remoteUserData) {
|
|
332
331
|
const remoteGlobalState = remoteUserData.syncData ? JSON.parse(remoteUserData.syncData.content) : null;
|
|
@@ -341,7 +340,7 @@ let GlobalStateInitializer = class GlobalStateInitializer extends AbstractInitia
|
|
|
341
340
|
argv[key.substring(argvStoragePrefx.length)] = remoteGlobalState.storage[key].value;
|
|
342
341
|
}
|
|
343
342
|
else {
|
|
344
|
-
if (this.storageService.get(key,
|
|
343
|
+
if (this.storageService.get(key, 0 ) === undefined) {
|
|
345
344
|
storage[key] = remoteGlobalState.storage[key].value;
|
|
346
345
|
}
|
|
347
346
|
}
|
|
@@ -361,7 +360,7 @@ let GlobalStateInitializer = class GlobalStateInitializer extends AbstractInitia
|
|
|
361
360
|
if (( Object.keys(storage)).length) {
|
|
362
361
|
const storageEntries = [];
|
|
363
362
|
for (const key of ( Object.keys(storage))) {
|
|
364
|
-
storageEntries.push({ key, value: storage[key], scope:
|
|
363
|
+
storageEntries.push({ key, value: storage[key], scope: 0 , target: 0 });
|
|
365
364
|
}
|
|
366
365
|
this.storageService.storeAll(storageEntries, true);
|
|
367
366
|
}
|
|
@@ -395,7 +394,7 @@ let UserDataSyncStoreTypeSynchronizer = class UserDataSyncStoreTypeSynchronizer
|
|
|
395
394
|
catch (e) {
|
|
396
395
|
if (e instanceof UserDataSyncError) {
|
|
397
396
|
switch (e.code) {
|
|
398
|
-
case
|
|
397
|
+
case "PreconditionFailed" :
|
|
399
398
|
this.logService.info(`Failed to synchronize UserDataSyncStoreType as there is a new remote version available. Synchronizing again...`);
|
|
400
399
|
return this.doSync(userDataSyncStoreType, syncHeaders);
|
|
401
400
|
}
|
|
@@ -404,12 +403,12 @@ let UserDataSyncStoreTypeSynchronizer = class UserDataSyncStoreTypeSynchronizer
|
|
|
404
403
|
}
|
|
405
404
|
}
|
|
406
405
|
async doSync(userDataSyncStoreType, syncHeaders) {
|
|
407
|
-
const globalStateUserData = await this.userDataSyncStoreClient.readResource(
|
|
406
|
+
const globalStateUserData = await this.userDataSyncStoreClient.readResource("globalState" , null, undefined, syncHeaders);
|
|
408
407
|
const remoteGlobalState = this.parseGlobalState(globalStateUserData) || { storage: {} };
|
|
409
408
|
remoteGlobalState.storage[SYNC_SERVICE_URL_TYPE] = { value: userDataSyncStoreType, version: GLOBAL_STATE_DATA_VERSION };
|
|
410
409
|
const machineId = await getServiceMachineId(this.environmentService, this.fileService, this.storageService);
|
|
411
410
|
const syncDataToUpdate = { version: GLOBAL_STATE_DATA_VERSION, machineId, content: stringify(remoteGlobalState, false) };
|
|
412
|
-
await this.userDataSyncStoreClient.writeResource(
|
|
411
|
+
await this.userDataSyncStoreClient.writeResource("globalState" , JSON.stringify(syncDataToUpdate), globalStateUserData.ref, undefined, syncHeaders);
|
|
413
412
|
}
|
|
414
413
|
parseGlobalState({ content }) {
|
|
415
414
|
if (!content) {
|
|
@@ -3,12 +3,11 @@ import { isNonEmptyArray } from 'vscode/vscode/vs/base/common/arrays';
|
|
|
3
3
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
4
4
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
5
5
|
import { parse } from 'vscode/vscode/vs/base/common/json';
|
|
6
|
-
import { OS
|
|
6
|
+
import { OS } from 'vscode/vscode/vs/base/common/platform';
|
|
7
7
|
import { isUndefined } from 'vscode/vscode/vs/base/common/types';
|
|
8
8
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
9
9
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
10
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
11
|
-
import { FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
|
|
12
11
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
13
12
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
14
13
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
@@ -16,7 +15,7 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
16
15
|
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
17
16
|
import { AbstractJsonFileSynchroniser, AbstractInitializer } from 'vscode/vscode/vs/platform/userDataSync/common/abstractSynchronizer';
|
|
18
17
|
import { merge } from './keybindingsMerge.js';
|
|
19
|
-
import {
|
|
18
|
+
import { USER_DATA_SYNC_SCHEME, UserDataSyncError, CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
20
19
|
import { IUserDataSyncStoreService, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncUtilService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
21
20
|
|
|
22
21
|
function getKeybindingsContentFromSyncContent(syncContent, platformSpecific, logService) {
|
|
@@ -26,11 +25,11 @@ function getKeybindingsContentFromSyncContent(syncContent, platformSpecific, log
|
|
|
26
25
|
return isUndefined(parsed.all) ? null : parsed.all;
|
|
27
26
|
}
|
|
28
27
|
switch (OS) {
|
|
29
|
-
case
|
|
28
|
+
case 2 :
|
|
30
29
|
return isUndefined(parsed.mac) ? null : parsed.mac;
|
|
31
|
-
case
|
|
30
|
+
case 3 :
|
|
32
31
|
return isUndefined(parsed.linux) ? null : parsed.linux;
|
|
33
|
-
case
|
|
32
|
+
case 1 :
|
|
34
33
|
return isUndefined(parsed.windows) ? null : parsed.windows;
|
|
35
34
|
}
|
|
36
35
|
}
|
|
@@ -41,7 +40,7 @@ function getKeybindingsContentFromSyncContent(syncContent, platformSpecific, log
|
|
|
41
40
|
}
|
|
42
41
|
let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJsonFileSynchroniser {
|
|
43
42
|
constructor(profile, collection, userDataSyncStoreService, userDataSyncLocalStoreService, logService, configurationService, userDataSyncEnablementService, fileService, environmentService, storageService, userDataSyncUtilService, telemetryService, uriIdentityService) {
|
|
44
|
-
super(profile.keybindingsResource, { syncResource:
|
|
43
|
+
super(profile.keybindingsResource, { syncResource: "keybindings" , profile }, collection, fileService, environmentService, storageService, userDataSyncStoreService, userDataSyncLocalStoreService, userDataSyncEnablementService, telemetryService, logService, userDataSyncUtilService, configurationService, uriIdentityService);
|
|
45
44
|
this.version = 2;
|
|
46
45
|
this.previewResource = this.extUri.joinPath(this.syncPreviewFolder, 'keybindings.json');
|
|
47
46
|
this.baseResource = this.previewResource.with({ scheme: USER_DATA_SYNC_SCHEME, authority: 'base' });
|
|
@@ -65,9 +64,9 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
65
64
|
localContent = localContent || '[]';
|
|
66
65
|
if (this.hasErrors(localContent, true)) {
|
|
67
66
|
throw ( new UserDataSyncError(localize(
|
|
68
|
-
|
|
67
|
+
8564,
|
|
69
68
|
"Unable to sync keybindings because the content in the file is not valid. Please open the file and correct it."
|
|
70
|
-
),
|
|
69
|
+
), "LocalInvalidContent" , this.resource));
|
|
71
70
|
}
|
|
72
71
|
if (!lastSyncContent
|
|
73
72
|
|| lastSyncContent !== localContent
|
|
@@ -90,8 +89,8 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
90
89
|
}
|
|
91
90
|
const previewResult = {
|
|
92
91
|
content: hasConflicts ? lastSyncContent : mergedContent,
|
|
93
|
-
localChange: hasLocalChanged ? fileContent ?
|
|
94
|
-
remoteChange: hasRemoteChanged ?
|
|
92
|
+
localChange: hasLocalChanged ? fileContent ? 2 : 1 : 0 ,
|
|
93
|
+
remoteChange: hasRemoteChanged ? 2 : 0 ,
|
|
95
94
|
hasConflicts
|
|
96
95
|
};
|
|
97
96
|
const localContent = fileContent ? ( fileContent.value.toString()) : null;
|
|
@@ -128,15 +127,15 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
128
127
|
if (this.extUri.isEqual(resource, this.localResource)) {
|
|
129
128
|
return {
|
|
130
129
|
content: resourcePreview.fileContent ? ( resourcePreview.fileContent.value.toString()) : null,
|
|
131
|
-
localChange:
|
|
132
|
-
remoteChange:
|
|
130
|
+
localChange: 0 ,
|
|
131
|
+
remoteChange: 2 ,
|
|
133
132
|
};
|
|
134
133
|
}
|
|
135
134
|
if (this.extUri.isEqual(resource, this.remoteResource)) {
|
|
136
135
|
return {
|
|
137
136
|
content: resourcePreview.remoteContent,
|
|
138
|
-
localChange:
|
|
139
|
-
remoteChange:
|
|
137
|
+
localChange: 2 ,
|
|
138
|
+
remoteChange: 0 ,
|
|
140
139
|
};
|
|
141
140
|
}
|
|
142
141
|
if (this.extUri.isEqual(resource, this.previewResource)) {
|
|
@@ -150,8 +149,8 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
150
149
|
else {
|
|
151
150
|
return {
|
|
152
151
|
content,
|
|
153
|
-
localChange:
|
|
154
|
-
remoteChange:
|
|
152
|
+
localChange: 2 ,
|
|
153
|
+
remoteChange: 2 ,
|
|
155
154
|
};
|
|
156
155
|
}
|
|
157
156
|
}
|
|
@@ -160,7 +159,7 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
160
159
|
async applyResult(remoteUserData, lastSyncUserData, resourcePreviews, force) {
|
|
161
160
|
const { fileContent } = resourcePreviews[0][0];
|
|
162
161
|
let { content, localChange, remoteChange } = resourcePreviews[0][1];
|
|
163
|
-
if (localChange ===
|
|
162
|
+
if (localChange === 0 && remoteChange === 0 ) {
|
|
164
163
|
this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing keybindings.`);
|
|
165
164
|
}
|
|
166
165
|
if (content !== null) {
|
|
@@ -168,12 +167,12 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
168
167
|
content = content || '[]';
|
|
169
168
|
if (this.hasErrors(content, true)) {
|
|
170
169
|
throw ( new UserDataSyncError(localize(
|
|
171
|
-
|
|
170
|
+
8564,
|
|
172
171
|
"Unable to sync keybindings because the content in the file is not valid. Please open the file and correct it."
|
|
173
|
-
),
|
|
172
|
+
), "LocalInvalidContent" , this.resource));
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
|
-
if (localChange !==
|
|
175
|
+
if (localChange !== 0 ) {
|
|
177
176
|
this.logService.trace(`${this.syncResourceLogLabel}: Updating local keybindings...`);
|
|
178
177
|
if (fileContent) {
|
|
179
178
|
await this.backupLocal(this.toSyncContent(( fileContent.value.toString())));
|
|
@@ -181,7 +180,7 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
181
180
|
await this.updateLocalFileContent(content || '[]', fileContent, force);
|
|
182
181
|
this.logService.info(`${this.syncResourceLogLabel}: Updated local keybindings`);
|
|
183
182
|
}
|
|
184
|
-
if (remoteChange !==
|
|
183
|
+
if (remoteChange !== 0 ) {
|
|
185
184
|
this.logService.trace(`${this.syncResourceLogLabel}: Updating remote keybindings...`);
|
|
186
185
|
const remoteContents = this.toSyncContent(content || '[]', remoteUserData.syncData?.content);
|
|
187
186
|
remoteUserData = await this.updateRemoteUserData(remoteContents, force ? null : remoteUserData.ref);
|
|
@@ -208,7 +207,7 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
209
|
catch (error) {
|
|
211
|
-
if (error.fileOperationResult !==
|
|
210
|
+
if (error.fileOperationResult !== 1 ) {
|
|
212
211
|
return true;
|
|
213
212
|
}
|
|
214
213
|
}
|
|
@@ -247,13 +246,13 @@ let KeybindingsSynchroniser = class KeybindingsSynchroniser extends AbstractJson
|
|
|
247
246
|
parsed.all = keybindingsContent;
|
|
248
247
|
}
|
|
249
248
|
switch (OS) {
|
|
250
|
-
case
|
|
249
|
+
case 2 :
|
|
251
250
|
parsed.mac = keybindingsContent;
|
|
252
251
|
break;
|
|
253
|
-
case
|
|
252
|
+
case 3 :
|
|
254
253
|
parsed.linux = keybindingsContent;
|
|
255
254
|
break;
|
|
256
|
-
case
|
|
255
|
+
case 1 :
|
|
257
256
|
parsed.windows = keybindingsContent;
|
|
258
257
|
break;
|
|
259
258
|
}
|
|
@@ -278,7 +277,7 @@ KeybindingsSynchroniser = ( __decorate([
|
|
|
278
277
|
], KeybindingsSynchroniser));
|
|
279
278
|
let KeybindingsInitializer = class KeybindingsInitializer extends AbstractInitializer {
|
|
280
279
|
constructor(fileService, userDataProfilesService, environmentService, logService, storageService, uriIdentityService) {
|
|
281
|
-
super(
|
|
280
|
+
super("keybindings" , userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService);
|
|
282
281
|
}
|
|
283
282
|
async doInitialize(remoteUserData) {
|
|
284
283
|
const keybindingsContent = remoteUserData.syncData ? this.getKeybindingsContentFromSyncContent(remoteUserData.syncData.content) : null;
|
|
@@ -301,7 +300,7 @@ let KeybindingsInitializer = class KeybindingsInitializer extends AbstractInitia
|
|
|
301
300
|
return !isNonEmptyArray(keybindings);
|
|
302
301
|
}
|
|
303
302
|
catch (error) {
|
|
304
|
-
return error.fileOperationResult ===
|
|
303
|
+
return error.fileOperationResult === 1 ;
|
|
305
304
|
}
|
|
306
305
|
}
|
|
307
306
|
getKeybindingsContentFromSyncContent(syncContent) {
|