@codingame/monaco-vscode-user-data-sync-service-override 11.0.0 → 11.0.2
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/package.json +4 -4
- package/vscode/src/vs/platform/userDataSync/common/userDataAutoSyncService.js +7 -7
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncLog.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncResourceProvider.js +1 -1
- 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/userDataSyncViews.js +30 -30
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js +37 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-user-data-sync-service-override",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@11.0.
|
|
30
|
-
"@codingame/monaco-vscode-user-data-profile-service-override": "11.0.
|
|
31
|
-
"@codingame/monaco-vscode-user-data-profile-user-data-sync-common": "11.0.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@11.0.2",
|
|
30
|
+
"@codingame/monaco-vscode-user-data-profile-service-override": "11.0.2",
|
|
31
|
+
"@codingame/monaco-vscode-user-data-profile-user-data-sync-common": "11.0.2"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -407,20 +407,20 @@ class AutoSync extends Disposable {
|
|
|
407
407
|
if (this.hasSyncServiceChanged()) {
|
|
408
408
|
if (await this.hasDefaultServiceChanged()) {
|
|
409
409
|
throw ( new UserDataAutoSyncError(
|
|
410
|
-
localize(
|
|
410
|
+
localize(3496, "Cannot sync because default service has changed"),
|
|
411
411
|
"DefaultServiceChanged"
|
|
412
412
|
));
|
|
413
413
|
}
|
|
414
414
|
else {
|
|
415
415
|
throw ( new UserDataAutoSyncError(
|
|
416
|
-
localize(
|
|
416
|
+
localize(3497, "Cannot sync because sync service has changed"),
|
|
417
417
|
"ServiceChanged"
|
|
418
418
|
));
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
else {
|
|
422
422
|
throw ( new UserDataAutoSyncError(
|
|
423
|
-
localize(
|
|
423
|
+
localize(3498, "Cannot sync because syncing is turned off in the cloud"),
|
|
424
424
|
"TurnedOff"
|
|
425
425
|
));
|
|
426
426
|
}
|
|
@@ -430,20 +430,20 @@ class AutoSync extends Disposable {
|
|
|
430
430
|
if (this.hasSyncServiceChanged()) {
|
|
431
431
|
if (await this.hasDefaultServiceChanged()) {
|
|
432
432
|
throw ( new UserDataAutoSyncError(
|
|
433
|
-
localize(
|
|
433
|
+
localize(3496, "Cannot sync because default service has changed"),
|
|
434
434
|
"DefaultServiceChanged"
|
|
435
435
|
));
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
438
438
|
throw ( new UserDataAutoSyncError(
|
|
439
|
-
localize(
|
|
439
|
+
localize(3497, "Cannot sync because sync service has changed"),
|
|
440
440
|
"ServiceChanged"
|
|
441
441
|
));
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
else {
|
|
445
445
|
throw ( new UserDataAutoSyncError(
|
|
446
|
-
localize(
|
|
446
|
+
localize(3499, "Cannot sync because current session is expired"),
|
|
447
447
|
"SessionExpired"
|
|
448
448
|
));
|
|
449
449
|
}
|
|
@@ -455,7 +455,7 @@ class AutoSync extends Disposable {
|
|
|
455
455
|
const currentMachine = machines.find(machine => machine.isCurrent);
|
|
456
456
|
if (currentMachine?.disabled) {
|
|
457
457
|
throw ( new UserDataAutoSyncError(localize(
|
|
458
|
-
|
|
458
|
+
3500,
|
|
459
459
|
"Cannot sync because syncing is turned off on this machine from another machine."
|
|
460
460
|
), "TurnedOff" ));
|
|
461
461
|
}
|
|
@@ -9,7 +9,7 @@ import { USER_DATA_SYNC_LOG_ID } from 'vscode/vscode/vs/platform/userDataSync/co
|
|
|
9
9
|
let UserDataSyncLogService = class UserDataSyncLogService extends AbstractLogger {
|
|
10
10
|
constructor(loggerService, environmentService) {
|
|
11
11
|
super();
|
|
12
|
-
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${USER_DATA_SYNC_LOG_ID}.log`), { id: USER_DATA_SYNC_LOG_ID, name: ( localize(
|
|
12
|
+
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${USER_DATA_SYNC_LOG_ID}.log`), { id: USER_DATA_SYNC_LOG_ID, name: ( localize(3502, "Settings Sync")) }));
|
|
13
13
|
}
|
|
14
14
|
trace(message, ...args) {
|
|
15
15
|
this.logger.trace(message, ...args);
|
|
@@ -428,7 +428,7 @@ let UserDataSyncResourceProviderService = class UserDataSyncResourceProviderServ
|
|
|
428
428
|
this.logService.error(error);
|
|
429
429
|
}
|
|
430
430
|
throw ( new UserDataSyncError(localize(
|
|
431
|
-
|
|
431
|
+
3501,
|
|
432
432
|
"Cannot parse sync data as it is not compatible with the current version."
|
|
433
433
|
), "IncompatibleRemoteContent" , syncResource));
|
|
434
434
|
}
|
|
@@ -29,12 +29,12 @@ let UserDataSyncReportIssueContribution = class UserDataSyncReportIssueContribut
|
|
|
29
29
|
switch (error.code) {
|
|
30
30
|
case "LocalTooManyRequests" : {
|
|
31
31
|
const message = isWeb ? ( localize(
|
|
32
|
-
|
|
32
|
+
3528,
|
|
33
33
|
"Settings sync is suspended temporarily because the current device is making too many requests. Please reload {0} to resume.",
|
|
34
34
|
this.productService.nameLong
|
|
35
35
|
))
|
|
36
36
|
: ( localize(
|
|
37
|
-
|
|
37
|
+
3529,
|
|
38
38
|
"Settings sync is suspended temporarily because the current device is making too many requests. Please restart {0} to resume.",
|
|
39
39
|
this.productService.nameLong
|
|
40
40
|
));
|
|
@@ -43,26 +43,26 @@ let UserDataSyncReportIssueContribution = class UserDataSyncReportIssueContribut
|
|
|
43
43
|
message,
|
|
44
44
|
actions: {
|
|
45
45
|
primary: [
|
|
46
|
-
( (new Action('Show Sync Logs', ( localize(
|
|
47
|
-
( (new Action('Restart', isWeb ? ( localize(
|
|
46
|
+
( (new Action('Show Sync Logs', ( localize(3530, "Show Log")), undefined, true, () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID)))),
|
|
47
|
+
( (new Action('Restart', isWeb ? ( localize(3531, "Reload")) : ( localize(3532, "Restart")), undefined, true, () => this.hostService.restart())))
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
case "RemoteTooManyRequests" : {
|
|
54
|
-
const operationId = error.operationId ? ( localize(
|
|
54
|
+
const operationId = error.operationId ? ( localize(3533, "Operation Id: {0}", error.operationId)) : undefined;
|
|
55
55
|
const message = ( localize(
|
|
56
|
-
|
|
56
|
+
3534,
|
|
57
57
|
"Settings sync is disabled because the current device is making too many requests. Please wait for 10 minutes and turn on sync."
|
|
58
58
|
));
|
|
59
59
|
this.notificationService.notify({
|
|
60
60
|
severity: Severity$1.Error,
|
|
61
61
|
message: operationId ? `${message} ${operationId}` : message,
|
|
62
|
-
source: error.operationId ? ( localize(
|
|
62
|
+
source: error.operationId ? ( localize(3535, "Settings Sync. Operation Id: {0}", error.operationId)) : undefined,
|
|
63
63
|
actions: {
|
|
64
64
|
primary: [
|
|
65
|
-
( (new Action('Show Sync Logs', ( localize(
|
|
65
|
+
( (new Action('Show Sync Logs', ( localize(3530, "Show Log")), undefined, true, () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID)))),
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
});
|
|
@@ -48,24 +48,24 @@ import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/use
|
|
|
48
48
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
49
49
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
50
50
|
|
|
51
|
-
const turnOffSyncCommand = { id: 'workbench.userDataSync.actions.turnOff', title: ( localize2(
|
|
52
|
-
const configureSyncCommand = { id: CONFIGURE_SYNC_COMMAND_ID, title: ( localize2(
|
|
51
|
+
const turnOffSyncCommand = { id: 'workbench.userDataSync.actions.turnOff', title: ( localize2(8669, 'Turn Off')) };
|
|
52
|
+
const configureSyncCommand = { id: CONFIGURE_SYNC_COMMAND_ID, title: ( localize2(8670, 'Configure...')) };
|
|
53
53
|
const showConflictsCommandId = 'workbench.userDataSync.actions.showConflicts';
|
|
54
54
|
const syncNowCommand = {
|
|
55
55
|
id: 'workbench.userDataSync.actions.syncNow',
|
|
56
|
-
title: ( localize2(
|
|
56
|
+
title: ( localize2(8671, 'Sync Now')),
|
|
57
57
|
description(userDataSyncService) {
|
|
58
58
|
if (userDataSyncService.status === "syncing" ) {
|
|
59
|
-
return ( localize(
|
|
59
|
+
return ( localize(8672, "syncing"));
|
|
60
60
|
}
|
|
61
61
|
if (userDataSyncService.lastSyncTime) {
|
|
62
|
-
return ( localize(
|
|
62
|
+
return ( localize(8673, "synced {0}", fromNow(userDataSyncService.lastSyncTime, true)));
|
|
63
63
|
}
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
const showSyncSettingsCommand = { id: 'workbench.userDataSync.actions.settings', title: ( localize2(
|
|
68
|
-
const showSyncedDataCommand = { id: 'workbench.userDataSync.actions.showSyncedData', title: ( localize2(
|
|
67
|
+
const showSyncSettingsCommand = { id: 'workbench.userDataSync.actions.settings', title: ( localize2(8674, 'Show Settings')), };
|
|
68
|
+
const showSyncedDataCommand = { id: 'workbench.userDataSync.actions.showSyncedData', title: ( localize2(8675, 'Show Synced Data')), };
|
|
69
69
|
const CONTEXT_TURNING_ON_STATE = ( (new RawContextKey('userDataSyncTurningOn', false)));
|
|
70
70
|
let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution extends Disposable {
|
|
71
71
|
constructor(userDataSyncEnablementService, userDataSyncService, userDataSyncWorkbenchService, contextKeyService, activityService, notificationService, editorService, userDataProfileService, dialogService, quickInputService, instantiationService, outputService, userDataAutoSyncService, textModelResolverService, preferencesService, telemetryService, productService, openerService, authenticationService, userDataSyncStoreManagementService, hostService, commandService, workbenchIssueService) {
|
|
@@ -143,26 +143,26 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
143
143
|
if (!( (this.conflictsDisposables.has(key)))) {
|
|
144
144
|
const conflictsArea = getSyncAreaLabel(conflict.syncResource);
|
|
145
145
|
const handle = this.notificationService.prompt(Severity$1.Warning, ( localize(
|
|
146
|
-
|
|
146
|
+
8676,
|
|
147
147
|
"Unable to sync due to conflicts in {0}. Please resolve them to continue.",
|
|
148
148
|
conflictsArea.toLowerCase()
|
|
149
149
|
)), [
|
|
150
150
|
{
|
|
151
|
-
label: ( localize(
|
|
151
|
+
label: ( localize(8677, "Replace Remote")),
|
|
152
152
|
run: () => {
|
|
153
153
|
this.telemetryService.publicLog2('sync/handleConflicts', { source: conflict.syncResource, action: 'acceptLocal' });
|
|
154
154
|
this.acceptLocal(conflict, conflict.conflicts[0]);
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
|
-
label: ( localize(
|
|
158
|
+
label: ( localize(8678, "Replace Local")),
|
|
159
159
|
run: () => {
|
|
160
160
|
this.telemetryService.publicLog2('sync/handleConflicts', { source: conflict.syncResource, action: 'acceptRemote' });
|
|
161
161
|
this.acceptRemote(conflict, conflict.conflicts[0]);
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
label: ( localize(
|
|
165
|
+
label: ( localize(8679, "Show Conflicts")),
|
|
166
166
|
run: () => {
|
|
167
167
|
this.telemetryService.publicLog2('sync/showConflicts', { source: conflict.syncResource });
|
|
168
168
|
this.userDataSyncWorkbenchService.showConflicts(conflict.conflicts[0]);
|
|
@@ -189,7 +189,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
189
189
|
}
|
|
190
190
|
catch (e) {
|
|
191
191
|
this.notificationService.error(( localize(
|
|
192
|
-
|
|
192
|
+
8680,
|
|
193
193
|
"Error while accepting changes. Please check [logs]({0}) for more details.",
|
|
194
194
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
195
195
|
)));
|
|
@@ -201,7 +201,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
201
201
|
}
|
|
202
202
|
catch (e) {
|
|
203
203
|
this.notificationService.error(( localize(
|
|
204
|
-
|
|
204
|
+
8680,
|
|
205
205
|
"Error while accepting changes. Please check [logs]({0}) for more details.",
|
|
206
206
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
207
207
|
)));
|
|
@@ -213,11 +213,11 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
213
213
|
this.notificationService.notify({
|
|
214
214
|
severity: Severity$1.Info,
|
|
215
215
|
message: ( localize(
|
|
216
|
-
|
|
216
|
+
8681,
|
|
217
217
|
"Settings sync was turned off because current session is expired, please sign in again to turn on sync."
|
|
218
218
|
)),
|
|
219
219
|
actions: {
|
|
220
|
-
primary: [( (new Action('turn on sync', ( localize(
|
|
220
|
+
primary: [( (new Action('turn on sync', ( localize(8682, "Turn on Settings Sync...")), undefined, true, () => this.turnOn())))]
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
break;
|
|
@@ -225,11 +225,11 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
225
225
|
this.notificationService.notify({
|
|
226
226
|
severity: Severity$1.Info,
|
|
227
227
|
message: ( localize(
|
|
228
|
-
|
|
228
|
+
8683,
|
|
229
229
|
"Settings sync was turned off from another device, please turn on sync again."
|
|
230
230
|
)),
|
|
231
231
|
actions: {
|
|
232
|
-
primary: [( (new Action('turn on sync', ( localize(
|
|
232
|
+
primary: [( (new Action('turn on sync', ( localize(8682, "Turn on Settings Sync...")), undefined, true, () => this.turnOn())))]
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
break;
|
|
@@ -238,7 +238,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
238
238
|
this.disableSync(error.resource);
|
|
239
239
|
const sourceArea = getSyncAreaLabel(error.resource);
|
|
240
240
|
this.handleTooLargeError(error.resource, ( localize(
|
|
241
|
-
|
|
241
|
+
8684,
|
|
242
242
|
"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",
|
|
243
243
|
sourceArea.toLowerCase(),
|
|
244
244
|
sourceArea.toLowerCase(),
|
|
@@ -249,7 +249,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
249
249
|
case "LocalTooManyProfiles" :
|
|
250
250
|
this.disableSync("profiles" );
|
|
251
251
|
this.notificationService.error(( localize(
|
|
252
|
-
|
|
252
|
+
8685,
|
|
253
253
|
"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"
|
|
254
254
|
)));
|
|
255
255
|
break;
|
|
@@ -257,12 +257,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
257
257
|
case "Gone" :
|
|
258
258
|
case "UpgradeRequired" : {
|
|
259
259
|
const message = ( localize(
|
|
260
|
-
|
|
260
|
+
8686,
|
|
261
261
|
"Settings sync is disabled because the current version ({0}, {1}) is not compatible with the sync service. Please update before turning on sync.",
|
|
262
262
|
this.productService.version,
|
|
263
263
|
this.productService.commit
|
|
264
264
|
));
|
|
265
|
-
const operationId = error.operationId ? ( localize(
|
|
265
|
+
const operationId = error.operationId ? ( localize(8687, "Operation Id: {0}", error.operationId)) : undefined;
|
|
266
266
|
this.notificationService.notify({
|
|
267
267
|
severity: Severity$1.Error,
|
|
268
268
|
message: operationId ? `${message} ${operationId}` : message,
|
|
@@ -271,17 +271,17 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
271
271
|
}
|
|
272
272
|
case "MethodNotFound" : {
|
|
273
273
|
const message = ( localize(
|
|
274
|
-
|
|
274
|
+
8688,
|
|
275
275
|
"Settings sync is disabled because the client is making invalid requests. Please report an issue with the logs."
|
|
276
276
|
));
|
|
277
|
-
const operationId = error.operationId ? ( localize(
|
|
277
|
+
const operationId = error.operationId ? ( localize(8687, "Operation Id: {0}", error.operationId)) : undefined;
|
|
278
278
|
this.notificationService.notify({
|
|
279
279
|
severity: Severity$1.Error,
|
|
280
280
|
message: operationId ? `${message} ${operationId}` : message,
|
|
281
281
|
actions: {
|
|
282
282
|
primary: [
|
|
283
|
-
( (new Action('Show Sync Logs', ( localize(
|
|
284
|
-
( (new Action('Report Issue', ( localize(
|
|
283
|
+
( (new Action('Show Sync Logs', ( localize(8689, "Show Log")), undefined, true, () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID)))),
|
|
284
|
+
( (new Action('Report Issue', ( localize(8690, "Report Issue")), undefined, true, () => this.workbenchIssueService.openReporter())))
|
|
285
285
|
]
|
|
286
286
|
}
|
|
287
287
|
});
|
|
@@ -291,13 +291,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
291
291
|
this.notificationService.notify({
|
|
292
292
|
severity: Severity$1.Error,
|
|
293
293
|
message: ( localize(
|
|
294
|
-
|
|
294
|
+
8691,
|
|
295
295
|
"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."
|
|
296
296
|
)),
|
|
297
297
|
actions: {
|
|
298
298
|
primary: [
|
|
299
|
-
( (new Action('reset', ( localize(
|
|
300
|
-
( (new Action('show synced data', ( localize(
|
|
299
|
+
( (new Action('reset', ( localize(8692, "Clear Data in Cloud...")), undefined, true, () => this.userDataSyncWorkbenchService.resetSyncedData()))),
|
|
300
|
+
( (new Action('show synced data', ( localize(8693, "Show Synced Data")), undefined, true, () => this.userDataSyncWorkbenchService.showSyncActivity())))
|
|
301
301
|
]
|
|
302
302
|
}
|
|
303
303
|
});
|
|
@@ -306,8 +306,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
306
306
|
this.notificationService.notify({
|
|
307
307
|
severity: Severity$1.Info,
|
|
308
308
|
message: this.userDataSyncStoreManagementService.userDataSyncStore?.type === 'insiders' ?
|
|
309
|
-
( localize(
|
|
310
|
-
( localize(
|
|
309
|
+
( localize(8694, "Settings Sync has been switched to insiders service")) :
|
|
310
|
+
( localize(8695, "Settings Sync has been switched to stable service")),
|
|
311
311
|
});
|
|
312
312
|
return;
|
|
313
313
|
case "DefaultServiceChanged" :
|
|
@@ -315,7 +315,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
315
315
|
this.notificationService.notify({
|
|
316
316
|
severity: Severity$1.Info,
|
|
317
317
|
message: ( localize(
|
|
318
|
-
|
|
318
|
+
8696,
|
|
319
319
|
"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)."
|
|
320
320
|
)),
|
|
321
321
|
});
|
|
@@ -324,12 +324,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
324
324
|
this.notificationService.notify({
|
|
325
325
|
severity: Severity$1.Info,
|
|
326
326
|
message: ( localize(
|
|
327
|
-
|
|
327
|
+
8697,
|
|
328
328
|
"Settings sync was turned off because {0} now uses a separate service. Please turn on sync again.",
|
|
329
329
|
this.productService.nameLong
|
|
330
330
|
)),
|
|
331
331
|
actions: {
|
|
332
|
-
primary: [( (new Action('turn on sync', ( localize(
|
|
332
|
+
primary: [( (new Action('turn on sync', ( localize(8682, "Turn on Settings Sync...")), undefined, true, () => this.turnOn())))]
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
335
|
}
|
|
@@ -337,12 +337,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
handleTooLargeError(resource, message, error) {
|
|
340
|
-
const operationId = error.operationId ? ( localize(
|
|
340
|
+
const operationId = error.operationId ? ( localize(8687, "Operation Id: {0}", error.operationId)) : undefined;
|
|
341
341
|
this.notificationService.notify({
|
|
342
342
|
severity: Severity$1.Error,
|
|
343
343
|
message: operationId ? `${message} ${operationId}` : message,
|
|
344
344
|
actions: {
|
|
345
|
-
primary: [( (new Action('open sync file', ( localize(
|
|
345
|
+
primary: [( (new Action('open sync file', ( localize(8698, "Open {0} File", getSyncAreaLabel(resource))), undefined, true, () => resource === "settings" ? this.preferencesService.openUserSettings({ jsonEditor: true }) : this.preferencesService.openGlobalKeybindingSettings(true))))]
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
348
|
}
|
|
@@ -394,12 +394,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
394
394
|
const handle = this.notificationService.notify({
|
|
395
395
|
severity: Severity$1.Error,
|
|
396
396
|
message: ( localize(
|
|
397
|
-
|
|
397
|
+
8699,
|
|
398
398
|
"Unable to sync {0} because the content in the file is not valid. Please open the file and correct it.",
|
|
399
399
|
errorArea.toLowerCase()
|
|
400
400
|
)),
|
|
401
401
|
actions: {
|
|
402
|
-
primary: [( (new Action('open sync file', ( localize(
|
|
402
|
+
primary: [( (new Action('open sync file', ( localize(8698, "Open {0} File", errorArea)), undefined, true, () => source === "settings" ? this.preferencesService.openUserSettings({ jsonEditor: true }) : this.preferencesService.openGlobalKeybindingSettings(true))))]
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
405
|
this.invalidContentErrorDisposables.set(key, toDisposable(() => {
|
|
@@ -415,10 +415,10 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
415
415
|
let badge = undefined;
|
|
416
416
|
let priority = undefined;
|
|
417
417
|
if (this.userDataSyncService.conflicts.length && this.userDataSyncEnablementService.isEnabled()) {
|
|
418
|
-
badge = ( (new NumberBadge(this.getConflictsCount(), () => ( localize(
|
|
418
|
+
badge = ( (new NumberBadge(this.getConflictsCount(), () => ( localize(8700, "{0}: Conflicts Detected", SYNC_TITLE.value)))));
|
|
419
419
|
}
|
|
420
420
|
else if (this.turningOnSync) {
|
|
421
|
-
badge = ( (new ProgressBadge(() => ( localize(
|
|
421
|
+
badge = ( (new ProgressBadge(() => ( localize(8701, "Turning on Settings Sync...")))));
|
|
422
422
|
priority = 1;
|
|
423
423
|
}
|
|
424
424
|
if (badge) {
|
|
@@ -429,7 +429,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
429
429
|
this.accountBadgeDisposable.clear();
|
|
430
430
|
let badge = undefined;
|
|
431
431
|
if (this.userDataSyncService.status !== "uninitialized" && this.userDataSyncEnablementService.isEnabled() && this.userDataSyncWorkbenchService.accountStatus === "unavailable" ) {
|
|
432
|
-
badge = ( (new NumberBadge(1, () => ( localize(
|
|
432
|
+
badge = ( (new NumberBadge(1, () => ( localize(8702, "Sign in to Sync Settings")))));
|
|
433
433
|
}
|
|
434
434
|
if (badge) {
|
|
435
435
|
this.accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge, priority: undefined });
|
|
@@ -438,7 +438,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
438
438
|
async turnOn() {
|
|
439
439
|
try {
|
|
440
440
|
if (!this.userDataSyncWorkbenchService.authenticationProviders.length) {
|
|
441
|
-
throw ( (new Error(localize(
|
|
441
|
+
throw ( (new Error(localize(8703, "No authentication providers are available."))));
|
|
442
442
|
}
|
|
443
443
|
const turnOn = await this.askToConfigure();
|
|
444
444
|
if (!turnOn) {
|
|
@@ -458,7 +458,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
458
458
|
case "TooLarge" :
|
|
459
459
|
if (e.resource === "keybindings" || e.resource === "settings" || e.resource === "tasks" ) {
|
|
460
460
|
this.handleTooLargeError(e.resource, ( localize(
|
|
461
|
-
|
|
461
|
+
8704,
|
|
462
462
|
"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",
|
|
463
463
|
getSyncAreaLabel(e.resource).toLowerCase(),
|
|
464
464
|
'100kb'
|
|
@@ -470,12 +470,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
470
470
|
case "Gone" :
|
|
471
471
|
case "UpgradeRequired" : {
|
|
472
472
|
const message = ( localize(
|
|
473
|
-
|
|
473
|
+
8705,
|
|
474
474
|
"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.",
|
|
475
475
|
this.productService.version,
|
|
476
476
|
this.productService.commit
|
|
477
477
|
));
|
|
478
|
-
const operationId = e.operationId ? ( localize(
|
|
478
|
+
const operationId = e.operationId ? ( localize(8687, "Operation Id: {0}", e.operationId)) : undefined;
|
|
479
479
|
this.notificationService.notify({
|
|
480
480
|
severity: Severity$1.Error,
|
|
481
481
|
message: operationId ? `${message} ${operationId}` : message,
|
|
@@ -486,30 +486,30 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
486
486
|
this.notificationService.notify({
|
|
487
487
|
severity: Severity$1.Error,
|
|
488
488
|
message: ( localize(
|
|
489
|
-
|
|
489
|
+
8706,
|
|
490
490
|
"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."
|
|
491
491
|
)),
|
|
492
492
|
actions: {
|
|
493
493
|
primary: [
|
|
494
|
-
( (new Action('reset', ( localize(
|
|
495
|
-
( (new Action('show synced data', ( localize(
|
|
494
|
+
( (new Action('reset', ( localize(8692, "Clear Data in Cloud...")), undefined, true, () => this.userDataSyncWorkbenchService.resetSyncedData()))),
|
|
495
|
+
( (new Action('show synced data', ( localize(8693, "Show Synced Data")), undefined, true, () => this.userDataSyncWorkbenchService.showSyncActivity())))
|
|
496
496
|
]
|
|
497
497
|
}
|
|
498
498
|
});
|
|
499
499
|
return;
|
|
500
500
|
case "Unauthorized" :
|
|
501
501
|
case "Forbidden" :
|
|
502
|
-
this.notificationService.error(( localize(
|
|
502
|
+
this.notificationService.error(( localize(8707, "Error while turning on Settings Sync: Authentication failed.")));
|
|
503
503
|
return;
|
|
504
504
|
}
|
|
505
505
|
this.notificationService.error(( localize(
|
|
506
|
-
|
|
506
|
+
8708,
|
|
507
507
|
"Error while turning on Settings Sync. Please check [logs]({0}) for more details.",
|
|
508
508
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
509
509
|
)));
|
|
510
510
|
}
|
|
511
511
|
else {
|
|
512
|
-
this.notificationService.error(( localize(
|
|
512
|
+
this.notificationService.error(( localize(8709, "Error while turning on Settings Sync. {0}", getErrorMessage(e))));
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
}
|
|
@@ -522,8 +522,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
522
522
|
quickPick.title = SYNC_TITLE.value;
|
|
523
523
|
quickPick.ok = false;
|
|
524
524
|
quickPick.customButton = true;
|
|
525
|
-
quickPick.customLabel = ( localize(
|
|
526
|
-
quickPick.description = ( localize(
|
|
525
|
+
quickPick.customLabel = ( localize(8710, "Sign in"));
|
|
526
|
+
quickPick.description = ( localize(8711, "Please sign in to backup and sync your data across devices."));
|
|
527
527
|
quickPick.canSelectMany = true;
|
|
528
528
|
quickPick.ignoreFocusOut = true;
|
|
529
529
|
quickPick.hideInput = true;
|
|
@@ -593,8 +593,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
593
593
|
const disposables = ( (new DisposableStore()));
|
|
594
594
|
const quickPick = this.quickInputService.createQuickPick();
|
|
595
595
|
disposables.add(quickPick);
|
|
596
|
-
quickPick.title = ( localize(
|
|
597
|
-
quickPick.placeholder = ( localize(
|
|
596
|
+
quickPick.title = ( localize(8712, "{0}: Configure...", SYNC_TITLE.value));
|
|
597
|
+
quickPick.placeholder = ( localize(8713, "Choose what to sync"));
|
|
598
598
|
quickPick.canSelectMany = true;
|
|
599
599
|
quickPick.ignoreFocusOut = true;
|
|
600
600
|
quickPick.ok = true;
|
|
@@ -617,15 +617,15 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
617
617
|
}
|
|
618
618
|
async turnOff() {
|
|
619
619
|
const result = await this.dialogService.confirm({
|
|
620
|
-
message: ( localize(
|
|
620
|
+
message: ( localize(8714, "Do you want to turn off sync?")),
|
|
621
621
|
detail: ( localize(
|
|
622
|
-
|
|
622
|
+
8715,
|
|
623
623
|
"Your settings, keybindings, extensions, snippets and UI State will no longer be synced."
|
|
624
624
|
)),
|
|
625
|
-
primaryButton: ( localize(
|
|
625
|
+
primaryButton: ( localize(8716, "&&Turn off")),
|
|
626
626
|
checkbox: this.userDataSyncWorkbenchService.accountStatus === "available" ? {
|
|
627
627
|
label: ( localize(
|
|
628
|
-
|
|
628
|
+
8717,
|
|
629
629
|
"Turn off sync on all your devices and clear the data from the cloud."
|
|
630
630
|
))
|
|
631
631
|
} : undefined
|
|
@@ -653,9 +653,9 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
653
653
|
(new Promise((c, e) => {
|
|
654
654
|
const disposables = ( (new DisposableStore()));
|
|
655
655
|
const quickPick = disposables.add(this.quickInputService.createQuickPick());
|
|
656
|
-
quickPick.title = ( localize(
|
|
656
|
+
quickPick.title = ( localize(8718, "{0}: Select Service", SYNC_TITLE.value));
|
|
657
657
|
quickPick.description = ( localize(
|
|
658
|
-
|
|
658
|
+
8719,
|
|
659
659
|
"Ensure you are using the same settings sync service when syncing with multiple environments"
|
|
660
660
|
));
|
|
661
661
|
quickPick.hideInput = true;
|
|
@@ -663,19 +663,19 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
663
663
|
const getDescription = (url) => {
|
|
664
664
|
const isDefault = isEqual(url, userDataSyncStore.defaultUrl);
|
|
665
665
|
if (isDefault) {
|
|
666
|
-
return ( localize(
|
|
666
|
+
return ( localize(8720, "Default"));
|
|
667
667
|
}
|
|
668
668
|
return undefined;
|
|
669
669
|
};
|
|
670
670
|
quickPick.items = [
|
|
671
671
|
{
|
|
672
672
|
id: 'insiders',
|
|
673
|
-
label: ( localize(
|
|
673
|
+
label: ( localize(8721, "Insiders")),
|
|
674
674
|
description: getDescription(userDataSyncStore.insidersUrl)
|
|
675
675
|
},
|
|
676
676
|
{
|
|
677
677
|
id: 'stable',
|
|
678
|
-
label: ( localize(
|
|
678
|
+
label: ( localize(8722, "Stable")),
|
|
679
679
|
description: getDescription(userDataSyncStore.stableUrl)
|
|
680
680
|
}
|
|
681
681
|
];
|
|
@@ -729,7 +729,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
729
729
|
constructor() {
|
|
730
730
|
super({
|
|
731
731
|
id: 'workbench.userDataSync.actions.turnOn',
|
|
732
|
-
title: ( localize2(
|
|
732
|
+
title: ( localize2(8723, 'Backup and Sync Settings...')),
|
|
733
733
|
category: SYNC_TITLE,
|
|
734
734
|
f1: true,
|
|
735
735
|
precondition: when,
|
|
@@ -766,7 +766,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
766
766
|
constructor() {
|
|
767
767
|
super({
|
|
768
768
|
id: 'workbench.userData.actions.turningOn',
|
|
769
|
-
title: ( localize(
|
|
769
|
+
title: ( localize(8724, "Turning on Settings Sync...")),
|
|
770
770
|
precondition: ( (ContextKeyExpr.false())),
|
|
771
771
|
menu: [{
|
|
772
772
|
group: '3_configuration',
|
|
@@ -789,7 +789,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
789
789
|
constructor() {
|
|
790
790
|
super({
|
|
791
791
|
id: 'workbench.userData.actions.cancelTurnOn',
|
|
792
|
-
title: ( localize(
|
|
792
|
+
title: ( localize(8725, "Cancel")),
|
|
793
793
|
icon: Codicon.stopCircle,
|
|
794
794
|
menu: {
|
|
795
795
|
id: MenuId.ViewContainerTitle,
|
|
@@ -819,7 +819,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
819
819
|
constructor() {
|
|
820
820
|
super({
|
|
821
821
|
id: 'workbench.userData.actions.signin',
|
|
822
|
-
title: ( localize(
|
|
822
|
+
title: ( localize(8726, "Sign in to Sync Settings")),
|
|
823
823
|
menu: {
|
|
824
824
|
group: '3_configuration',
|
|
825
825
|
id: MenuId.GlobalActivity,
|
|
@@ -841,13 +841,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
841
841
|
group: '1_settings',
|
|
842
842
|
command: {
|
|
843
843
|
id,
|
|
844
|
-
title: ( localize(
|
|
844
|
+
title: ( localize(8727, "Sign in to Sync Settings (1)")),
|
|
845
845
|
},
|
|
846
846
|
when
|
|
847
847
|
}))));
|
|
848
848
|
}
|
|
849
849
|
getShowConflictsTitle() {
|
|
850
|
-
return ( localize2(
|
|
850
|
+
return ( localize2(8728, "Show Conflicts ({0})", this.getConflictsCount()));
|
|
851
851
|
}
|
|
852
852
|
registerShowConflictsAction() {
|
|
853
853
|
this.conflictsActionDisposable.value = undefined;
|
|
@@ -889,7 +889,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
889
889
|
constructor() {
|
|
890
890
|
super({
|
|
891
891
|
id: 'workbench.userDataSync.actions.manage',
|
|
892
|
-
title: ( localize(
|
|
892
|
+
title: ( localize(8729, "Settings Sync is On")),
|
|
893
893
|
toggled: ContextKeyTrueExpr.INSTANCE,
|
|
894
894
|
menu: [
|
|
895
895
|
{
|
|
@@ -1022,7 +1022,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1022
1022
|
catch (e) {
|
|
1023
1023
|
if (!isCancellationError(e)) {
|
|
1024
1024
|
that.notificationService.error(( localize(
|
|
1025
|
-
|
|
1025
|
+
8730,
|
|
1026
1026
|
"Error while turning off Settings Sync. Please check [logs]({0}) for more details.",
|
|
1027
1027
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
1028
1028
|
)));
|
|
@@ -1044,7 +1044,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1044
1044
|
title: configureSyncCommand.title,
|
|
1045
1045
|
category: SYNC_TITLE,
|
|
1046
1046
|
icon: Codicon.settingsGear,
|
|
1047
|
-
tooltip: ( localize(
|
|
1047
|
+
tooltip: ( localize(8731, "Configure...")),
|
|
1048
1048
|
menu: [{
|
|
1049
1049
|
id: MenuId.CommandPalette,
|
|
1050
1050
|
when
|
|
@@ -1068,8 +1068,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1068
1068
|
constructor() {
|
|
1069
1069
|
super({
|
|
1070
1070
|
id: SHOW_SYNC_LOG_COMMAND_ID,
|
|
1071
|
-
title: ( localize(
|
|
1072
|
-
tooltip: ( localize(
|
|
1071
|
+
title: ( localize(8732, "{0}: Show Log", SYNC_TITLE.value)),
|
|
1072
|
+
tooltip: ( localize(8733, "Show Log")),
|
|
1073
1073
|
icon: Codicon.output,
|
|
1074
1074
|
menu: [{
|
|
1075
1075
|
id: MenuId.CommandPalette,
|
|
@@ -1140,7 +1140,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1140
1140
|
constructor() {
|
|
1141
1141
|
super({
|
|
1142
1142
|
id: 'workbench.userDataSync.actions.acceptMerges',
|
|
1143
|
-
title: ( localize(
|
|
1143
|
+
title: ( localize(8734, "Complete Merge")),
|
|
1144
1144
|
menu: [{
|
|
1145
1145
|
id: MenuId.EditorContent,
|
|
1146
1146
|
when: ( (ContextKeyExpr.and(ctxIsMergeResultEditor, (ContextKeyExpr.regex(
|
|
@@ -1175,7 +1175,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1175
1175
|
const notificationService = accessor.get(INotificationService);
|
|
1176
1176
|
const folder = await userDataSyncWorkbenchService.downloadSyncActivity();
|
|
1177
1177
|
if (folder) {
|
|
1178
|
-
notificationService.info(( localize(
|
|
1178
|
+
notificationService.info(( localize(8735, "Successfully downloaded Settings Sync activity.")));
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
1181
|
}));
|
|
@@ -1202,7 +1202,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1202
1202
|
constructor() {
|
|
1203
1203
|
super({
|
|
1204
1204
|
id: 'workbench.actions.syncData.reset',
|
|
1205
|
-
title: ( localize(
|
|
1205
|
+
title: ( localize(8736, "Clear Data in Cloud...")),
|
|
1206
1206
|
menu: [{
|
|
1207
1207
|
id: MenuId.ViewContainerTitle,
|
|
1208
1208
|
when: ( (ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID))),
|
|
@@ -54,7 +54,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
54
54
|
}
|
|
55
55
|
registerConflictsView(container) {
|
|
56
56
|
const viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
|
|
57
|
-
const viewName = ( localize2(
|
|
57
|
+
const viewName = ( localize2(11071, "Conflicts"));
|
|
58
58
|
const viewDescriptor = {
|
|
59
59
|
id: SYNC_CONFLICTS_VIEW_ID,
|
|
60
60
|
name: viewName,
|
|
@@ -70,7 +70,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
70
70
|
}
|
|
71
71
|
registerMachinesView(container) {
|
|
72
72
|
const id = `workbench.views.sync.machines`;
|
|
73
|
-
const name = ( localize2(
|
|
73
|
+
const name = ( localize2(11072, "Synced Machines"));
|
|
74
74
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
75
75
|
const dataProvider = this.instantiationService.createInstance(UserDataSyncMachinesViewDataProvider, treeView);
|
|
76
76
|
treeView.showRefreshAction = true;
|
|
@@ -98,7 +98,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
98
98
|
constructor() {
|
|
99
99
|
super({
|
|
100
100
|
id: `workbench.actions.sync.editMachineName`,
|
|
101
|
-
title: ( localize(
|
|
101
|
+
title: ( localize(11073, "Edit Name")),
|
|
102
102
|
icon: Codicon.edit,
|
|
103
103
|
menu: {
|
|
104
104
|
id: MenuId.ViewItemContext,
|
|
@@ -118,7 +118,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
118
118
|
constructor() {
|
|
119
119
|
super({
|
|
120
120
|
id: `workbench.actions.sync.turnOffSyncOnMachine`,
|
|
121
|
-
title: ( localize(
|
|
121
|
+
title: ( localize(11074, "Turn off Settings Sync")),
|
|
122
122
|
menu: {
|
|
123
123
|
id: MenuId.ViewItemContext,
|
|
124
124
|
when: ( (ContextKeyExpr.and(
|
|
@@ -137,7 +137,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
137
137
|
}
|
|
138
138
|
registerActivityView(container, remote) {
|
|
139
139
|
const id = `workbench.views.sync.${remote ? 'remote' : 'local'}Activity`;
|
|
140
|
-
const name = remote ? ( localize2(
|
|
140
|
+
const name = remote ? ( localize2(11075, "Sync Activity (Remote)")) : ( localize2(11076, "Sync Activity (Local)"));
|
|
141
141
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
142
142
|
treeView.showCollapseAllAction = true;
|
|
143
143
|
treeView.showRefreshAction = true;
|
|
@@ -166,7 +166,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
166
166
|
}
|
|
167
167
|
registerExternalActivityView(container) {
|
|
168
168
|
const id = `workbench.views.sync.externalActivity`;
|
|
169
|
-
const name = ( localize2(
|
|
169
|
+
const name = ( localize2(11077, "Sync Activity (Developer)"));
|
|
170
170
|
const dataProvider = this.instantiationService.createInstance(ExtractedUserDataSyncActivityViewDataProvider, undefined);
|
|
171
171
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
172
172
|
treeView.showCollapseAllAction = false;
|
|
@@ -189,7 +189,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
189
189
|
constructor() {
|
|
190
190
|
super({
|
|
191
191
|
id: `workbench.actions.sync.loadActivity`,
|
|
192
|
-
title: ( localize(
|
|
192
|
+
title: ( localize(11078, "Load Sync Activity")),
|
|
193
193
|
icon: Codicon.cloudUpload,
|
|
194
194
|
menu: {
|
|
195
195
|
id: MenuId.ViewTitle,
|
|
@@ -201,7 +201,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
201
201
|
async run(accessor) {
|
|
202
202
|
const fileDialogService = accessor.get(IFileDialogService);
|
|
203
203
|
const result = await fileDialogService.showOpenDialog({
|
|
204
|
-
title: ( localize(
|
|
204
|
+
title: ( localize(11079, "Select Sync Activity File or Folder")),
|
|
205
205
|
canSelectFiles: true,
|
|
206
206
|
canSelectFolders: true,
|
|
207
207
|
canSelectMany: false,
|
|
@@ -219,7 +219,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
219
219
|
constructor() {
|
|
220
220
|
super({
|
|
221
221
|
id: `workbench.actions.sync.${viewId}.resolveResource`,
|
|
222
|
-
title: ( localize(
|
|
222
|
+
title: ( localize(11080, "Show raw JSON sync data")),
|
|
223
223
|
menu: {
|
|
224
224
|
id: MenuId.ViewItemContext,
|
|
225
225
|
when: ( (ContextKeyExpr.and(
|
|
@@ -239,7 +239,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
239
239
|
constructor() {
|
|
240
240
|
super({
|
|
241
241
|
id: `workbench.actions.sync.${viewId}.compareWithLocal`,
|
|
242
|
-
title: ( localize(
|
|
242
|
+
title: ( localize(11081, "Compare with Local")),
|
|
243
243
|
menu: {
|
|
244
244
|
id: MenuId.ViewItemContext,
|
|
245
245
|
when: ( (ContextKeyExpr.and(
|
|
@@ -254,14 +254,14 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
254
254
|
const { resource, comparableResource } = JSON.parse(handle.$treeItemHandle);
|
|
255
255
|
const remoteResource = ( (URI.parse(resource)));
|
|
256
256
|
const localResource = ( (URI.parse(comparableResource)));
|
|
257
|
-
return commandService.executeCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID, remoteResource, localResource, ( localize(
|
|
257
|
+
return commandService.executeCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID, remoteResource, localResource, ( localize(11082, "{0} ↔ {1}", ( localize(11083, "{0} (Remote)", basename(remoteResource))), ( localize(11084, "{0} (Local)", basename(localResource))))), undefined);
|
|
258
258
|
}
|
|
259
259
|
}));
|
|
260
260
|
this._register(registerAction2(class extends Action2 {
|
|
261
261
|
constructor() {
|
|
262
262
|
super({
|
|
263
263
|
id: `workbench.actions.sync.${viewId}.replaceCurrent`,
|
|
264
|
-
title: ( localize(
|
|
264
|
+
title: ( localize(11085, "Restore")),
|
|
265
265
|
icon: Codicon.discard,
|
|
266
266
|
menu: {
|
|
267
267
|
id: MenuId.ViewItemContext,
|
|
@@ -280,7 +280,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
280
280
|
const { syncResourceHandle, syncResource } = JSON.parse(handle.$treeItemHandle);
|
|
281
281
|
const result = await dialogService.confirm({
|
|
282
282
|
message: ( localize(
|
|
283
|
-
|
|
283
|
+
11086,
|
|
284
284
|
"Would you like to replace your current {0} with selected?",
|
|
285
285
|
getSyncAreaLabel(syncResource)
|
|
286
286
|
)),
|
|
@@ -295,7 +295,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
295
295
|
}
|
|
296
296
|
registerTroubleShootView(container) {
|
|
297
297
|
const id = `workbench.views.sync.troubleshoot`;
|
|
298
|
-
const name = ( localize2(
|
|
298
|
+
const name = ( localize2(11087, "Troubleshoot"));
|
|
299
299
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
300
300
|
const dataProvider = this.instantiationService.createInstance(UserDataSyncTroubleshootViewDataProvider);
|
|
301
301
|
treeView.showRefreshAction = true;
|
|
@@ -359,7 +359,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
359
359
|
message: error.message,
|
|
360
360
|
actions: {
|
|
361
361
|
primary: [
|
|
362
|
-
( (new Action('reset', ( localize(
|
|
362
|
+
( (new Action('reset', ( localize(11088, "Reset Synced Data")), undefined, true, () => this.userDataSyncWorkbenchService.resetSyncedData()))),
|
|
363
363
|
]
|
|
364
364
|
}
|
|
365
365
|
});
|
|
@@ -416,7 +416,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
416
416
|
previousResource,
|
|
417
417
|
resource,
|
|
418
418
|
( localize(
|
|
419
|
-
|
|
419
|
+
11089,
|
|
420
420
|
"{0} ↔ {1}",
|
|
421
421
|
`${basename(resource)} (${fromNow(syncResourceHandle.previous.created, true)})`,
|
|
422
422
|
`${basename(resource)} (${fromNow(syncResourceHandle.created, true)})`
|
|
@@ -514,7 +514,7 @@ let RemoteUserDataSyncActivityViewDataProvider = class RemoteUserDataSyncActivit
|
|
|
514
514
|
if (machineId) {
|
|
515
515
|
const machines = await this.getMachines();
|
|
516
516
|
const machine = machines.find(({ id }) => id === machineId);
|
|
517
|
-
children[0].description = machine?.isCurrent ? ( localize(
|
|
517
|
+
children[0].description = machine?.isCurrent ? ( localize(11090, "Current")) : machine?.name;
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
return children;
|
|
@@ -570,7 +570,7 @@ let ExtractedUserDataSyncActivityViewDataProvider = class ExtractedUserDataSyncA
|
|
|
570
570
|
if (machineId) {
|
|
571
571
|
const machines = await this.getMachines();
|
|
572
572
|
const machine = machines.find(({ id }) => id === machineId);
|
|
573
|
-
children[0].description = machine?.isCurrent ? ( localize(
|
|
573
|
+
children[0].description = machine?.isCurrent ? ( localize(11090, "Current")) : machine?.name;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
return children;
|
|
@@ -608,13 +608,13 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
608
608
|
try {
|
|
609
609
|
let machines = await this.getMachines();
|
|
610
610
|
machines = machines.filter(m => !m.disabled).sort((m1, m2) => m1.isCurrent ? -1 : 1);
|
|
611
|
-
this.treeView.message = machines.length ? undefined : ( localize(
|
|
611
|
+
this.treeView.message = machines.length ? undefined : ( localize(11091, "No Machines"));
|
|
612
612
|
return (
|
|
613
613
|
(machines.map(({ id, name, isCurrent, platform }) => ({
|
|
614
614
|
handle: id,
|
|
615
615
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
616
616
|
label: { label: name },
|
|
617
|
-
description: isCurrent ? ( localize(
|
|
617
|
+
description: isCurrent ? ( localize(11090, "Current")) : undefined,
|
|
618
618
|
themeIcon: platform && isWebPlatform(platform) ? Codicon.globe : Codicon.vm,
|
|
619
619
|
contextValue: 'sync-machine'
|
|
620
620
|
})))
|
|
@@ -635,17 +635,17 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
635
635
|
const machines = await this.getMachines();
|
|
636
636
|
const machinesToDisable = machines.filter(({ id }) => machineIds.includes(id));
|
|
637
637
|
if (!machinesToDisable.length) {
|
|
638
|
-
throw ( (new Error(localize(
|
|
638
|
+
throw ( (new Error(localize(11092, "machine not found with id: {0}", machineIds.join(',')))));
|
|
639
639
|
}
|
|
640
640
|
const result = await this.dialogService.confirm({
|
|
641
641
|
type: 'info',
|
|
642
|
-
message: machinesToDisable.length > 1 ? ( localize(
|
|
642
|
+
message: machinesToDisable.length > 1 ? ( localize(11093, "Are you sure you want to turn off sync on selected machines?"))
|
|
643
643
|
: ( localize(
|
|
644
|
-
|
|
644
|
+
11094,
|
|
645
645
|
"Are you sure you want to turn off sync on {0}?",
|
|
646
646
|
machinesToDisable[0].name
|
|
647
647
|
)),
|
|
648
|
-
primaryButton: ( localize(
|
|
648
|
+
primaryButton: ( localize(11095, "&&Turn off")),
|
|
649
649
|
});
|
|
650
650
|
if (!result.confirmed) {
|
|
651
651
|
return false;
|
|
@@ -663,7 +663,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
663
663
|
async rename(machineId) {
|
|
664
664
|
const disposableStore = ( (new DisposableStore()));
|
|
665
665
|
const inputBox = disposableStore.add(this.quickInputService.createInputBox());
|
|
666
|
-
inputBox.placeholder = ( localize(
|
|
666
|
+
inputBox.placeholder = ( localize(11096, "Enter the name of the machine"));
|
|
667
667
|
inputBox.busy = true;
|
|
668
668
|
inputBox.show();
|
|
669
669
|
const machines = await this.getMachines();
|
|
@@ -671,7 +671,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
671
671
|
if (!machine) {
|
|
672
672
|
inputBox.hide();
|
|
673
673
|
disposableStore.dispose();
|
|
674
|
-
throw ( (new Error(localize(
|
|
674
|
+
throw ( (new Error(localize(11092, "machine not found with id: {0}", machineId))));
|
|
675
675
|
}
|
|
676
676
|
inputBox.busy = false;
|
|
677
677
|
inputBox.value = machine.name;
|
|
@@ -679,7 +679,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
679
679
|
machineName = machineName.trim();
|
|
680
680
|
return machineName && !( (machines.some(m => m.id !== machineId && m.name === machineName))) ? machineName : null;
|
|
681
681
|
};
|
|
682
|
-
disposableStore.add(inputBox.onDidChangeValue(() => inputBox.validationMessage = validateMachineName(inputBox.value) ? '' : ( localize(
|
|
682
|
+
disposableStore.add(inputBox.onDidChangeValue(() => inputBox.validationMessage = validateMachineName(inputBox.value) ? '' : ( localize(11097, "Machine name should be unique and not empty"))));
|
|
683
683
|
return (
|
|
684
684
|
(new Promise((c, e) => {
|
|
685
685
|
disposableStore.add(inputBox.onDidAccept(async () => {
|
|
@@ -721,12 +721,12 @@ let UserDataSyncTroubleshootViewDataProvider = class UserDataSyncTroubleshootVie
|
|
|
721
721
|
return [{
|
|
722
722
|
handle: 'SYNC_LOGS',
|
|
723
723
|
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
|
724
|
-
label: { label: ( localize(
|
|
724
|
+
label: { label: ( localize(11098, "Logs")) },
|
|
725
725
|
themeIcon: Codicon.folder,
|
|
726
726
|
}, {
|
|
727
727
|
handle: 'LAST_SYNC_STATES',
|
|
728
728
|
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
|
729
|
-
label: { label: ( localize(
|
|
729
|
+
label: { label: ( localize(11099, "Last Synced Remotes")) },
|
|
730
730
|
themeIcon: Codicon.folder,
|
|
731
731
|
}];
|
|
732
732
|
}
|
|
@@ -764,7 +764,7 @@ let UserDataSyncTroubleshootViewDataProvider = class UserDataSyncTroubleshootVie
|
|
|
764
764
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
765
765
|
resourceUri: syncLogResource,
|
|
766
766
|
label: { label: this.uriIdentityService.extUri.basename(logFolder) },
|
|
767
|
-
description: this.uriIdentityService.extUri.isEqual(logFolder, this.environmentService.logsHome) ? ( localize(
|
|
767
|
+
description: this.uriIdentityService.extUri.isEqual(logFolder, this.environmentService.logsHome) ? ( localize(11090, "Current")) : undefined,
|
|
768
768
|
command: { id: API_OPEN_EDITOR_COMMAND_ID, title: '', arguments: [syncLogResource, undefined, undefined] },
|
|
769
769
|
});
|
|
770
770
|
}
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js
CHANGED
|
@@ -39,6 +39,7 @@ import { ISecretStorageService } from 'vscode/vscode/vs/platform/secrets/common/
|
|
|
39
39
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
40
40
|
import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
|
|
41
41
|
import { IUserDataSyncMachinesService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSyncMachines.service';
|
|
42
|
+
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
42
43
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
43
44
|
|
|
44
45
|
var UserDataSyncWorkbenchService_1;
|
|
@@ -118,7 +119,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
updateAuthenticationProviders() {
|
|
122
|
+
this.logService.info('Settings Sync: Updating authentication providers. Authentication Providers from store:', this.userDataSyncStoreManagementService.userDataSyncStore?.authenticationProviders || ( ([].map(({ id }) => id))));
|
|
123
|
+
const oldValue = this._authenticationProviders;
|
|
121
124
|
this._authenticationProviders = (this.userDataSyncStoreManagementService.userDataSyncStore?.authenticationProviders || []).filter(({ id }) => ( (this.authenticationService.declaredProviders.some(provider => provider.id === id))));
|
|
125
|
+
this.logService.info('Settings Sync: Authentication providers updated', ( (this._authenticationProviders.map(({ id }) => id))));
|
|
126
|
+
return equals(oldValue, this._authenticationProviders, (a, b) => a.id === b.id);
|
|
122
127
|
}
|
|
123
128
|
isSupportedAuthenticationProviderId(authenticationProviderId) {
|
|
124
129
|
return (
|
|
@@ -149,8 +154,13 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
149
154
|
this.useWorkbenchSessionId = false;
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
|
-
|
|
153
|
-
this._register(this.authenticationService.onDidChangeDeclaredProviders(() =>
|
|
157
|
+
const initPromise = this.update('initialize');
|
|
158
|
+
this._register(this.authenticationService.onDidChangeDeclaredProviders(() => {
|
|
159
|
+
if (this.updateAuthenticationProviders()) {
|
|
160
|
+
initPromise.finally(() => this.update('declared authentication providers changed'));
|
|
161
|
+
}
|
|
162
|
+
}));
|
|
163
|
+
await initPromise;
|
|
154
164
|
this._register(Event.filter(Event.any(this.authenticationService.onDidRegisterAuthenticationProvider, this.authenticationService.onDidUnregisterAuthenticationProvider), info => this.isSupportedAuthenticationProviderId(info.id))(() => this.update()));
|
|
155
165
|
this._register(Event.filter(this.userDataSyncAccountService.onTokenFailed, isSuccessive => !isSuccessive)(() => this.update('token failure')));
|
|
156
166
|
this._register(Event.filter(this.authenticationService.onDidChangeSessions, e => this.isSupportedAuthenticationProviderId(e.providerId))(({ event }) => this.onDidChangeSessions(event)));
|
|
@@ -229,7 +239,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
229
239
|
async turnOn() {
|
|
230
240
|
if (!this.authenticationProviders.length) {
|
|
231
241
|
throw ( (new Error(localize(
|
|
232
|
-
|
|
242
|
+
3503,
|
|
233
243
|
"Settings sync cannot be turned on because there are no authentication providers available."
|
|
234
244
|
))));
|
|
235
245
|
}
|
|
@@ -244,16 +254,16 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
244
254
|
throw ( (new CancellationError()));
|
|
245
255
|
}
|
|
246
256
|
if (this.accountStatus !== "available" ) {
|
|
247
|
-
throw ( (new Error(localize(
|
|
257
|
+
throw ( (new Error(localize(3504, "No account available"))));
|
|
248
258
|
}
|
|
249
259
|
const turnOnSyncCancellationToken = this.turnOnSyncCancellationToken = ( (new CancellationTokenSource()));
|
|
250
260
|
const disposable = isWeb ? Disposable.None : this.lifecycleService.onBeforeShutdown(e => e.veto((async () => {
|
|
251
261
|
const { confirmed } = await this.dialogService.confirm({
|
|
252
262
|
type: 'warning',
|
|
253
|
-
message: ( localize(
|
|
254
|
-
title: ( localize(
|
|
255
|
-
primaryButton: ( localize(
|
|
256
|
-
cancelButton: ( localize(
|
|
263
|
+
message: ( localize(3505, "Settings Sync is being turned on. Would you like to cancel it?")),
|
|
264
|
+
title: ( localize(3506, "Settings Sync")),
|
|
265
|
+
primaryButton: ( localize(3507, "&&Yes")),
|
|
266
|
+
cancelButton: ( localize(3508, "No"))
|
|
257
267
|
});
|
|
258
268
|
if (confirmed) {
|
|
259
269
|
turnOnSyncCancellationToken.cancel();
|
|
@@ -275,7 +285,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
275
285
|
if (this.environmentService.options?.settingsSyncOptions?.enablementHandler && this.currentAuthenticationProviderId) {
|
|
276
286
|
this.environmentService.options.settingsSyncOptions.enablementHandler(true, this.currentAuthenticationProviderId);
|
|
277
287
|
}
|
|
278
|
-
this.notificationService.info(( localize(
|
|
288
|
+
this.notificationService.info(( localize(3509, "{0} is turned on", SYNC_TITLE.value)));
|
|
279
289
|
this._onDidTurnOnSync.fire();
|
|
280
290
|
}
|
|
281
291
|
async turnoff(everywhere) {
|
|
@@ -316,13 +326,13 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
316
326
|
command: SHOW_SYNC_LOG_COMMAND_ID,
|
|
317
327
|
delay: 500,
|
|
318
328
|
}, async (progress) => {
|
|
319
|
-
progress.report({ message: ( localize(
|
|
329
|
+
progress.report({ message: ( localize(3510, "Turning on...")) });
|
|
320
330
|
disposables.add(this.userDataSyncService.onDidChangeStatus(status => {
|
|
321
331
|
if (status === "hasConflicts" ) {
|
|
322
|
-
progress.report({ message: ( localize(
|
|
332
|
+
progress.report({ message: ( localize(3511, "Resolving conflicts...")) });
|
|
323
333
|
}
|
|
324
334
|
else {
|
|
325
|
-
progress.report({ message: ( localize(
|
|
335
|
+
progress.report({ message: ( localize(3512, "Turning on...")) });
|
|
326
336
|
}
|
|
327
337
|
}));
|
|
328
338
|
await manualSyncTask.merge();
|
|
@@ -343,11 +353,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
343
353
|
async handleConflictsWhileTurningOn(token) {
|
|
344
354
|
await this.dialogService.prompt({
|
|
345
355
|
type: Severity$1.Warning,
|
|
346
|
-
message: ( localize(
|
|
347
|
-
detail: ( localize(
|
|
356
|
+
message: ( localize(3513, "Conflicts Detected")),
|
|
357
|
+
detail: ( localize(3514, "Please resolve conflicts to turn on...")),
|
|
348
358
|
buttons: [
|
|
349
359
|
{
|
|
350
|
-
label: ( localize(
|
|
360
|
+
label: ( localize(3515, "&&Show Conflicts")),
|
|
351
361
|
run: async () => {
|
|
352
362
|
const waitUntilConflictsAreResolvedPromise = raceCancellationError(Event.toPromise(Event.filter(this.userDataSyncService.onDidChangeConflicts, conficts => conficts.length === 0)), token);
|
|
353
363
|
await this.showConflicts(this.userDataSyncService.conflicts[0]?.conflicts[0]);
|
|
@@ -355,11 +365,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
355
365
|
}
|
|
356
366
|
},
|
|
357
367
|
{
|
|
358
|
-
label: ( localize(
|
|
368
|
+
label: ( localize(3516, "Replace &&Local")),
|
|
359
369
|
run: async () => this.replace(true)
|
|
360
370
|
},
|
|
361
371
|
{
|
|
362
|
-
label: ( localize(
|
|
372
|
+
label: ( localize(3517, "Replace &&Remote")),
|
|
363
373
|
run: () => this.replace(false)
|
|
364
374
|
},
|
|
365
375
|
],
|
|
@@ -394,11 +404,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
394
404
|
const { confirmed } = await this.dialogService.confirm({
|
|
395
405
|
type: 'info',
|
|
396
406
|
message: ( localize(
|
|
397
|
-
|
|
407
|
+
3518,
|
|
398
408
|
"This will clear your data in the cloud and stop sync on all your devices."
|
|
399
409
|
)),
|
|
400
|
-
title: ( localize(
|
|
401
|
-
primaryButton: ( localize(
|
|
410
|
+
title: ( localize(3519, "Clear")),
|
|
411
|
+
primaryButton: ( localize(3520, "&&Reset")),
|
|
402
412
|
});
|
|
403
413
|
if (confirmed) {
|
|
404
414
|
await this.userDataSyncService.resetRemote();
|
|
@@ -431,11 +441,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
431
441
|
}
|
|
432
442
|
async downloadSyncActivity() {
|
|
433
443
|
const result = await this.fileDialogService.showOpenDialog({
|
|
434
|
-
title: ( localize(
|
|
444
|
+
title: ( localize(3521, "Select folder to download Settings Sync activity")),
|
|
435
445
|
canSelectFiles: false,
|
|
436
446
|
canSelectFolders: true,
|
|
437
447
|
canSelectMany: false,
|
|
438
|
-
openLabel: ( localize(
|
|
448
|
+
openLabel: ( localize(3522, "Save")),
|
|
439
449
|
});
|
|
440
450
|
if (!result?.[0]) {
|
|
441
451
|
return;
|
|
@@ -527,7 +537,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
527
537
|
quickPick.title = SYNC_TITLE.value;
|
|
528
538
|
quickPick.ok = false;
|
|
529
539
|
quickPick.ignoreFocusOut = true;
|
|
530
|
-
quickPick.placeholder = ( localize(
|
|
540
|
+
quickPick.placeholder = ( localize(3523, "Select an account to sign in"));
|
|
531
541
|
quickPick.show();
|
|
532
542
|
if (authenticationProviders.length > 1) {
|
|
533
543
|
quickPick.busy = true;
|
|
@@ -565,26 +575,26 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
565
575
|
createQuickpickItems(authenticationProviders, allAccounts) {
|
|
566
576
|
const quickPickItems = [];
|
|
567
577
|
if (allAccounts.size) {
|
|
568
|
-
quickPickItems.push({ type: 'separator', label: ( localize(
|
|
578
|
+
quickPickItems.push({ type: 'separator', label: ( localize(3524, "Signed in")) });
|
|
569
579
|
for (const authenticationProvider of authenticationProviders) {
|
|
570
580
|
const accounts = (allAccounts.get(authenticationProvider.id) || []).sort(({ sessionId }) => sessionId === this.currentSessionId ? -1 : 1);
|
|
571
581
|
const providerName = this.authenticationService.getProvider(authenticationProvider.id).label;
|
|
572
582
|
for (const account of accounts) {
|
|
573
583
|
quickPickItems.push({
|
|
574
584
|
label: `${account.accountName} (${providerName})`,
|
|
575
|
-
description: account.sessionId === this.current?.sessionId ? ( localize(
|
|
585
|
+
description: account.sessionId === this.current?.sessionId ? ( localize(3525, "Last Used with Sync")) : undefined,
|
|
576
586
|
account,
|
|
577
587
|
authenticationProvider,
|
|
578
588
|
});
|
|
579
589
|
}
|
|
580
590
|
}
|
|
581
|
-
quickPickItems.push({ type: 'separator', label: ( localize(
|
|
591
|
+
quickPickItems.push({ type: 'separator', label: ( localize(3526, "Others")) });
|
|
582
592
|
}
|
|
583
593
|
for (const authenticationProvider of authenticationProviders) {
|
|
584
594
|
const provider = this.authenticationService.getProvider(authenticationProvider.id);
|
|
585
595
|
if (!( (allAccounts.has(authenticationProvider.id))) || provider.supportsMultipleAccounts) {
|
|
586
596
|
const providerName = provider.label;
|
|
587
|
-
quickPickItems.push({ label: ( localize(
|
|
597
|
+
quickPickItems.push({ label: ( localize(3527, "Sign in with {0}", providerName)), authenticationProvider });
|
|
588
598
|
}
|
|
589
599
|
}
|
|
590
600
|
return quickPickItems;
|