@codingame/monaco-vscode-user-data-sync-service-override 37.2.0 → 37.3.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/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
|
@@ -51,35 +51,35 @@ import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severit
|
|
|
51
51
|
|
|
52
52
|
const turnOffSyncCommand = {
|
|
53
53
|
id: "workbench.userDataSync.actions.turnOff",
|
|
54
|
-
title: ( localize2(
|
|
54
|
+
title: ( localize2(20749, "Turn Off"))
|
|
55
55
|
};
|
|
56
56
|
const configureSyncCommand = {
|
|
57
57
|
id: CONFIGURE_SYNC_COMMAND_ID,
|
|
58
|
-
title: ( localize2(
|
|
58
|
+
title: ( localize2(20750, "Configure..."))
|
|
59
59
|
};
|
|
60
60
|
const showConflictsCommandId = "workbench.userDataSync.actions.showConflicts";
|
|
61
61
|
const syncNowCommand = {
|
|
62
62
|
id: "workbench.userDataSync.actions.syncNow",
|
|
63
|
-
title: ( localize2(
|
|
63
|
+
title: ( localize2(20751, "Sync Now")),
|
|
64
64
|
description(userDataSyncService) {
|
|
65
65
|
if (userDataSyncService.status === SyncStatus.Syncing) {
|
|
66
|
-
return localize(
|
|
66
|
+
return localize(20752, "syncing");
|
|
67
67
|
}
|
|
68
68
|
if (userDataSyncService.lastSyncTime) {
|
|
69
|
-
return localize(
|
|
69
|
+
return localize(20753, "synced {0}", fromNow(userDataSyncService.lastSyncTime, true));
|
|
70
70
|
}
|
|
71
71
|
return undefined;
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
const showSyncSettingsCommand = {
|
|
75
75
|
id: "workbench.userDataSync.actions.settings",
|
|
76
|
-
title: ( localize2(
|
|
76
|
+
title: ( localize2(20754, "Show Settings"))
|
|
77
77
|
};
|
|
78
78
|
const showSyncedDataCommand = {
|
|
79
79
|
id: "workbench.userDataSync.actions.showSyncedData",
|
|
80
|
-
title: ( localize2(
|
|
80
|
+
title: ( localize2(20755, "Show Synced Data"))
|
|
81
81
|
};
|
|
82
|
-
const CONTEXT_TURNING_ON_STATE =
|
|
82
|
+
const CONTEXT_TURNING_ON_STATE = new RawContextKey("userDataSyncTurningOn", false);
|
|
83
83
|
let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution extends Disposable {
|
|
84
84
|
constructor(
|
|
85
85
|
userDataSyncEnablementService,
|
|
@@ -203,21 +203,21 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
203
203
|
if (!( this.conflictsDisposables.has(key))) {
|
|
204
204
|
const conflictsArea = getSyncAreaLabel(conflict.syncResource);
|
|
205
205
|
const handle = this.notificationService.prompt(Severity.Warning, ( localize(
|
|
206
|
-
|
|
206
|
+
20756,
|
|
207
207
|
"Unable to sync due to conflicts in {0}. Please resolve them to continue.",
|
|
208
208
|
conflictsArea.toLowerCase()
|
|
209
209
|
)), [{
|
|
210
|
-
label: ( localize(
|
|
210
|
+
label: ( localize(20757, "Replace Remote")),
|
|
211
211
|
run: () => {
|
|
212
212
|
this.acceptLocal(conflict, conflict.conflicts[0]);
|
|
213
213
|
}
|
|
214
214
|
}, {
|
|
215
|
-
label: ( localize(
|
|
215
|
+
label: ( localize(20758, "Replace Local")),
|
|
216
216
|
run: () => {
|
|
217
217
|
this.acceptRemote(conflict, conflict.conflicts[0]);
|
|
218
218
|
}
|
|
219
219
|
}, {
|
|
220
|
-
label: ( localize(
|
|
220
|
+
label: ( localize(20759, "Show Conflicts")),
|
|
221
221
|
run: () => {
|
|
222
222
|
this.telemetryService.publicLog2("sync/showConflicts", {
|
|
223
223
|
source: conflict.syncResource
|
|
@@ -248,7 +248,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
248
248
|
);
|
|
249
249
|
} catch (e) {
|
|
250
250
|
this.notificationService.error(( localize(
|
|
251
|
-
|
|
251
|
+
20760,
|
|
252
252
|
"Error while accepting changes. Please check [logs]({0}) for more details.",
|
|
253
253
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
254
254
|
)));
|
|
@@ -264,7 +264,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
264
264
|
);
|
|
265
265
|
} catch (e) {
|
|
266
266
|
this.notificationService.error(( localize(
|
|
267
|
-
|
|
267
|
+
20760,
|
|
268
268
|
"Error while accepting changes. Please check [logs]({0}) for more details.",
|
|
269
269
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
270
270
|
)));
|
|
@@ -276,13 +276,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
276
276
|
this.notificationService.notify({
|
|
277
277
|
severity: Severity.Info,
|
|
278
278
|
message: ( localize(
|
|
279
|
-
|
|
279
|
+
20761,
|
|
280
280
|
"Settings sync was turned off because current session is expired, please sign in again to turn on sync."
|
|
281
281
|
)),
|
|
282
282
|
actions: {
|
|
283
283
|
primary: [toAction({
|
|
284
284
|
id: "turn on sync",
|
|
285
|
-
label: ( localize(
|
|
285
|
+
label: ( localize(20762, "Turn on Settings Sync...")),
|
|
286
286
|
run: () => this.turnOn()
|
|
287
287
|
})]
|
|
288
288
|
}
|
|
@@ -292,13 +292,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
292
292
|
this.notificationService.notify({
|
|
293
293
|
severity: Severity.Info,
|
|
294
294
|
message: ( localize(
|
|
295
|
-
|
|
295
|
+
20763,
|
|
296
296
|
"Settings sync was turned off from another device, please turn on sync again."
|
|
297
297
|
)),
|
|
298
298
|
actions: {
|
|
299
299
|
primary: [toAction({
|
|
300
300
|
id: "turn on sync",
|
|
301
|
-
label: ( localize(
|
|
301
|
+
label: ( localize(20762, "Turn on Settings Sync...")),
|
|
302
302
|
run: () => this.turnOn()
|
|
303
303
|
})]
|
|
304
304
|
}
|
|
@@ -309,7 +309,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
309
309
|
this.disableSync(error.resource);
|
|
310
310
|
const sourceArea = getSyncAreaLabel(error.resource);
|
|
311
311
|
this.handleTooLargeError(error.resource, ( localize(
|
|
312
|
-
|
|
312
|
+
20764,
|
|
313
313
|
"Disabled syncing {0} because size of the {1} file to sync is larger than {2}. Please open the file and reduce the size and enable sync",
|
|
314
314
|
sourceArea.toLowerCase(),
|
|
315
315
|
sourceArea.toLowerCase(),
|
|
@@ -320,7 +320,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
320
320
|
case UserDataSyncErrorCode.LocalTooManyProfiles:
|
|
321
321
|
this.disableSync(SyncResource.Profiles);
|
|
322
322
|
this.notificationService.error(( localize(
|
|
323
|
-
|
|
323
|
+
20765,
|
|
324
324
|
"Disabled syncing profiles because there are too many profiles to sync. Settings Sync supports syncing maximum 20 profiles. Please reduce the number of profiles and enable sync"
|
|
325
325
|
)));
|
|
326
326
|
break;
|
|
@@ -329,12 +329,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
329
329
|
case UserDataSyncErrorCode.UpgradeRequired:
|
|
330
330
|
{
|
|
331
331
|
const message = ( localize(
|
|
332
|
-
|
|
332
|
+
20766,
|
|
333
333
|
"Settings sync is disabled because the current version ({0}, {1}) is not compatible with the sync service. Please update before turning on sync.",
|
|
334
334
|
this.productService.version,
|
|
335
335
|
this.productService.commit
|
|
336
336
|
));
|
|
337
|
-
const operationId = error.operationId ? ( localize(
|
|
337
|
+
const operationId = error.operationId ? ( localize(20767, "Operation Id: {0}", error.operationId)) : undefined;
|
|
338
338
|
this.notificationService.notify({
|
|
339
339
|
severity: Severity.Error,
|
|
340
340
|
message: operationId ? `${message} ${operationId}` : message
|
|
@@ -344,21 +344,21 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
344
344
|
case UserDataSyncErrorCode.MethodNotFound:
|
|
345
345
|
{
|
|
346
346
|
const message = ( localize(
|
|
347
|
-
|
|
347
|
+
20768,
|
|
348
348
|
"Settings sync is disabled because the client is making invalid requests. Please report an issue with the logs."
|
|
349
349
|
));
|
|
350
|
-
const operationId = error.operationId ? ( localize(
|
|
350
|
+
const operationId = error.operationId ? ( localize(20767, "Operation Id: {0}", error.operationId)) : undefined;
|
|
351
351
|
this.notificationService.notify({
|
|
352
352
|
severity: Severity.Error,
|
|
353
353
|
message: operationId ? `${message} ${operationId}` : message,
|
|
354
354
|
actions: {
|
|
355
355
|
primary: [toAction({
|
|
356
356
|
id: "Show Sync Logs",
|
|
357
|
-
label: ( localize(
|
|
357
|
+
label: ( localize(20769, "Show Log")),
|
|
358
358
|
run: () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID)
|
|
359
359
|
}), toAction({
|
|
360
360
|
id: "Report Issue",
|
|
361
|
-
label: ( localize(
|
|
361
|
+
label: ( localize(20770, "Report Issue")),
|
|
362
362
|
run: () => this.workbenchIssueService.openReporter()
|
|
363
363
|
})]
|
|
364
364
|
}
|
|
@@ -369,17 +369,17 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
369
369
|
this.notificationService.notify({
|
|
370
370
|
severity: Severity.Error,
|
|
371
371
|
message: ( localize(
|
|
372
|
-
|
|
372
|
+
20771,
|
|
373
373
|
"Settings sync is disabled because your data in the cloud is older than that of the client. Please clear your data in the cloud before turning on sync."
|
|
374
374
|
)),
|
|
375
375
|
actions: {
|
|
376
376
|
primary: [toAction({
|
|
377
377
|
id: "reset",
|
|
378
|
-
label: ( localize(
|
|
378
|
+
label: ( localize(20772, "Clear Data in Cloud...")),
|
|
379
379
|
run: () => this.userDataSyncWorkbenchService.resetSyncedData()
|
|
380
380
|
}), toAction({
|
|
381
381
|
id: "show synced data",
|
|
382
|
-
label: ( localize(
|
|
382
|
+
label: ( localize(20773, "Show Synced Data")),
|
|
383
383
|
run: () => this.userDataSyncWorkbenchService.showSyncActivity()
|
|
384
384
|
})]
|
|
385
385
|
}
|
|
@@ -388,7 +388,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
388
388
|
case UserDataSyncErrorCode.ServiceChanged:
|
|
389
389
|
this.notificationService.notify({
|
|
390
390
|
severity: Severity.Info,
|
|
391
|
-
message: this.userDataSyncStoreManagementService.userDataSyncStore?.type === "insiders" ? ( localize(
|
|
391
|
+
message: this.userDataSyncStoreManagementService.userDataSyncStore?.type === "insiders" ? ( localize(20774, "Settings Sync has been switched to insiders service")) : ( localize(20775, "Settings Sync has been switched to stable service"))
|
|
392
392
|
});
|
|
393
393
|
return;
|
|
394
394
|
case UserDataSyncErrorCode.DefaultServiceChanged:
|
|
@@ -396,7 +396,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
396
396
|
this.notificationService.notify({
|
|
397
397
|
severity: Severity.Info,
|
|
398
398
|
message: ( localize(
|
|
399
|
-
|
|
399
|
+
20776,
|
|
400
400
|
"Settings sync now uses a separate service, more information is available in the [Settings Sync Documentation](https://aka.ms/vscode-settings-sync-help#_syncing-stable-versus-insiders)."
|
|
401
401
|
))
|
|
402
402
|
});
|
|
@@ -405,14 +405,14 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
405
405
|
this.notificationService.notify({
|
|
406
406
|
severity: Severity.Info,
|
|
407
407
|
message: ( localize(
|
|
408
|
-
|
|
408
|
+
20777,
|
|
409
409
|
"Settings sync was turned off because {0} now uses a separate service. Please turn on sync again.",
|
|
410
410
|
this.productService.nameLong
|
|
411
411
|
)),
|
|
412
412
|
actions: {
|
|
413
413
|
primary: [toAction({
|
|
414
414
|
id: "turn on sync",
|
|
415
|
-
label: ( localize(
|
|
415
|
+
label: ( localize(20762, "Turn on Settings Sync...")),
|
|
416
416
|
run: () => this.turnOn()
|
|
417
417
|
})]
|
|
418
418
|
}
|
|
@@ -422,14 +422,14 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
handleTooLargeError(resource, message, error) {
|
|
425
|
-
const operationId = error.operationId ? ( localize(
|
|
425
|
+
const operationId = error.operationId ? ( localize(20767, "Operation Id: {0}", error.operationId)) : undefined;
|
|
426
426
|
this.notificationService.notify({
|
|
427
427
|
severity: Severity.Error,
|
|
428
428
|
message: operationId ? `${message} ${operationId}` : message,
|
|
429
429
|
actions: {
|
|
430
430
|
primary: [toAction({
|
|
431
431
|
id: "open sync file",
|
|
432
|
-
label: ( localize(
|
|
432
|
+
label: ( localize(20778, "Open {0} File", getSyncAreaLabel(resource))),
|
|
433
433
|
run: () => resource === SyncResource.Settings ? this.preferencesService.openUserSettings({
|
|
434
434
|
jsonEditor: true
|
|
435
435
|
}) : this.preferencesService.openGlobalKeybindingSettings(true)
|
|
@@ -497,14 +497,14 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
497
497
|
const handle = this.notificationService.notify({
|
|
498
498
|
severity: Severity.Error,
|
|
499
499
|
message: ( localize(
|
|
500
|
-
|
|
500
|
+
20779,
|
|
501
501
|
"Unable to sync {0} because the content in the file is not valid. Please open the file and correct it.",
|
|
502
502
|
errorArea.toLowerCase()
|
|
503
503
|
)),
|
|
504
504
|
actions: {
|
|
505
505
|
primary: [toAction({
|
|
506
506
|
id: "open sync file",
|
|
507
|
-
label: ( localize(
|
|
507
|
+
label: ( localize(20778, "Open {0} File", errorArea)),
|
|
508
508
|
run: () => source === SyncResource.Settings ? this.preferencesService.openUserSettings({
|
|
509
509
|
jsonEditor: true
|
|
510
510
|
}) : this.preferencesService.openGlobalKeybindingSettings(true)
|
|
@@ -530,9 +530,9 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
530
530
|
this.globalActivityBadgeDisposable.clear();
|
|
531
531
|
let badge = undefined;
|
|
532
532
|
if (this.userDataSyncService.conflicts.length && this.userDataSyncEnablementService.isEnabled()) {
|
|
533
|
-
badge = ( new NumberBadge(this.getConflictsCount(), () => ( localize(
|
|
533
|
+
badge = ( new NumberBadge(this.getConflictsCount(), () => ( localize(20780, "{0}: Conflicts Detected", SYNC_TITLE.value))));
|
|
534
534
|
} else if (this.turningOnSync) {
|
|
535
|
-
badge = ( new ProgressBadge(() => ( localize(
|
|
535
|
+
badge = ( new ProgressBadge(() => ( localize(20781, "Turning on Settings Sync..."))));
|
|
536
536
|
}
|
|
537
537
|
if (badge) {
|
|
538
538
|
this.globalActivityBadgeDisposable.value = this.activityService.showGlobalActivity({
|
|
@@ -544,7 +544,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
544
544
|
this.accountBadgeDisposable.clear();
|
|
545
545
|
let badge = undefined;
|
|
546
546
|
if (this.userDataSyncService.status !== SyncStatus.Uninitialized && this.userDataSyncEnablementService.isEnabled() && this.userDataSyncWorkbenchService.accountStatus === AccountStatus.Unavailable) {
|
|
547
|
-
badge = ( new NumberBadge(1, () => ( localize(
|
|
547
|
+
badge = ( new NumberBadge(1, () => ( localize(20782, "Sign in to Sync Settings"))));
|
|
548
548
|
}
|
|
549
549
|
if (badge) {
|
|
550
550
|
this.accountBadgeDisposable.value = this.activityService.showAccountsActivity({
|
|
@@ -555,7 +555,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
555
555
|
async turnOn() {
|
|
556
556
|
try {
|
|
557
557
|
if (!this.userDataSyncWorkbenchService.authenticationProviders.length) {
|
|
558
|
-
throw ( new Error(( localize(
|
|
558
|
+
throw ( new Error(( localize(20783, "No authentication providers are available."))));
|
|
559
559
|
}
|
|
560
560
|
const turnOn = await this.askToConfigure();
|
|
561
561
|
if (!turnOn) {
|
|
@@ -574,7 +574,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
574
574
|
case UserDataSyncErrorCode.TooLarge:
|
|
575
575
|
if (e.resource === SyncResource.Keybindings || e.resource === SyncResource.Settings || e.resource === SyncResource.Tasks) {
|
|
576
576
|
this.handleTooLargeError(e.resource, ( localize(
|
|
577
|
-
|
|
577
|
+
20784,
|
|
578
578
|
"Settings sync cannot be turned on because size of the {0} file to sync is larger than {1}. Please open the file and reduce the size and turn on sync",
|
|
579
579
|
getSyncAreaLabel(e.resource).toLowerCase(),
|
|
580
580
|
"100kb"
|
|
@@ -587,12 +587,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
587
587
|
case UserDataSyncErrorCode.UpgradeRequired:
|
|
588
588
|
{
|
|
589
589
|
const message = ( localize(
|
|
590
|
-
|
|
590
|
+
20785,
|
|
591
591
|
"Settings sync cannot be turned on because the current version ({0}, {1}) is not compatible with the sync service. Please update before turning on sync.",
|
|
592
592
|
this.productService.version,
|
|
593
593
|
this.productService.commit
|
|
594
594
|
));
|
|
595
|
-
const operationId = e.operationId ? ( localize(
|
|
595
|
+
const operationId = e.operationId ? ( localize(20767, "Operation Id: {0}", e.operationId)) : undefined;
|
|
596
596
|
this.notificationService.notify({
|
|
597
597
|
severity: Severity.Error,
|
|
598
598
|
message: operationId ? `${message} ${operationId}` : message
|
|
@@ -603,17 +603,17 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
603
603
|
this.notificationService.notify({
|
|
604
604
|
severity: Severity.Error,
|
|
605
605
|
message: ( localize(
|
|
606
|
-
|
|
606
|
+
20786,
|
|
607
607
|
"Settings sync cannot be turned on because your data in the cloud is older than that of the client. Please clear your data in the cloud before turning on sync."
|
|
608
608
|
)),
|
|
609
609
|
actions: {
|
|
610
610
|
primary: [toAction({
|
|
611
611
|
id: "reset",
|
|
612
|
-
label: ( localize(
|
|
612
|
+
label: ( localize(20772, "Clear Data in Cloud...")),
|
|
613
613
|
run: () => this.userDataSyncWorkbenchService.resetSyncedData()
|
|
614
614
|
}), toAction({
|
|
615
615
|
id: "show synced data",
|
|
616
|
-
label: ( localize(
|
|
616
|
+
label: ( localize(20773, "Show Synced Data")),
|
|
617
617
|
run: () => this.userDataSyncWorkbenchService.showSyncActivity()
|
|
618
618
|
})]
|
|
619
619
|
}
|
|
@@ -621,16 +621,16 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
621
621
|
return;
|
|
622
622
|
case UserDataSyncErrorCode.Unauthorized:
|
|
623
623
|
case UserDataSyncErrorCode.Forbidden:
|
|
624
|
-
this.notificationService.error(( localize(
|
|
624
|
+
this.notificationService.error(( localize(20787, "Error while turning on Settings Sync: Authentication failed.")));
|
|
625
625
|
return;
|
|
626
626
|
}
|
|
627
627
|
this.notificationService.error(( localize(
|
|
628
|
-
|
|
628
|
+
20788,
|
|
629
629
|
"Error while turning on Settings Sync. Please check [logs]({0}) for more details.",
|
|
630
630
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
631
631
|
)));
|
|
632
632
|
} else {
|
|
633
|
-
this.notificationService.error(( localize(
|
|
633
|
+
this.notificationService.error(( localize(20789, "Error while turning on Settings Sync. {0}", getErrorMessage(e))));
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
}
|
|
@@ -642,8 +642,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
642
642
|
quickPick.title = SYNC_TITLE.value;
|
|
643
643
|
quickPick.ok = false;
|
|
644
644
|
quickPick.customButton = true;
|
|
645
|
-
quickPick.customLabel = ( localize(
|
|
646
|
-
quickPick.description = ( localize(
|
|
645
|
+
quickPick.customLabel = ( localize(20790, "Sign in"));
|
|
646
|
+
quickPick.description = ( localize(20791, "Please sign in to backup and sync your data across devices."));
|
|
647
647
|
quickPick.canSelectMany = true;
|
|
648
648
|
quickPick.ignoreFocusOut = true;
|
|
649
649
|
quickPick.hideInput = true;
|
|
@@ -718,8 +718,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
718
718
|
const disposables = ( new DisposableStore());
|
|
719
719
|
const quickPick = this.quickInputService.createQuickPick();
|
|
720
720
|
disposables.add(quickPick);
|
|
721
|
-
quickPick.title = ( localize(
|
|
722
|
-
quickPick.placeholder = ( localize(
|
|
721
|
+
quickPick.title = ( localize(20792, "{0}: Configure...", SYNC_TITLE.value));
|
|
722
|
+
quickPick.placeholder = ( localize(20793, "Choose what to sync"));
|
|
723
723
|
quickPick.canSelectMany = true;
|
|
724
724
|
quickPick.ignoreFocusOut = true;
|
|
725
725
|
quickPick.ok = true;
|
|
@@ -741,15 +741,15 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
741
741
|
}
|
|
742
742
|
async turnOff() {
|
|
743
743
|
const result = await this.dialogService.confirm({
|
|
744
|
-
message: ( localize(
|
|
744
|
+
message: ( localize(20794, "Do you want to turn off sync?")),
|
|
745
745
|
detail: ( localize(
|
|
746
|
-
|
|
746
|
+
20795,
|
|
747
747
|
"Your settings, keybindings, extensions, snippets and UI State will no longer be synced."
|
|
748
748
|
)),
|
|
749
|
-
primaryButton: ( localize(
|
|
749
|
+
primaryButton: ( localize(20796, "&&Turn off")),
|
|
750
750
|
checkbox: this.userDataSyncWorkbenchService.accountStatus === AccountStatus.Available ? {
|
|
751
751
|
label: ( localize(
|
|
752
|
-
|
|
752
|
+
20797,
|
|
753
753
|
"Turn off sync on all your devices and clear the data from the cloud."
|
|
754
754
|
))
|
|
755
755
|
} : undefined
|
|
@@ -783,9 +783,9 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
783
783
|
return (new Promise((c, e) => {
|
|
784
784
|
const disposables = ( new DisposableStore());
|
|
785
785
|
const quickPick = disposables.add(this.quickInputService.createQuickPick());
|
|
786
|
-
quickPick.title = ( localize(
|
|
786
|
+
quickPick.title = ( localize(20798, "{0}: Select Service", SYNC_TITLE.value));
|
|
787
787
|
quickPick.description = ( localize(
|
|
788
|
-
|
|
788
|
+
20799,
|
|
789
789
|
"Ensure you are using the same settings sync service when syncing with multiple environments"
|
|
790
790
|
));
|
|
791
791
|
quickPick.hideInput = true;
|
|
@@ -793,17 +793,17 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
793
793
|
const getDescription = url => {
|
|
794
794
|
const isDefault = isEqual(url, userDataSyncStore.defaultUrl);
|
|
795
795
|
if (isDefault) {
|
|
796
|
-
return localize(
|
|
796
|
+
return localize(20800, "Default");
|
|
797
797
|
}
|
|
798
798
|
return undefined;
|
|
799
799
|
};
|
|
800
800
|
quickPick.items = [{
|
|
801
801
|
id: "insiders",
|
|
802
|
-
label: ( localize(
|
|
802
|
+
label: ( localize(20801, "Insiders")),
|
|
803
803
|
description: getDescription(userDataSyncStore.insidersUrl)
|
|
804
804
|
}, {
|
|
805
805
|
id: "stable",
|
|
806
|
-
label: ( localize(
|
|
806
|
+
label: ( localize(20802, "Stable")),
|
|
807
807
|
description: getDescription(userDataSyncStore.stableUrl)
|
|
808
808
|
}];
|
|
809
809
|
disposables.add(quickPick.onDidAccept(async () => {
|
|
@@ -849,7 +849,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
849
849
|
constructor() {
|
|
850
850
|
super({
|
|
851
851
|
id: "workbench.userDataSync.actions.turnOn",
|
|
852
|
-
title: ( localize2(
|
|
852
|
+
title: ( localize2(20803, "Backup and Sync Settings...")),
|
|
853
853
|
category: SYNC_TITLE,
|
|
854
854
|
f1: true,
|
|
855
855
|
precondition: when,
|
|
@@ -882,7 +882,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
882
882
|
constructor() {
|
|
883
883
|
super({
|
|
884
884
|
id: "workbench.userData.actions.turningOn",
|
|
885
|
-
title: ( localize(
|
|
885
|
+
title: ( localize(20804, "Turning on Settings Sync...")),
|
|
886
886
|
precondition: ( ContextKeyExpr.false()),
|
|
887
887
|
menu: [{
|
|
888
888
|
group: "3_configuration",
|
|
@@ -905,7 +905,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
905
905
|
constructor() {
|
|
906
906
|
super({
|
|
907
907
|
id: "workbench.userData.actions.cancelTurnOn",
|
|
908
|
-
title: ( localize(
|
|
908
|
+
title: ( localize(20805, "Cancel")),
|
|
909
909
|
icon: Codicon.stopCircle,
|
|
910
910
|
menu: {
|
|
911
911
|
id: MenuId.ViewContainerTitle,
|
|
@@ -928,7 +928,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
928
928
|
constructor() {
|
|
929
929
|
super({
|
|
930
930
|
id: "workbench.userData.actions.signin",
|
|
931
|
-
title: ( localize(
|
|
931
|
+
title: ( localize(20806, "Sign in to Sync Settings")),
|
|
932
932
|
menu: {
|
|
933
933
|
group: "3_configuration",
|
|
934
934
|
id: MenuId.GlobalActivity,
|
|
@@ -949,13 +949,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
949
949
|
group: "1_settings",
|
|
950
950
|
command: {
|
|
951
951
|
id,
|
|
952
|
-
title: ( localize(
|
|
952
|
+
title: ( localize(20807, "Sign in to Sync Settings (1)"))
|
|
953
953
|
},
|
|
954
954
|
when
|
|
955
955
|
})));
|
|
956
956
|
}
|
|
957
957
|
getShowConflictsTitle() {
|
|
958
|
-
return localize2(
|
|
958
|
+
return localize2(20808, "Show Conflicts ({0})", this.getConflictsCount());
|
|
959
959
|
}
|
|
960
960
|
registerShowConflictsAction() {
|
|
961
961
|
this.conflictsActionDisposable.value = undefined;
|
|
@@ -995,7 +995,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
995
995
|
constructor() {
|
|
996
996
|
super({
|
|
997
997
|
id: "workbench.userDataSync.actions.manage",
|
|
998
|
-
title: ( localize(
|
|
998
|
+
title: ( localize(20809, "Settings Sync is On")),
|
|
999
999
|
toggled: ContextKeyTrueExpr.INSTANCE,
|
|
1000
1000
|
menu: [{
|
|
1001
1001
|
id: MenuId.GlobalActivity,
|
|
@@ -1137,7 +1137,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1137
1137
|
} catch (e) {
|
|
1138
1138
|
if (!isCancellationError(e)) {
|
|
1139
1139
|
that.notificationService.error(( localize(
|
|
1140
|
-
|
|
1140
|
+
20810,
|
|
1141
1141
|
"Error while turning off Settings Sync. Please check [logs]({0}) for more details.",
|
|
1142
1142
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
1143
1143
|
)));
|
|
@@ -1156,7 +1156,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1156
1156
|
title: configureSyncCommand.title,
|
|
1157
1157
|
category: SYNC_TITLE,
|
|
1158
1158
|
icon: Codicon.settingsGear,
|
|
1159
|
-
tooltip: ( localize(
|
|
1159
|
+
tooltip: ( localize(20811, "Configure...")),
|
|
1160
1160
|
menu: [{
|
|
1161
1161
|
id: MenuId.CommandPalette,
|
|
1162
1162
|
when
|
|
@@ -1179,8 +1179,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1179
1179
|
constructor() {
|
|
1180
1180
|
super({
|
|
1181
1181
|
id: SHOW_SYNC_LOG_COMMAND_ID,
|
|
1182
|
-
title: ( localize(
|
|
1183
|
-
tooltip: ( localize(
|
|
1182
|
+
title: ( localize(20812, "{0}: Show Log", SYNC_TITLE.value)),
|
|
1183
|
+
tooltip: ( localize(20813, "Show Log")),
|
|
1184
1184
|
icon: Codicon.output,
|
|
1185
1185
|
menu: [{
|
|
1186
1186
|
id: MenuId.CommandPalette,
|
|
@@ -1252,7 +1252,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1252
1252
|
constructor() {
|
|
1253
1253
|
super({
|
|
1254
1254
|
id: "workbench.userDataSync.actions.acceptMerges",
|
|
1255
|
-
title: ( localize(
|
|
1255
|
+
title: ( localize(20814, "Complete Merge")),
|
|
1256
1256
|
menu: [{
|
|
1257
1257
|
id: MenuId.EditorContent,
|
|
1258
1258
|
when: ( ContextKeyExpr.and(ctxIsMergeResultEditor, ( ContextKeyExpr.regex(ctxMergeBaseUri.key, ( new RegExp(`^${USER_DATA_SYNC_SCHEME}:`))))))
|
|
@@ -1293,7 +1293,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1293
1293
|
const notificationService = accessor.get(INotificationService);
|
|
1294
1294
|
const folder = await userDataSyncWorkbenchService.downloadSyncActivity();
|
|
1295
1295
|
if (folder) {
|
|
1296
|
-
notificationService.info(( localize(
|
|
1296
|
+
notificationService.info(( localize(20815, "Successfully downloaded Settings Sync activity.")));
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
1299
|
}));
|
|
@@ -1319,7 +1319,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1319
1319
|
constructor() {
|
|
1320
1320
|
super({
|
|
1321
1321
|
id: "workbench.actions.syncData.reset",
|
|
1322
|
-
title: ( localize(
|
|
1322
|
+
title: ( localize(20816, "Clear Data in Cloud...")),
|
|
1323
1323
|
menu: [{
|
|
1324
1324
|
id: MenuId.ViewContainerTitle,
|
|
1325
1325
|
when: ( ContextKeyExpr.equals("viewContainer", SYNC_VIEW_CONTAINER_ID)),
|
|
@@ -76,7 +76,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
76
76
|
renderTreeView(container) {
|
|
77
77
|
super.renderTreeView(append(container, $("")));
|
|
78
78
|
const that = this;
|
|
79
|
-
this.treeView.message = ( localize(
|
|
79
|
+
this.treeView.message = ( localize(20817, "Please go through each entry and merge to resolve conflicts."));
|
|
80
80
|
this.treeView.dataProvider = {
|
|
81
81
|
getChildren() {
|
|
82
82
|
return that.getTreeItems();
|
|
@@ -85,11 +85,11 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
85
85
|
}
|
|
86
86
|
async getTreeItems() {
|
|
87
87
|
const roots = [];
|
|
88
|
-
const conflictResources =
|
|
88
|
+
const conflictResources = this.userDataSyncService.conflicts.map(conflict => conflict.conflicts.map(resourcePreview => ({
|
|
89
89
|
...resourcePreview,
|
|
90
90
|
syncResource: conflict.syncResource,
|
|
91
91
|
profile: conflict.profile
|
|
92
|
-
})))
|
|
92
|
+
}))).flat().sort(
|
|
93
93
|
(a, b) => a.profile.id === b.profile.id ? 0 : a.profile.isDefault ? -1 : b.profile.isDefault ? 1 : a.profile.name.localeCompare(b.profile.name)
|
|
94
94
|
);
|
|
95
95
|
const conflictResourcesByProfile = [];
|
|
@@ -157,7 +157,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
157
157
|
constructor() {
|
|
158
158
|
super({
|
|
159
159
|
id: `workbench.actions.sync.openConflicts`,
|
|
160
|
-
title: ( localize(
|
|
160
|
+
title: ( localize(20818, "Show Conflicts"))
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
async run(accessor, handle) {
|
|
@@ -169,7 +169,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
169
169
|
constructor() {
|
|
170
170
|
super({
|
|
171
171
|
id: `workbench.actions.sync.acceptRemote`,
|
|
172
|
-
title: ( localize(
|
|
172
|
+
title: ( localize(20819, "Accept Remote")),
|
|
173
173
|
icon: Codicon.cloudDownload,
|
|
174
174
|
menu: {
|
|
175
175
|
id: MenuId.ViewItemContext,
|
|
@@ -191,7 +191,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
191
191
|
constructor() {
|
|
192
192
|
super({
|
|
193
193
|
id: `workbench.actions.sync.acceptLocal`,
|
|
194
|
-
title: ( localize(
|
|
194
|
+
title: ( localize(20820, "Accept Local")),
|
|
195
195
|
icon: Codicon.cloudUpload,
|
|
196
196
|
menu: {
|
|
197
197
|
id: MenuId.ViewItemContext,
|
|
@@ -222,17 +222,17 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
222
222
|
) => isEqual(localResource, conflictToOpen.localResource)))))) {
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
const remoteResourceName = ( localize(
|
|
226
|
-
const localResourceName = ( localize(
|
|
225
|
+
const remoteResourceName = ( localize(20821, "{0} (Remote)", basename(conflictToOpen.remoteResource)));
|
|
226
|
+
const localResourceName = ( localize(20822, "{0} (Local)", basename(conflictToOpen.remoteResource)));
|
|
227
227
|
await this.editorService.openEditor({
|
|
228
228
|
input1: {
|
|
229
229
|
resource: conflictToOpen.remoteResource,
|
|
230
|
-
label: ( localize(
|
|
230
|
+
label: ( localize(20823, "Theirs")),
|
|
231
231
|
description: remoteResourceName
|
|
232
232
|
},
|
|
233
233
|
input2: {
|
|
234
234
|
resource: conflictToOpen.localResource,
|
|
235
|
-
label: ( localize(
|
|
235
|
+
label: ( localize(20824, "Yours")),
|
|
236
236
|
description: localResourceName
|
|
237
237
|
},
|
|
238
238
|
base: {
|
|
@@ -23,15 +23,18 @@ let UserDataSyncTrigger = class UserDataSyncTrigger extends Disposable {
|
|
|
23
23
|
) {
|
|
24
24
|
super();
|
|
25
25
|
this.userDataProfilesService = userDataProfilesService;
|
|
26
|
-
const event = Event.filter(Event.any(
|
|
26
|
+
const event = Event.filter(Event.any(Event.map(
|
|
27
27
|
editorService.onDidActiveEditorChange,
|
|
28
28
|
() => this.getUserDataEditorInputSource(editorService.activeEditor)
|
|
29
|
-
)
|
|
29
|
+
), Event.map(Event.filter(
|
|
30
30
|
viewsService.onDidChangeViewContainerVisibility,
|
|
31
31
|
e => e.id === VIEWLET_ID && e.visible
|
|
32
|
-
), e => e.id))
|
|
32
|
+
), e => e.id)), source => source !== undefined);
|
|
33
33
|
if (isWeb) {
|
|
34
|
-
this._register(Event.debounce(Event.any(
|
|
34
|
+
this._register(Event.debounce(Event.any(
|
|
35
|
+
Event.map(hostService.onDidChangeFocus, () => "windowFocus"),
|
|
36
|
+
Event.map(event, source => source)
|
|
37
|
+
), (last, source) => last ? [...last, source] : [source], 1000)(sources => userDataAutoSyncService.triggerSync(sources, {
|
|
35
38
|
skipIfSyncedRecently: true
|
|
36
39
|
})));
|
|
37
40
|
} else {
|