@codingame/monaco-vscode-user-data-sync-service-override 37.1.0 → 37.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/common.d.ts +2 -0
- package/common.js +36 -0
- package/index.d.ts +1 -2
- package/index.js +1 -35
- package/package.json +11 -3
- package/session.d.ts +1 -0
- package/session.js +2 -0
- package/vscode/src/vs/platform/userDataSync/common/promptsSync/promptsSync.js +2 -2
- package/vscode/src/vs/platform/userDataSync/common/userDataAutoSyncService.js +7 -7
- package/vscode/src/vs/platform/userDataSync/common/userDataProfilesManifestMerge.js +18 -53
- package/vscode/src/vs/platform/userDataSync/common/userDataProfilesManifestSync.js +9 -9
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncLocalStoreService.js +4 -4
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncLog.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncResourceProvider.js +7 -7
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncService.js +11 -9
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSync.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSync.js +77 -77
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSyncConflictsView.js +10 -10
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.js +7 -4
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.js +44 -44
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js +40 -35
|
@@ -61,7 +61,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
61
61
|
}
|
|
62
62
|
registerConflictsView(container) {
|
|
63
63
|
const viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
|
|
64
|
-
const viewName = ( localize2(
|
|
64
|
+
const viewName = ( localize2(20825, "Conflicts"));
|
|
65
65
|
const viewDescriptor = {
|
|
66
66
|
id: SYNC_CONFLICTS_VIEW_ID,
|
|
67
67
|
name: viewName,
|
|
@@ -77,7 +77,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
77
77
|
}
|
|
78
78
|
registerMachinesView(container) {
|
|
79
79
|
const id = `workbench.views.sync.machines`;
|
|
80
|
-
const name = ( localize2(
|
|
80
|
+
const name = ( localize2(20826, "Synced Machines"));
|
|
81
81
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
82
82
|
const dataProvider = this.instantiationService.createInstance(UserDataSyncMachinesViewDataProvider, treeView);
|
|
83
83
|
treeView.showRefreshAction = true;
|
|
@@ -104,7 +104,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
104
104
|
constructor() {
|
|
105
105
|
super({
|
|
106
106
|
id: `workbench.actions.sync.editMachineName`,
|
|
107
|
-
title: ( localize(
|
|
107
|
+
title: ( localize(20827, "Edit Name")),
|
|
108
108
|
icon: Codicon.edit,
|
|
109
109
|
menu: {
|
|
110
110
|
id: MenuId.ViewItemContext,
|
|
@@ -124,7 +124,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
124
124
|
constructor() {
|
|
125
125
|
super({
|
|
126
126
|
id: `workbench.actions.sync.turnOffSyncOnMachine`,
|
|
127
|
-
title: ( localize(
|
|
127
|
+
title: ( localize(20828, "Turn off Settings Sync")),
|
|
128
128
|
menu: {
|
|
129
129
|
id: MenuId.ViewItemContext,
|
|
130
130
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", id)), ( ContextKeyExpr.equals("viewItem", "sync-machine"))))
|
|
@@ -132,7 +132,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
async run(accessor, handle, selected) {
|
|
135
|
-
if (await dataProvider.disable((
|
|
135
|
+
if (await dataProvider.disable((selected || [handle]).map(handle => handle.$treeItemHandle))) {
|
|
136
136
|
await treeView.refresh();
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -140,7 +140,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
140
140
|
}
|
|
141
141
|
registerActivityView(container, remote) {
|
|
142
142
|
const id = `workbench.views.sync.${remote ? "remote" : "local"}Activity`;
|
|
143
|
-
const name = remote ? ( localize2(
|
|
143
|
+
const name = remote ? ( localize2(20829, "Sync Activity (Remote)")) : ( localize2(20830, "Sync Activity (Local)"));
|
|
144
144
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
145
145
|
treeView.showCollapseAllAction = true;
|
|
146
146
|
treeView.showRefreshAction = true;
|
|
@@ -169,7 +169,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
169
169
|
}
|
|
170
170
|
registerExternalActivityView(container) {
|
|
171
171
|
const id = `workbench.views.sync.externalActivity`;
|
|
172
|
-
const name = ( localize2(
|
|
172
|
+
const name = ( localize2(20831, "Sync Activity (Developer)"));
|
|
173
173
|
const dataProvider = this.instantiationService.createInstance(ExtractedUserDataSyncActivityViewDataProvider, undefined);
|
|
174
174
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
175
175
|
treeView.showCollapseAllAction = false;
|
|
@@ -192,7 +192,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
192
192
|
constructor() {
|
|
193
193
|
super({
|
|
194
194
|
id: `workbench.actions.sync.loadActivity`,
|
|
195
|
-
title: ( localize(
|
|
195
|
+
title: ( localize(20832, "Load Sync Activity")),
|
|
196
196
|
icon: Codicon.cloudUpload,
|
|
197
197
|
menu: {
|
|
198
198
|
id: MenuId.ViewTitle,
|
|
@@ -204,7 +204,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
204
204
|
async run(accessor) {
|
|
205
205
|
const fileDialogService = accessor.get(IFileDialogService);
|
|
206
206
|
const result = await fileDialogService.showOpenDialog({
|
|
207
|
-
title: ( localize(
|
|
207
|
+
title: ( localize(20833, "Select Sync Activity File or Folder")),
|
|
208
208
|
canSelectFiles: true,
|
|
209
209
|
canSelectFolders: true,
|
|
210
210
|
canSelectMany: false
|
|
@@ -222,7 +222,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
222
222
|
constructor() {
|
|
223
223
|
super({
|
|
224
224
|
id: `workbench.actions.sync.${viewId}.resolveResource`,
|
|
225
|
-
title: ( localize(
|
|
225
|
+
title: ( localize(20834, "Show raw JSON sync data")),
|
|
226
226
|
menu: {
|
|
227
227
|
id: MenuId.ViewItemContext,
|
|
228
228
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", viewId)), ( ContextKeyExpr.regex("viewItem", /sync-resource-.*/i))))
|
|
@@ -246,7 +246,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
246
246
|
constructor() {
|
|
247
247
|
super({
|
|
248
248
|
id: `workbench.actions.sync.${viewId}.compareWithLocal`,
|
|
249
|
-
title: ( localize(
|
|
249
|
+
title: ( localize(20835, "Compare with Local")),
|
|
250
250
|
menu: {
|
|
251
251
|
id: MenuId.ViewItemContext,
|
|
252
252
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", viewId)), ( ContextKeyExpr.regex("viewItem", /sync-associatedResource-.*/i))))
|
|
@@ -266,10 +266,10 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
266
266
|
remoteResource,
|
|
267
267
|
localResource,
|
|
268
268
|
( localize(
|
|
269
|
-
|
|
269
|
+
20836,
|
|
270
270
|
"{0} ↔ {1}",
|
|
271
|
-
localize(
|
|
272
|
-
localize(
|
|
271
|
+
localize(20837, "{0} (Remote)", basename(remoteResource)),
|
|
272
|
+
localize(20838, "{0} (Local)", basename(localResource))
|
|
273
273
|
)),
|
|
274
274
|
undefined
|
|
275
275
|
);
|
|
@@ -279,7 +279,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
279
279
|
constructor() {
|
|
280
280
|
super({
|
|
281
281
|
id: `workbench.actions.sync.${viewId}.replaceCurrent`,
|
|
282
|
-
title: ( localize(
|
|
282
|
+
title: ( localize(20839, "Restore")),
|
|
283
283
|
icon: Codicon.discard,
|
|
284
284
|
menu: {
|
|
285
285
|
id: MenuId.ViewItemContext,
|
|
@@ -297,7 +297,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
297
297
|
} = JSON.parse(handle.$treeItemHandle);
|
|
298
298
|
const result = await dialogService.confirm({
|
|
299
299
|
message: ( localize(
|
|
300
|
-
|
|
300
|
+
20840,
|
|
301
301
|
"Would you like to replace your current {0} with selected?",
|
|
302
302
|
getSyncAreaLabel(syncResource)
|
|
303
303
|
)),
|
|
@@ -315,7 +315,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
315
315
|
}
|
|
316
316
|
registerTroubleShootView(container) {
|
|
317
317
|
const id = `workbench.views.sync.troubleshoot`;
|
|
318
|
-
const name = ( localize2(
|
|
318
|
+
const name = ( localize2(20841, "Troubleshoot"));
|
|
319
319
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
320
320
|
const dataProvider = this.instantiationService.createInstance(UserDataSyncTroubleshootViewDataProvider);
|
|
321
321
|
treeView.showRefreshAction = true;
|
|
@@ -381,7 +381,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
381
381
|
actions: {
|
|
382
382
|
primary: [toAction({
|
|
383
383
|
id: "reset",
|
|
384
|
-
label: ( localize(
|
|
384
|
+
label: ( localize(20842, "Reset Synced Data")),
|
|
385
385
|
run: () => this.userDataSyncWorkbenchService.resetSyncedData()
|
|
386
386
|
})]
|
|
387
387
|
}
|
|
@@ -426,7 +426,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
426
426
|
const syncResourceHandle = element.syncResourceHandle;
|
|
427
427
|
const associatedResources = await this.userDataSyncResourceProviderService.getAssociatedResources(syncResourceHandle);
|
|
428
428
|
const previousAssociatedResources = syncResourceHandle.previous ? await this.userDataSyncResourceProviderService.getAssociatedResources(syncResourceHandle.previous) : [];
|
|
429
|
-
return
|
|
429
|
+
return associatedResources.map((
|
|
430
430
|
{
|
|
431
431
|
resource,
|
|
432
432
|
comparableResource
|
|
@@ -445,7 +445,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
445
445
|
id: API_OPEN_DIFF_EDITOR_COMMAND_ID,
|
|
446
446
|
title: "",
|
|
447
447
|
arguments: [previousResource, resource, ( localize(
|
|
448
|
-
|
|
448
|
+
20843,
|
|
449
449
|
"{0} ↔ {1}",
|
|
450
450
|
`${basename(resource)} (${fromNow(syncResourceHandle.previous.created, true)})`,
|
|
451
451
|
`${basename(resource)} (${fromNow(syncResourceHandle.created, true)})`
|
|
@@ -457,18 +457,18 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
457
457
|
},
|
|
458
458
|
contextValue: `sync-associatedResource-${syncResourceHandle.syncResource}`
|
|
459
459
|
};
|
|
460
|
-
})
|
|
460
|
+
});
|
|
461
461
|
}
|
|
462
462
|
async getSyncResourceHandles(profile) {
|
|
463
463
|
const treeItems = [];
|
|
464
|
-
const result = await Promise.all(
|
|
464
|
+
const result = await Promise.all(ALL_SYNC_RESOURCES.map(async syncResource => {
|
|
465
465
|
const resourceHandles = await this.getResourceHandles(syncResource, profile);
|
|
466
|
-
return
|
|
466
|
+
return resourceHandles.map((resourceHandle, index) => ({
|
|
467
467
|
...resourceHandle,
|
|
468
468
|
syncResource,
|
|
469
469
|
previous: resourceHandles[index + 1]
|
|
470
|
-
}))
|
|
471
|
-
}))
|
|
470
|
+
}));
|
|
471
|
+
}));
|
|
472
472
|
const syncResourceHandles = result.flat().sort((a, b) => b.created - a.created);
|
|
473
473
|
for (const syncResourceHandle of syncResourceHandles) {
|
|
474
474
|
const handle = JSON.stringify({
|
|
@@ -497,11 +497,11 @@ class LocalUserDataSyncActivityViewDataProvider extends UserDataSyncActivityView
|
|
|
497
497
|
return this.userDataSyncResourceProviderService.getLocalSyncResourceHandles(syncResource, profile);
|
|
498
498
|
}
|
|
499
499
|
async getProfiles() {
|
|
500
|
-
return
|
|
500
|
+
return this.userDataProfilesService.profiles.filter(p => !p.isDefault).map(p => ({
|
|
501
501
|
id: p.id,
|
|
502
502
|
collection: p.id,
|
|
503
503
|
name: p.name
|
|
504
|
-
}))
|
|
504
|
+
}));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
let RemoteUserDataSyncActivityViewDataProvider = class RemoteUserDataSyncActivityViewDataProvider extends UserDataSyncActivityViewDataProvider {
|
|
@@ -553,7 +553,7 @@ let RemoteUserDataSyncActivityViewDataProvider = class RemoteUserDataSyncActivit
|
|
|
553
553
|
id
|
|
554
554
|
}
|
|
555
555
|
) => id === machineId);
|
|
556
|
-
children[0].description = machine?.isCurrent ? ( localize(
|
|
556
|
+
children[0].description = machine?.isCurrent ? ( localize(20844, "Current")) : machine?.name;
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
return children;
|
|
@@ -625,7 +625,7 @@ let ExtractedUserDataSyncActivityViewDataProvider = class ExtractedUserDataSyncA
|
|
|
625
625
|
id
|
|
626
626
|
}
|
|
627
627
|
) => id === machineId);
|
|
628
|
-
children[0].description = machine?.isCurrent ? ( localize(
|
|
628
|
+
children[0].description = machine?.isCurrent ? ( localize(20844, "Current")) : machine?.name;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
return children;
|
|
@@ -661,8 +661,8 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
661
661
|
try {
|
|
662
662
|
let machines = await this.getMachines();
|
|
663
663
|
machines = machines.filter(m => !m.disabled).sort((m1, m2) => m1.isCurrent ? -1 : 1);
|
|
664
|
-
this.treeView.message = machines.length ? undefined : ( localize(
|
|
665
|
-
return
|
|
664
|
+
this.treeView.message = machines.length ? undefined : ( localize(20845, "No Machines"));
|
|
665
|
+
return machines.map((
|
|
666
666
|
{
|
|
667
667
|
id,
|
|
668
668
|
name,
|
|
@@ -675,10 +675,10 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
675
675
|
label: {
|
|
676
676
|
label: name
|
|
677
677
|
},
|
|
678
|
-
description: isCurrent ? ( localize(
|
|
678
|
+
description: isCurrent ? ( localize(20844, "Current")) : undefined,
|
|
679
679
|
themeIcon: platform && isWebPlatform(platform) ? Codicon.globe : Codicon.vm,
|
|
680
680
|
contextValue: "sync-machine"
|
|
681
|
-
}))
|
|
681
|
+
}));
|
|
682
682
|
} catch (error) {
|
|
683
683
|
this.notificationService.error(error);
|
|
684
684
|
return [];
|
|
@@ -698,16 +698,16 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
698
698
|
}
|
|
699
699
|
) => machineIds.includes(id));
|
|
700
700
|
if (!machinesToDisable.length) {
|
|
701
|
-
throw ( new Error(( localize(
|
|
701
|
+
throw ( new Error(( localize(20846, "machine not found with id: {0}", machineIds.join(",")))));
|
|
702
702
|
}
|
|
703
703
|
const result = await this.dialogService.confirm({
|
|
704
704
|
type: "info",
|
|
705
|
-
message: machinesToDisable.length > 1 ? ( localize(
|
|
706
|
-
|
|
705
|
+
message: machinesToDisable.length > 1 ? ( localize(20847, "Are you sure you want to turn off sync on selected machines?")) : ( localize(
|
|
706
|
+
20848,
|
|
707
707
|
"Are you sure you want to turn off sync on {0}?",
|
|
708
708
|
machinesToDisable[0].name
|
|
709
709
|
)),
|
|
710
|
-
primaryButton: ( localize(
|
|
710
|
+
primaryButton: ( localize(20849, "&&Turn off"))
|
|
711
711
|
});
|
|
712
712
|
if (!result.confirmed) {
|
|
713
713
|
return false;
|
|
@@ -715,7 +715,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
715
715
|
if (( machinesToDisable.some(machine => machine.isCurrent))) {
|
|
716
716
|
await this.userDataSyncWorkbenchService.turnoff(false);
|
|
717
717
|
}
|
|
718
|
-
const otherMachinesToDisable =
|
|
718
|
+
const otherMachinesToDisable = machinesToDisable.filter(machine => !machine.isCurrent).map(machine => ([machine.id, false]));
|
|
719
719
|
if (otherMachinesToDisable.length) {
|
|
720
720
|
await this.userDataSyncMachinesService.setEnablements(otherMachinesToDisable);
|
|
721
721
|
}
|
|
@@ -724,7 +724,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
724
724
|
async rename(machineId) {
|
|
725
725
|
const disposableStore = ( new DisposableStore());
|
|
726
726
|
const inputBox = disposableStore.add(this.quickInputService.createInputBox());
|
|
727
|
-
inputBox.placeholder = ( localize(
|
|
727
|
+
inputBox.placeholder = ( localize(20850, "Enter the name of the machine"));
|
|
728
728
|
inputBox.busy = true;
|
|
729
729
|
inputBox.show();
|
|
730
730
|
const machines = await this.getMachines();
|
|
@@ -741,7 +741,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
741
741
|
if (!machine) {
|
|
742
742
|
inputBox.hide();
|
|
743
743
|
disposableStore.dispose();
|
|
744
|
-
throw ( new Error(( localize(
|
|
744
|
+
throw ( new Error(( localize(20846, "machine not found with id: {0}", machineId))));
|
|
745
745
|
}
|
|
746
746
|
inputBox.busy = false;
|
|
747
747
|
inputBox.value = machine.name;
|
|
@@ -750,7 +750,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
750
750
|
return machineName && !( enabledMachines.some(m => m.id !== machineId && m.name === machineName)) ? machineName : null;
|
|
751
751
|
};
|
|
752
752
|
disposableStore.add(inputBox.onDidChangeValue(
|
|
753
|
-
() => inputBox.validationMessage = validateMachineName(inputBox.value) ? "" : ( localize(
|
|
753
|
+
() => inputBox.validationMessage = validateMachineName(inputBox.value) ? "" : ( localize(20851, "Machine name should be unique and not empty"))
|
|
754
754
|
));
|
|
755
755
|
return ( new Promise((c, e) => {
|
|
756
756
|
disposableStore.add(inputBox.onDidAccept(async () => {
|
|
@@ -789,14 +789,14 @@ let UserDataSyncTroubleshootViewDataProvider = class UserDataSyncTroubleshootVie
|
|
|
789
789
|
handle: "SYNC_LOGS",
|
|
790
790
|
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
|
791
791
|
label: {
|
|
792
|
-
label: ( localize(
|
|
792
|
+
label: ( localize(20852, "Logs"))
|
|
793
793
|
},
|
|
794
794
|
themeIcon: Codicon.folder
|
|
795
795
|
}, {
|
|
796
796
|
handle: "LAST_SYNC_STATES",
|
|
797
797
|
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
|
798
798
|
label: {
|
|
799
|
-
label: ( localize(
|
|
799
|
+
label: ( localize(20853, "Last Synced Remotes"))
|
|
800
800
|
},
|
|
801
801
|
themeIcon: Codicon.folder
|
|
802
802
|
}];
|
|
@@ -848,7 +848,7 @@ let UserDataSyncTroubleshootViewDataProvider = class UserDataSyncTroubleshootVie
|
|
|
848
848
|
label: {
|
|
849
849
|
label: this.uriIdentityService.extUri.basename(logFolder)
|
|
850
850
|
},
|
|
851
|
-
description: this.uriIdentityService.extUri.isEqual(logFolder, this.environmentService.logsHome) ? ( localize(
|
|
851
|
+
description: this.uriIdentityService.extUri.isEqual(logFolder, this.environmentService.logsHome) ? ( localize(20844, "Current")) : undefined,
|
|
852
852
|
command: {
|
|
853
853
|
id: API_OPEN_EDITOR_COMMAND_ID,
|
|
854
854
|
title: "",
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js
CHANGED
|
@@ -184,11 +184,14 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
184
184
|
id
|
|
185
185
|
}
|
|
186
186
|
) => ( this.authenticationService.declaredProviders.some(provider => provider.id === id)));
|
|
187
|
-
this.logService.trace(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
this.logService.trace(
|
|
188
|
+
"Settings Sync: Authentication providers updated",
|
|
189
|
+
this._authenticationProviders.map((
|
|
190
|
+
{
|
|
191
|
+
id
|
|
192
|
+
}
|
|
193
|
+
) => id)
|
|
194
|
+
);
|
|
192
195
|
return equals(oldValue, this._authenticationProviders, (a, b) => a.id === b.id);
|
|
193
196
|
}
|
|
194
197
|
isSupportedAuthenticationProviderId(authenticationProviderId) {
|
|
@@ -347,7 +350,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
347
350
|
async turnOn() {
|
|
348
351
|
if (!this.authenticationProviders.length) {
|
|
349
352
|
throw ( new Error(( localize(
|
|
350
|
-
|
|
353
|
+
22475,
|
|
351
354
|
"Settings sync cannot be turned on because there are no authentication providers available."
|
|
352
355
|
))));
|
|
353
356
|
}
|
|
@@ -362,7 +365,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
362
365
|
throw ( new CancellationError());
|
|
363
366
|
}
|
|
364
367
|
if (this.accountStatus !== AccountStatus.Available) {
|
|
365
|
-
throw ( new Error(( localize(
|
|
368
|
+
throw ( new Error(( localize(22476, "No account available"))));
|
|
366
369
|
}
|
|
367
370
|
const turnOnSyncCancellationToken = this.turnOnSyncCancellationToken = ( new CancellationTokenSource());
|
|
368
371
|
const disposable = isWeb ? Disposable.None : this.lifecycleService.onBeforeShutdown(e => e.veto((async () => {
|
|
@@ -370,10 +373,10 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
370
373
|
confirmed
|
|
371
374
|
} = await this.dialogService.confirm({
|
|
372
375
|
type: "warning",
|
|
373
|
-
message: ( localize(
|
|
374
|
-
title: ( localize(
|
|
375
|
-
primaryButton: ( localize(
|
|
376
|
-
cancelButton: ( localize(
|
|
376
|
+
message: ( localize(22477, "Settings Sync is being turned on. Would you like to cancel it?")),
|
|
377
|
+
title: ( localize(22478, "Settings Sync")),
|
|
378
|
+
primaryButton: ( localize(22479, "&&Yes")),
|
|
379
|
+
cancelButton: ( localize(22480, "No"))
|
|
377
380
|
});
|
|
378
381
|
if (confirmed) {
|
|
379
382
|
turnOnSyncCancellationToken.cancel();
|
|
@@ -394,7 +397,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
394
397
|
if (this.environmentService.options?.settingsSyncOptions?.enablementHandler && this.currentAuthenticationProviderId) {
|
|
395
398
|
this.environmentService.options.settingsSyncOptions.enablementHandler(true, this.currentAuthenticationProviderId);
|
|
396
399
|
}
|
|
397
|
-
this.notificationService.info(( localize(
|
|
400
|
+
this.notificationService.info(( localize(22481, "{0} is turned on", SYNC_TITLE.value)));
|
|
398
401
|
this._onDidTurnOnSync.fire();
|
|
399
402
|
}
|
|
400
403
|
async turnoff(everywhere) {
|
|
@@ -442,16 +445,16 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
442
445
|
delay: 500
|
|
443
446
|
}, async progress => {
|
|
444
447
|
progress.report({
|
|
445
|
-
message: ( localize(
|
|
448
|
+
message: ( localize(22482, "Turning on..."))
|
|
446
449
|
});
|
|
447
450
|
disposables.add(this.userDataSyncService.onDidChangeStatus(status => {
|
|
448
451
|
if (status === SyncStatus.HasConflicts) {
|
|
449
452
|
progress.report({
|
|
450
|
-
message: ( localize(
|
|
453
|
+
message: ( localize(22483, "Resolving conflicts..."))
|
|
451
454
|
});
|
|
452
455
|
} else {
|
|
453
456
|
progress.report({
|
|
454
|
-
message: ( localize(
|
|
457
|
+
message: ( localize(22484, "Turning on..."))
|
|
455
458
|
});
|
|
456
459
|
}
|
|
457
460
|
}));
|
|
@@ -470,7 +473,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
470
473
|
}
|
|
471
474
|
async handleConflictsWhileTurningOn(token) {
|
|
472
475
|
const conflicts = this.userDataSyncService.conflicts;
|
|
473
|
-
const andSeparator = ( localize(
|
|
476
|
+
const andSeparator = ( localize(22485, " and "));
|
|
474
477
|
let conflictsText = "";
|
|
475
478
|
for (let i = 0; i < conflicts.length; i++) {
|
|
476
479
|
if (i === conflicts.length - 1 && i !== 0) {
|
|
@@ -483,10 +486,10 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
483
486
|
const singleConflictResource = conflicts.length === 1 ? getSyncAreaLabel(conflicts[0].syncResource) : undefined;
|
|
484
487
|
await this.dialogService.prompt({
|
|
485
488
|
type: Severity.Warning,
|
|
486
|
-
message: ( localize(
|
|
487
|
-
detail: ( localize(
|
|
489
|
+
message: ( localize(22486, "Conflicts Detected in {0}", conflictsText)),
|
|
490
|
+
detail: ( localize(22487, "Please resolve conflicts to turn on...")),
|
|
488
491
|
buttons: [{
|
|
489
|
-
label: ( localize(
|
|
492
|
+
label: ( localize(22488, "&&Show Conflicts")),
|
|
490
493
|
run: async () => {
|
|
491
494
|
const waitUntilConflictsAreResolvedPromise = raceCancellationError(Event.toPromise(Event.filter(
|
|
492
495
|
this.userDataSyncService.onDidChangeConflicts,
|
|
@@ -496,10 +499,10 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
496
499
|
await waitUntilConflictsAreResolvedPromise;
|
|
497
500
|
}
|
|
498
501
|
}, {
|
|
499
|
-
label: singleConflictResource ? ( localize(
|
|
502
|
+
label: singleConflictResource ? ( localize(22489, "Accept &&Remote {0}", singleConflictResource)) : ( localize(22490, "Accept &&Remote")),
|
|
500
503
|
run: async () => this.replace(true)
|
|
501
504
|
}, {
|
|
502
|
-
label: singleConflictResource ? ( localize(
|
|
505
|
+
label: singleConflictResource ? ( localize(22491, "Accept &&Local {0}", singleConflictResource)) : ( localize(22492, "Accept &&Local")),
|
|
503
506
|
run: () => this.replace(false)
|
|
504
507
|
}],
|
|
505
508
|
cancelButton: {
|
|
@@ -540,11 +543,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
540
543
|
} = await this.dialogService.confirm({
|
|
541
544
|
type: "info",
|
|
542
545
|
message: ( localize(
|
|
543
|
-
|
|
546
|
+
22493,
|
|
544
547
|
"This will clear your data in the cloud and stop sync on all your devices."
|
|
545
548
|
)),
|
|
546
|
-
title: ( localize(
|
|
547
|
-
primaryButton: ( localize(
|
|
549
|
+
title: ( localize(22494, "Clear")),
|
|
550
|
+
primaryButton: ( localize(22495, "&&Reset"))
|
|
548
551
|
});
|
|
549
552
|
if (confirmed) {
|
|
550
553
|
await this.userDataSyncService.resetRemote();
|
|
@@ -554,7 +557,9 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
554
557
|
const logsFolders = [];
|
|
555
558
|
const stat = await this.fileService.resolve(this.uriIdentityService.extUri.dirname(this.environmentService.logsHome));
|
|
556
559
|
if (stat.children) {
|
|
557
|
-
logsFolders.push(
|
|
560
|
+
logsFolders.push(
|
|
561
|
+
...stat.children.filter(stat => stat.isDirectory && /^\d{8}T\d{6}$/.test(stat.name)).sort().reverse().map(d => d.resource)
|
|
562
|
+
);
|
|
558
563
|
}
|
|
559
564
|
const result = [];
|
|
560
565
|
for (const logFolder of logsFolders) {
|
|
@@ -575,11 +580,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
575
580
|
}
|
|
576
581
|
async downloadSyncActivity() {
|
|
577
582
|
const result = await this.fileDialogService.showOpenDialog({
|
|
578
|
-
title: ( localize(
|
|
583
|
+
title: ( localize(22496, "Select folder to download Settings Sync activity")),
|
|
579
584
|
canSelectFiles: false,
|
|
580
585
|
canSelectFolders: true,
|
|
581
586
|
canSelectMany: false,
|
|
582
|
-
openLabel: ( localize(
|
|
587
|
+
openLabel: ( localize(22497, "Save"))
|
|
583
588
|
});
|
|
584
589
|
if (!result?.[0]) {
|
|
585
590
|
return;
|
|
@@ -612,13 +617,13 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
612
617
|
this.userDataSyncService.saveRemoteActivityData(this.uriIdentityService.extUri.joinPath(folder, "remoteActivity.json")),
|
|
613
618
|
(async () => {
|
|
614
619
|
const logResources = await this.getAllLogResources();
|
|
615
|
-
await Promise.all(
|
|
620
|
+
await Promise.all(logResources.map(
|
|
616
621
|
async logResource => this.fileService.copy(logResource, this.uriIdentityService.extUri.joinPath(
|
|
617
622
|
folder,
|
|
618
623
|
"logs",
|
|
619
624
|
`${this.uriIdentityService.extUri.basename(this.uriIdentityService.extUri.dirname(logResource))}.log`
|
|
620
625
|
))
|
|
621
|
-
))
|
|
626
|
+
));
|
|
622
627
|
})(),
|
|
623
628
|
this.fileService.copy(
|
|
624
629
|
this.environmentService.userDataSyncHome,
|
|
@@ -648,7 +653,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
648
653
|
} else {
|
|
649
654
|
if (!this.authenticationProviders.length) {
|
|
650
655
|
throw ( new Error(( localize(
|
|
651
|
-
|
|
656
|
+
22498,
|
|
652
657
|
"Cannot sign in because there are no authentication providers available."
|
|
653
658
|
))));
|
|
654
659
|
}
|
|
@@ -695,7 +700,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
695
700
|
quickPick.title = SYNC_TITLE.value;
|
|
696
701
|
quickPick.ok = false;
|
|
697
702
|
quickPick.ignoreFocusOut = true;
|
|
698
|
-
quickPick.placeholder = ( localize(
|
|
703
|
+
quickPick.placeholder = ( localize(22499, "Select an account to sign in"));
|
|
699
704
|
quickPick.show();
|
|
700
705
|
if (authenticationProviders.length > 1) {
|
|
701
706
|
quickPick.busy = true;
|
|
@@ -742,7 +747,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
742
747
|
if (allAccounts.size) {
|
|
743
748
|
quickPickItems.push({
|
|
744
749
|
type: "separator",
|
|
745
|
-
label: ( localize(
|
|
750
|
+
label: ( localize(22500, "Signed in"))
|
|
746
751
|
});
|
|
747
752
|
for (const authenticationProvider of authenticationProviders) {
|
|
748
753
|
const accounts = (allAccounts.get(authenticationProvider.id) || []).sort((
|
|
@@ -754,7 +759,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
754
759
|
for (const account of accounts) {
|
|
755
760
|
quickPickItems.push({
|
|
756
761
|
label: `${account.accountName} (${providerName})`,
|
|
757
|
-
description: account.sessionId === this.current?.sessionId ? ( localize(
|
|
762
|
+
description: account.sessionId === this.current?.sessionId ? ( localize(22501, "Last Used with Sync")) : undefined,
|
|
758
763
|
account,
|
|
759
764
|
authenticationProvider
|
|
760
765
|
});
|
|
@@ -762,7 +767,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
762
767
|
}
|
|
763
768
|
quickPickItems.push({
|
|
764
769
|
type: "separator",
|
|
765
|
-
label: ( localize(
|
|
770
|
+
label: ( localize(22502, "Others"))
|
|
766
771
|
});
|
|
767
772
|
}
|
|
768
773
|
for (const authenticationProvider of authenticationProviders) {
|
|
@@ -770,7 +775,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
770
775
|
if (!( allAccounts.has(authenticationProvider.id)) || provider.supportsMultipleAccounts) {
|
|
771
776
|
const providerName = provider.label;
|
|
772
777
|
quickPickItems.push({
|
|
773
|
-
label: ( localize(
|
|
778
|
+
label: ( localize(22503, "Sign in with {0}", providerName)),
|
|
774
779
|
authenticationProvider
|
|
775
780
|
});
|
|
776
781
|
}
|