@codingame/monaco-vscode-user-data-sync-service-override 13.0.0 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -23
- 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/userDataSyncConflictsView.js +8 -8
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.js +32 -32
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js +27 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-user-data-sync-service-override",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - user-data-sync service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,28 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
22
|
-
"@codingame/monaco-vscode-
|
|
23
|
-
"@codingame/monaco-vscode-
|
|
24
|
-
"@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common": "13.
|
|
25
|
-
"@codingame/monaco-vscode-a022e9a8-b522-5ea2-97c7-f3dda2b0b597-common": "13.
|
|
26
|
-
"@codingame/monaco-vscode-a2719803-af40-5ae9-a29f-8a2231c33056-common": "13.
|
|
27
|
-
"@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "13.
|
|
28
|
-
"@codingame/monaco-vscode-
|
|
29
|
-
"@codingame/monaco-vscode-
|
|
30
|
-
"@codingame/monaco-vscode-
|
|
31
|
-
|
|
32
|
-
"peerDependencies": {
|
|
33
|
-
"@codingame/monaco-vscode-api": "13.0.0",
|
|
34
|
-
"@codingame/monaco-vscode-55ed5668-e8ca-5335-a587-790bcf1200c0-common": "13.0.0"
|
|
35
|
-
},
|
|
36
|
-
"peerDependenciesMeta": {
|
|
37
|
-
"@codingame/monaco-vscode-55ed5668-e8ca-5335-a587-790bcf1200c0-common": {
|
|
38
|
-
"optional": true
|
|
39
|
-
}
|
|
18
|
+
"@codingame/monaco-vscode-3607c442-ae7a-594b-b840-038378c24fef-common": "13.1.0",
|
|
19
|
+
"@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common": "13.1.0",
|
|
20
|
+
"@codingame/monaco-vscode-4a316137-39d1-5d77-8b53-112db3547c1e-common": "13.1.0",
|
|
21
|
+
"@codingame/monaco-vscode-56402b83-4a60-5b15-86f9-71fe99c32744-common": "13.1.0",
|
|
22
|
+
"@codingame/monaco-vscode-897bebad-39df-57cb-8a57-36a271d038be-common": "13.1.0",
|
|
23
|
+
"@codingame/monaco-vscode-972e8507-3a64-566d-8bc0-b78993998562-common": "13.1.0",
|
|
24
|
+
"@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common": "13.1.0",
|
|
25
|
+
"@codingame/monaco-vscode-a022e9a8-b522-5ea2-97c7-f3dda2b0b597-common": "13.1.0",
|
|
26
|
+
"@codingame/monaco-vscode-a2719803-af40-5ae9-a29f-8a2231c33056-common": "13.1.0",
|
|
27
|
+
"@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "13.1.0",
|
|
28
|
+
"@codingame/monaco-vscode-api": "13.1.0",
|
|
29
|
+
"@codingame/monaco-vscode-e72c94ca-257a-5b75-8b68-5a5fa3c18255-common": "13.1.0",
|
|
30
|
+
"@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common": "13.1.0",
|
|
31
|
+
"@codingame/monaco-vscode-user-data-profile-service-override": "13.1.0"
|
|
40
32
|
},
|
|
41
33
|
"main": "index.js",
|
|
42
34
|
"module": "index.js",
|
|
@@ -408,28 +408,28 @@ class AutoSync extends Disposable {
|
|
|
408
408
|
if (this.manifest === null && (await this.userDataSyncService.hasPreviouslySynced())) {
|
|
409
409
|
if (this.hasSyncServiceChanged()) {
|
|
410
410
|
if (await this.hasDefaultServiceChanged()) {
|
|
411
|
-
throw ( new UserDataAutoSyncError(( localize(
|
|
411
|
+
throw ( new UserDataAutoSyncError(( localize(2248, "Cannot sync because default service has changed")), UserDataSyncErrorCode.DefaultServiceChanged));
|
|
412
412
|
}
|
|
413
413
|
else {
|
|
414
|
-
throw ( new UserDataAutoSyncError(( localize(
|
|
414
|
+
throw ( new UserDataAutoSyncError(( localize(2249, "Cannot sync because sync service has changed")), UserDataSyncErrorCode.ServiceChanged));
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
else {
|
|
418
|
-
throw ( new UserDataAutoSyncError(( localize(
|
|
418
|
+
throw ( new UserDataAutoSyncError(( localize(2250, "Cannot sync because syncing is turned off in the cloud")), UserDataSyncErrorCode.TurnedOff));
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
const sessionId = this.storageService.get(sessionIdKey, StorageScope.APPLICATION);
|
|
422
422
|
if (sessionId && this.manifest && sessionId !== this.manifest.session) {
|
|
423
423
|
if (this.hasSyncServiceChanged()) {
|
|
424
424
|
if (await this.hasDefaultServiceChanged()) {
|
|
425
|
-
throw ( new UserDataAutoSyncError(( localize(
|
|
425
|
+
throw ( new UserDataAutoSyncError(( localize(2248, "Cannot sync because default service has changed")), UserDataSyncErrorCode.DefaultServiceChanged));
|
|
426
426
|
}
|
|
427
427
|
else {
|
|
428
|
-
throw ( new UserDataAutoSyncError(( localize(
|
|
428
|
+
throw ( new UserDataAutoSyncError(( localize(2249, "Cannot sync because sync service has changed")), UserDataSyncErrorCode.ServiceChanged));
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
else {
|
|
432
|
-
throw ( new UserDataAutoSyncError(( localize(
|
|
432
|
+
throw ( new UserDataAutoSyncError(( localize(2251, "Cannot sync because current session is expired")), UserDataSyncErrorCode.SessionExpired));
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
const machines = await this.userDataSyncMachinesService.getMachines(this.manifest || undefined);
|
|
@@ -439,7 +439,7 @@ class AutoSync extends Disposable {
|
|
|
439
439
|
const currentMachine = machines.find(machine => machine.isCurrent);
|
|
440
440
|
if (currentMachine?.disabled) {
|
|
441
441
|
throw ( new UserDataAutoSyncError(( localize(
|
|
442
|
-
|
|
442
|
+
2252,
|
|
443
443
|
"Cannot sync because syncing is turned off on this machine from another machine."
|
|
444
444
|
)), UserDataSyncErrorCode.TurnedOff));
|
|
445
445
|
}
|
|
@@ -10,7 +10,7 @@ import { USER_DATA_SYNC_LOG_ID } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
10
10
|
let UserDataSyncLogService = class UserDataSyncLogService extends AbstractLogger {
|
|
11
11
|
constructor(loggerService, environmentService) {
|
|
12
12
|
super();
|
|
13
|
-
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${USER_DATA_SYNC_LOG_ID}.log`), { id: USER_DATA_SYNC_LOG_ID, name: ( localize(
|
|
13
|
+
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${USER_DATA_SYNC_LOG_ID}.log`), { id: USER_DATA_SYNC_LOG_ID, name: ( localize(2258, "Settings Sync")) }));
|
|
14
14
|
}
|
|
15
15
|
trace(message, ...args) {
|
|
16
16
|
this.logger.trace(message, ...args);
|
|
@@ -429,7 +429,7 @@ let UserDataSyncResourceProviderService = class UserDataSyncResourceProviderServ
|
|
|
429
429
|
this.logService.error(error);
|
|
430
430
|
}
|
|
431
431
|
throw ( new UserDataSyncError(( localize(
|
|
432
|
-
|
|
432
|
+
2260,
|
|
433
433
|
"Cannot parse sync data as it is not compatible with the current version."
|
|
434
434
|
)), UserDataSyncErrorCode.IncompatibleRemoteContent, syncResource));
|
|
435
435
|
}
|
|
@@ -32,12 +32,12 @@ let UserDataSyncReportIssueContribution = class UserDataSyncReportIssueContribut
|
|
|
32
32
|
switch (error.code) {
|
|
33
33
|
case UserDataSyncErrorCode.LocalTooManyRequests: {
|
|
34
34
|
const message = isWeb ? ( localize(
|
|
35
|
-
|
|
35
|
+
10611,
|
|
36
36
|
"Settings sync is suspended temporarily because the current device is making too many requests. Please reload {0} to resume.",
|
|
37
37
|
this.productService.nameLong
|
|
38
38
|
))
|
|
39
39
|
: ( localize(
|
|
40
|
-
|
|
40
|
+
10612,
|
|
41
41
|
"Settings sync is suspended temporarily because the current device is making too many requests. Please restart {0} to resume.",
|
|
42
42
|
this.productService.nameLong
|
|
43
43
|
));
|
|
@@ -46,26 +46,26 @@ let UserDataSyncReportIssueContribution = class UserDataSyncReportIssueContribut
|
|
|
46
46
|
message,
|
|
47
47
|
actions: {
|
|
48
48
|
primary: [
|
|
49
|
-
( new Action('Show Sync Logs', ( localize(
|
|
50
|
-
( new Action('Restart', isWeb ? ( localize(
|
|
49
|
+
( new Action('Show Sync Logs', ( localize(10613, "Show Log")), undefined, true, () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID))),
|
|
50
|
+
( new Action('Restart', isWeb ? ( localize(10614, "Reload")) : ( localize(10615, "Restart")), undefined, true, () => this.hostService.restart()))
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
case UserDataSyncErrorCode.TooManyRequests: {
|
|
57
|
-
const operationId = error.operationId ? ( localize(
|
|
57
|
+
const operationId = error.operationId ? ( localize(10616, "Operation Id: {0}", error.operationId)) : undefined;
|
|
58
58
|
const message = ( localize(
|
|
59
|
-
|
|
59
|
+
10617,
|
|
60
60
|
"Settings sync is disabled because the current device is making too many requests. Please wait for 10 minutes and turn on sync."
|
|
61
61
|
));
|
|
62
62
|
this.notificationService.notify({
|
|
63
63
|
severity: Severity.Error,
|
|
64
64
|
message: operationId ? `${message} ${operationId}` : message,
|
|
65
|
-
source: error.operationId ? ( localize(
|
|
65
|
+
source: error.operationId ? ( localize(10618, "Settings Sync. Operation Id: {0}", error.operationId)) : undefined,
|
|
66
66
|
actions: {
|
|
67
67
|
primary: [
|
|
68
|
-
( new Action('Show Sync Logs', ( localize(
|
|
68
|
+
( new Action('Show Sync Logs', ( localize(10613, "Show Log")), undefined, true, () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID))),
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
});
|
|
@@ -49,24 +49,24 @@ import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
49
49
|
import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
50
50
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
51
51
|
|
|
52
|
-
const turnOffSyncCommand = { id: 'workbench.userDataSync.actions.turnOff', title: ( localize2(
|
|
53
|
-
const configureSyncCommand = { id: CONFIGURE_SYNC_COMMAND_ID, title: ( localize2(
|
|
52
|
+
const turnOffSyncCommand = { id: 'workbench.userDataSync.actions.turnOff', title: ( localize2(10619, 'Turn Off')) };
|
|
53
|
+
const configureSyncCommand = { id: CONFIGURE_SYNC_COMMAND_ID, title: ( localize2(10620, 'Configure...')) };
|
|
54
54
|
const showConflictsCommandId = 'workbench.userDataSync.actions.showConflicts';
|
|
55
55
|
const syncNowCommand = {
|
|
56
56
|
id: 'workbench.userDataSync.actions.syncNow',
|
|
57
|
-
title: ( localize2(
|
|
57
|
+
title: ( localize2(10621, 'Sync Now')),
|
|
58
58
|
description(userDataSyncService) {
|
|
59
59
|
if (userDataSyncService.status === SyncStatus.Syncing) {
|
|
60
|
-
return localize(
|
|
60
|
+
return localize(10622, "syncing");
|
|
61
61
|
}
|
|
62
62
|
if (userDataSyncService.lastSyncTime) {
|
|
63
|
-
return localize(
|
|
63
|
+
return localize(10623, "synced {0}", fromNow(userDataSyncService.lastSyncTime, true));
|
|
64
64
|
}
|
|
65
65
|
return undefined;
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
const showSyncSettingsCommand = { id: 'workbench.userDataSync.actions.settings', title: ( localize2(
|
|
69
|
-
const showSyncedDataCommand = { id: 'workbench.userDataSync.actions.showSyncedData', title: ( localize2(
|
|
68
|
+
const showSyncSettingsCommand = { id: 'workbench.userDataSync.actions.settings', title: ( localize2(10624, 'Show Settings')), };
|
|
69
|
+
const showSyncedDataCommand = { id: 'workbench.userDataSync.actions.showSyncedData', title: ( localize2(10625, 'Show Synced Data')), };
|
|
70
70
|
const CONTEXT_TURNING_ON_STATE = ( new RawContextKey('userDataSyncTurningOn', false));
|
|
71
71
|
let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution extends Disposable {
|
|
72
72
|
constructor(userDataSyncEnablementService, userDataSyncService, userDataSyncWorkbenchService, contextKeyService, activityService, notificationService, editorService, userDataProfileService, dialogService, quickInputService, instantiationService, outputService, userDataAutoSyncService, textModelResolverService, preferencesService, telemetryService, productService, openerService, authenticationService, userDataSyncStoreManagementService, hostService, commandService, workbenchIssueService) {
|
|
@@ -144,26 +144,26 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
144
144
|
if (!( this.conflictsDisposables.has(key))) {
|
|
145
145
|
const conflictsArea = getSyncAreaLabel(conflict.syncResource);
|
|
146
146
|
const handle = this.notificationService.prompt(Severity.Warning, ( localize(
|
|
147
|
-
|
|
147
|
+
10626,
|
|
148
148
|
"Unable to sync due to conflicts in {0}. Please resolve them to continue.",
|
|
149
149
|
conflictsArea.toLowerCase()
|
|
150
150
|
)), [
|
|
151
151
|
{
|
|
152
|
-
label: ( localize(
|
|
152
|
+
label: ( localize(10627, "Replace Remote")),
|
|
153
153
|
run: () => {
|
|
154
154
|
this.telemetryService.publicLog2('sync/handleConflicts', { source: conflict.syncResource, action: 'acceptLocal' });
|
|
155
155
|
this.acceptLocal(conflict, conflict.conflicts[0]);
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
|
-
label: ( localize(
|
|
159
|
+
label: ( localize(10628, "Replace Local")),
|
|
160
160
|
run: () => {
|
|
161
161
|
this.telemetryService.publicLog2('sync/handleConflicts', { source: conflict.syncResource, action: 'acceptRemote' });
|
|
162
162
|
this.acceptRemote(conflict, conflict.conflicts[0]);
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
|
-
label: ( localize(
|
|
166
|
+
label: ( localize(10629, "Show Conflicts")),
|
|
167
167
|
run: () => {
|
|
168
168
|
this.telemetryService.publicLog2('sync/showConflicts', { source: conflict.syncResource });
|
|
169
169
|
this.userDataSyncWorkbenchService.showConflicts(conflict.conflicts[0]);
|
|
@@ -190,7 +190,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
190
190
|
}
|
|
191
191
|
catch (e) {
|
|
192
192
|
this.notificationService.error(( localize(
|
|
193
|
-
|
|
193
|
+
10630,
|
|
194
194
|
"Error while accepting changes. Please check [logs]({0}) for more details.",
|
|
195
195
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
196
196
|
)));
|
|
@@ -202,7 +202,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
202
202
|
}
|
|
203
203
|
catch (e) {
|
|
204
204
|
this.notificationService.error(( localize(
|
|
205
|
-
|
|
205
|
+
10630,
|
|
206
206
|
"Error while accepting changes. Please check [logs]({0}) for more details.",
|
|
207
207
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
208
208
|
)));
|
|
@@ -214,11 +214,11 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
214
214
|
this.notificationService.notify({
|
|
215
215
|
severity: Severity.Info,
|
|
216
216
|
message: ( localize(
|
|
217
|
-
|
|
217
|
+
10631,
|
|
218
218
|
"Settings sync was turned off because current session is expired, please sign in again to turn on sync."
|
|
219
219
|
)),
|
|
220
220
|
actions: {
|
|
221
|
-
primary: [( new Action('turn on sync', ( localize(
|
|
221
|
+
primary: [( new Action('turn on sync', ( localize(10632, "Turn on Settings Sync...")), undefined, true, () => this.turnOn()))]
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
break;
|
|
@@ -226,11 +226,11 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
226
226
|
this.notificationService.notify({
|
|
227
227
|
severity: Severity.Info,
|
|
228
228
|
message: ( localize(
|
|
229
|
-
|
|
229
|
+
10633,
|
|
230
230
|
"Settings sync was turned off from another device, please turn on sync again."
|
|
231
231
|
)),
|
|
232
232
|
actions: {
|
|
233
|
-
primary: [( new Action('turn on sync', ( localize(
|
|
233
|
+
primary: [( new Action('turn on sync', ( localize(10632, "Turn on Settings Sync...")), undefined, true, () => this.turnOn()))]
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
break;
|
|
@@ -239,7 +239,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
239
239
|
this.disableSync(error.resource);
|
|
240
240
|
const sourceArea = getSyncAreaLabel(error.resource);
|
|
241
241
|
this.handleTooLargeError(error.resource, ( localize(
|
|
242
|
-
|
|
242
|
+
10634,
|
|
243
243
|
"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",
|
|
244
244
|
sourceArea.toLowerCase(),
|
|
245
245
|
sourceArea.toLowerCase(),
|
|
@@ -250,7 +250,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
250
250
|
case UserDataSyncErrorCode.LocalTooManyProfiles:
|
|
251
251
|
this.disableSync(SyncResource.Profiles);
|
|
252
252
|
this.notificationService.error(( localize(
|
|
253
|
-
|
|
253
|
+
10635,
|
|
254
254
|
"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"
|
|
255
255
|
)));
|
|
256
256
|
break;
|
|
@@ -258,12 +258,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
258
258
|
case UserDataSyncErrorCode.Gone:
|
|
259
259
|
case UserDataSyncErrorCode.UpgradeRequired: {
|
|
260
260
|
const message = ( localize(
|
|
261
|
-
|
|
261
|
+
10636,
|
|
262
262
|
"Settings sync is disabled because the current version ({0}, {1}) is not compatible with the sync service. Please update before turning on sync.",
|
|
263
263
|
this.productService.version,
|
|
264
264
|
this.productService.commit
|
|
265
265
|
));
|
|
266
|
-
const operationId = error.operationId ? ( localize(
|
|
266
|
+
const operationId = error.operationId ? ( localize(10637, "Operation Id: {0}", error.operationId)) : undefined;
|
|
267
267
|
this.notificationService.notify({
|
|
268
268
|
severity: Severity.Error,
|
|
269
269
|
message: operationId ? `${message} ${operationId}` : message,
|
|
@@ -272,17 +272,17 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
272
272
|
}
|
|
273
273
|
case UserDataSyncErrorCode.MethodNotFound: {
|
|
274
274
|
const message = ( localize(
|
|
275
|
-
|
|
275
|
+
10638,
|
|
276
276
|
"Settings sync is disabled because the client is making invalid requests. Please report an issue with the logs."
|
|
277
277
|
));
|
|
278
|
-
const operationId = error.operationId ? ( localize(
|
|
278
|
+
const operationId = error.operationId ? ( localize(10637, "Operation Id: {0}", error.operationId)) : undefined;
|
|
279
279
|
this.notificationService.notify({
|
|
280
280
|
severity: Severity.Error,
|
|
281
281
|
message: operationId ? `${message} ${operationId}` : message,
|
|
282
282
|
actions: {
|
|
283
283
|
primary: [
|
|
284
|
-
( new Action('Show Sync Logs', ( localize(
|
|
285
|
-
( new Action('Report Issue', ( localize(
|
|
284
|
+
( new Action('Show Sync Logs', ( localize(10639, "Show Log")), undefined, true, () => this.commandService.executeCommand(SHOW_SYNC_LOG_COMMAND_ID))),
|
|
285
|
+
( new Action('Report Issue', ( localize(10640, "Report Issue")), undefined, true, () => this.workbenchIssueService.openReporter()))
|
|
286
286
|
]
|
|
287
287
|
}
|
|
288
288
|
});
|
|
@@ -292,13 +292,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
292
292
|
this.notificationService.notify({
|
|
293
293
|
severity: Severity.Error,
|
|
294
294
|
message: ( localize(
|
|
295
|
-
|
|
295
|
+
10641,
|
|
296
296
|
"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."
|
|
297
297
|
)),
|
|
298
298
|
actions: {
|
|
299
299
|
primary: [
|
|
300
|
-
( new Action('reset', ( localize(
|
|
301
|
-
( new Action('show synced data', ( localize(
|
|
300
|
+
( new Action('reset', ( localize(10642, "Clear Data in Cloud...")), undefined, true, () => this.userDataSyncWorkbenchService.resetSyncedData())),
|
|
301
|
+
( new Action('show synced data', ( localize(10643, "Show Synced Data")), undefined, true, () => this.userDataSyncWorkbenchService.showSyncActivity()))
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
});
|
|
@@ -307,8 +307,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
307
307
|
this.notificationService.notify({
|
|
308
308
|
severity: Severity.Info,
|
|
309
309
|
message: this.userDataSyncStoreManagementService.userDataSyncStore?.type === 'insiders' ?
|
|
310
|
-
( localize(
|
|
311
|
-
( localize(
|
|
310
|
+
( localize(10644, "Settings Sync has been switched to insiders service")) :
|
|
311
|
+
( localize(10645, "Settings Sync has been switched to stable service")),
|
|
312
312
|
});
|
|
313
313
|
return;
|
|
314
314
|
case UserDataSyncErrorCode.DefaultServiceChanged:
|
|
@@ -316,7 +316,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
316
316
|
this.notificationService.notify({
|
|
317
317
|
severity: Severity.Info,
|
|
318
318
|
message: ( localize(
|
|
319
|
-
|
|
319
|
+
10646,
|
|
320
320
|
"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)."
|
|
321
321
|
)),
|
|
322
322
|
});
|
|
@@ -325,12 +325,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
325
325
|
this.notificationService.notify({
|
|
326
326
|
severity: Severity.Info,
|
|
327
327
|
message: ( localize(
|
|
328
|
-
|
|
328
|
+
10647,
|
|
329
329
|
"Settings sync was turned off because {0} now uses a separate service. Please turn on sync again.",
|
|
330
330
|
this.productService.nameLong
|
|
331
331
|
)),
|
|
332
332
|
actions: {
|
|
333
|
-
primary: [( new Action('turn on sync', ( localize(
|
|
333
|
+
primary: [( new Action('turn on sync', ( localize(10632, "Turn on Settings Sync...")), undefined, true, () => this.turnOn()))]
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
336
|
}
|
|
@@ -338,12 +338,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
handleTooLargeError(resource, message, error) {
|
|
341
|
-
const operationId = error.operationId ? ( localize(
|
|
341
|
+
const operationId = error.operationId ? ( localize(10637, "Operation Id: {0}", error.operationId)) : undefined;
|
|
342
342
|
this.notificationService.notify({
|
|
343
343
|
severity: Severity.Error,
|
|
344
344
|
message: operationId ? `${message} ${operationId}` : message,
|
|
345
345
|
actions: {
|
|
346
|
-
primary: [( new Action('open sync file', ( localize(
|
|
346
|
+
primary: [( new Action('open sync file', ( localize(10648, "Open {0} File", getSyncAreaLabel(resource))), undefined, true, () => resource === SyncResource.Settings ? this.preferencesService.openUserSettings({ jsonEditor: true }) : this.preferencesService.openGlobalKeybindingSettings(true)))]
|
|
347
347
|
}
|
|
348
348
|
});
|
|
349
349
|
}
|
|
@@ -395,12 +395,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
395
395
|
const handle = this.notificationService.notify({
|
|
396
396
|
severity: Severity.Error,
|
|
397
397
|
message: ( localize(
|
|
398
|
-
|
|
398
|
+
10649,
|
|
399
399
|
"Unable to sync {0} because the content in the file is not valid. Please open the file and correct it.",
|
|
400
400
|
errorArea.toLowerCase()
|
|
401
401
|
)),
|
|
402
402
|
actions: {
|
|
403
|
-
primary: [( new Action('open sync file', ( localize(
|
|
403
|
+
primary: [( new Action('open sync file', ( localize(10648, "Open {0} File", errorArea)), undefined, true, () => source === SyncResource.Settings ? this.preferencesService.openUserSettings({ jsonEditor: true }) : this.preferencesService.openGlobalKeybindingSettings(true)))]
|
|
404
404
|
}
|
|
405
405
|
});
|
|
406
406
|
this.invalidContentErrorDisposables.set(key, toDisposable(() => {
|
|
@@ -416,10 +416,10 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
416
416
|
let badge = undefined;
|
|
417
417
|
let priority = undefined;
|
|
418
418
|
if (this.userDataSyncService.conflicts.length && this.userDataSyncEnablementService.isEnabled()) {
|
|
419
|
-
badge = ( new NumberBadge(this.getConflictsCount(), () => ( localize(
|
|
419
|
+
badge = ( new NumberBadge(this.getConflictsCount(), () => ( localize(10650, "{0}: Conflicts Detected", SYNC_TITLE.value))));
|
|
420
420
|
}
|
|
421
421
|
else if (this.turningOnSync) {
|
|
422
|
-
badge = ( new ProgressBadge(() => ( localize(
|
|
422
|
+
badge = ( new ProgressBadge(() => ( localize(10651, "Turning on Settings Sync..."))));
|
|
423
423
|
priority = 1;
|
|
424
424
|
}
|
|
425
425
|
if (badge) {
|
|
@@ -430,7 +430,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
430
430
|
this.accountBadgeDisposable.clear();
|
|
431
431
|
let badge = undefined;
|
|
432
432
|
if (this.userDataSyncService.status !== SyncStatus.Uninitialized && this.userDataSyncEnablementService.isEnabled() && this.userDataSyncWorkbenchService.accountStatus === AccountStatus.Unavailable) {
|
|
433
|
-
badge = ( new NumberBadge(1, () => ( localize(
|
|
433
|
+
badge = ( new NumberBadge(1, () => ( localize(10652, "Sign in to Sync Settings"))));
|
|
434
434
|
}
|
|
435
435
|
if (badge) {
|
|
436
436
|
this.accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge, priority: undefined });
|
|
@@ -439,7 +439,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
439
439
|
async turnOn() {
|
|
440
440
|
try {
|
|
441
441
|
if (!this.userDataSyncWorkbenchService.authenticationProviders.length) {
|
|
442
|
-
throw ( new Error(( localize(
|
|
442
|
+
throw ( new Error(( localize(10653, "No authentication providers are available."))));
|
|
443
443
|
}
|
|
444
444
|
const turnOn = await this.askToConfigure();
|
|
445
445
|
if (!turnOn) {
|
|
@@ -459,7 +459,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
459
459
|
case UserDataSyncErrorCode.TooLarge:
|
|
460
460
|
if (e.resource === SyncResource.Keybindings || e.resource === SyncResource.Settings || e.resource === SyncResource.Tasks) {
|
|
461
461
|
this.handleTooLargeError(e.resource, ( localize(
|
|
462
|
-
|
|
462
|
+
10654,
|
|
463
463
|
"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",
|
|
464
464
|
getSyncAreaLabel(e.resource).toLowerCase(),
|
|
465
465
|
'100kb'
|
|
@@ -471,12 +471,12 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
471
471
|
case UserDataSyncErrorCode.Gone:
|
|
472
472
|
case UserDataSyncErrorCode.UpgradeRequired: {
|
|
473
473
|
const message = ( localize(
|
|
474
|
-
|
|
474
|
+
10655,
|
|
475
475
|
"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.",
|
|
476
476
|
this.productService.version,
|
|
477
477
|
this.productService.commit
|
|
478
478
|
));
|
|
479
|
-
const operationId = e.operationId ? ( localize(
|
|
479
|
+
const operationId = e.operationId ? ( localize(10637, "Operation Id: {0}", e.operationId)) : undefined;
|
|
480
480
|
this.notificationService.notify({
|
|
481
481
|
severity: Severity.Error,
|
|
482
482
|
message: operationId ? `${message} ${operationId}` : message,
|
|
@@ -487,30 +487,30 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
487
487
|
this.notificationService.notify({
|
|
488
488
|
severity: Severity.Error,
|
|
489
489
|
message: ( localize(
|
|
490
|
-
|
|
490
|
+
10656,
|
|
491
491
|
"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."
|
|
492
492
|
)),
|
|
493
493
|
actions: {
|
|
494
494
|
primary: [
|
|
495
|
-
( new Action('reset', ( localize(
|
|
496
|
-
( new Action('show synced data', ( localize(
|
|
495
|
+
( new Action('reset', ( localize(10642, "Clear Data in Cloud...")), undefined, true, () => this.userDataSyncWorkbenchService.resetSyncedData())),
|
|
496
|
+
( new Action('show synced data', ( localize(10643, "Show Synced Data")), undefined, true, () => this.userDataSyncWorkbenchService.showSyncActivity()))
|
|
497
497
|
]
|
|
498
498
|
}
|
|
499
499
|
});
|
|
500
500
|
return;
|
|
501
501
|
case UserDataSyncErrorCode.Unauthorized:
|
|
502
502
|
case UserDataSyncErrorCode.Forbidden:
|
|
503
|
-
this.notificationService.error(( localize(
|
|
503
|
+
this.notificationService.error(( localize(10657, "Error while turning on Settings Sync: Authentication failed.")));
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
506
|
this.notificationService.error(( localize(
|
|
507
|
-
|
|
507
|
+
10658,
|
|
508
508
|
"Error while turning on Settings Sync. Please check [logs]({0}) for more details.",
|
|
509
509
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
510
510
|
)));
|
|
511
511
|
}
|
|
512
512
|
else {
|
|
513
|
-
this.notificationService.error(( localize(
|
|
513
|
+
this.notificationService.error(( localize(10659, "Error while turning on Settings Sync. {0}", getErrorMessage(e))));
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
}
|
|
@@ -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(10660, "Sign in"));
|
|
526
|
+
quickPick.description = ( localize(10661, "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;
|
|
@@ -591,8 +591,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
591
591
|
const disposables = ( new DisposableStore());
|
|
592
592
|
const quickPick = this.quickInputService.createQuickPick();
|
|
593
593
|
disposables.add(quickPick);
|
|
594
|
-
quickPick.title = ( localize(
|
|
595
|
-
quickPick.placeholder = ( localize(
|
|
594
|
+
quickPick.title = ( localize(10662, "{0}: Configure...", SYNC_TITLE.value));
|
|
595
|
+
quickPick.placeholder = ( localize(10663, "Choose what to sync"));
|
|
596
596
|
quickPick.canSelectMany = true;
|
|
597
597
|
quickPick.ignoreFocusOut = true;
|
|
598
598
|
quickPick.ok = true;
|
|
@@ -614,15 +614,15 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
614
614
|
}
|
|
615
615
|
async turnOff() {
|
|
616
616
|
const result = await this.dialogService.confirm({
|
|
617
|
-
message: ( localize(
|
|
617
|
+
message: ( localize(10664, "Do you want to turn off sync?")),
|
|
618
618
|
detail: ( localize(
|
|
619
|
-
|
|
619
|
+
10665,
|
|
620
620
|
"Your settings, keybindings, extensions, snippets and UI State will no longer be synced."
|
|
621
621
|
)),
|
|
622
|
-
primaryButton: ( localize(
|
|
622
|
+
primaryButton: ( localize(10666, "&&Turn off")),
|
|
623
623
|
checkbox: this.userDataSyncWorkbenchService.accountStatus === AccountStatus.Available ? {
|
|
624
624
|
label: ( localize(
|
|
625
|
-
|
|
625
|
+
10667,
|
|
626
626
|
"Turn off sync on all your devices and clear the data from the cloud."
|
|
627
627
|
))
|
|
628
628
|
} : undefined
|
|
@@ -649,9 +649,9 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
649
649
|
return (new Promise((c, e) => {
|
|
650
650
|
const disposables = ( new DisposableStore());
|
|
651
651
|
const quickPick = disposables.add(this.quickInputService.createQuickPick());
|
|
652
|
-
quickPick.title = ( localize(
|
|
652
|
+
quickPick.title = ( localize(10668, "{0}: Select Service", SYNC_TITLE.value));
|
|
653
653
|
quickPick.description = ( localize(
|
|
654
|
-
|
|
654
|
+
10669,
|
|
655
655
|
"Ensure you are using the same settings sync service when syncing with multiple environments"
|
|
656
656
|
));
|
|
657
657
|
quickPick.hideInput = true;
|
|
@@ -659,19 +659,19 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
659
659
|
const getDescription = (url) => {
|
|
660
660
|
const isDefault = isEqual(url, userDataSyncStore.defaultUrl);
|
|
661
661
|
if (isDefault) {
|
|
662
|
-
return localize(
|
|
662
|
+
return localize(10670, "Default");
|
|
663
663
|
}
|
|
664
664
|
return undefined;
|
|
665
665
|
};
|
|
666
666
|
quickPick.items = [
|
|
667
667
|
{
|
|
668
668
|
id: 'insiders',
|
|
669
|
-
label: ( localize(
|
|
669
|
+
label: ( localize(10671, "Insiders")),
|
|
670
670
|
description: getDescription(userDataSyncStore.insidersUrl)
|
|
671
671
|
},
|
|
672
672
|
{
|
|
673
673
|
id: 'stable',
|
|
674
|
-
label: ( localize(
|
|
674
|
+
label: ( localize(10672, "Stable")),
|
|
675
675
|
description: getDescription(userDataSyncStore.stableUrl)
|
|
676
676
|
}
|
|
677
677
|
];
|
|
@@ -720,7 +720,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
720
720
|
constructor() {
|
|
721
721
|
super({
|
|
722
722
|
id: 'workbench.userDataSync.actions.turnOn',
|
|
723
|
-
title: ( localize2(
|
|
723
|
+
title: ( localize2(10673, 'Backup and Sync Settings...')),
|
|
724
724
|
category: SYNC_TITLE,
|
|
725
725
|
f1: true,
|
|
726
726
|
precondition: when,
|
|
@@ -753,7 +753,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
753
753
|
constructor() {
|
|
754
754
|
super({
|
|
755
755
|
id: 'workbench.userData.actions.turningOn',
|
|
756
|
-
title: ( localize(
|
|
756
|
+
title: ( localize(10674, "Turning on Settings Sync...")),
|
|
757
757
|
precondition: ( ContextKeyExpr.false()),
|
|
758
758
|
menu: [{
|
|
759
759
|
group: '3_configuration',
|
|
@@ -776,7 +776,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
776
776
|
constructor() {
|
|
777
777
|
super({
|
|
778
778
|
id: 'workbench.userData.actions.cancelTurnOn',
|
|
779
|
-
title: ( localize(
|
|
779
|
+
title: ( localize(10675, "Cancel")),
|
|
780
780
|
icon: Codicon.stopCircle,
|
|
781
781
|
menu: {
|
|
782
782
|
id: MenuId.ViewContainerTitle,
|
|
@@ -799,7 +799,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
799
799
|
constructor() {
|
|
800
800
|
super({
|
|
801
801
|
id: 'workbench.userData.actions.signin',
|
|
802
|
-
title: ( localize(
|
|
802
|
+
title: ( localize(10676, "Sign in to Sync Settings")),
|
|
803
803
|
menu: {
|
|
804
804
|
group: '3_configuration',
|
|
805
805
|
id: MenuId.GlobalActivity,
|
|
@@ -821,13 +821,13 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
821
821
|
group: '1_settings',
|
|
822
822
|
command: {
|
|
823
823
|
id,
|
|
824
|
-
title: ( localize(
|
|
824
|
+
title: ( localize(10677, "Sign in to Sync Settings (1)")),
|
|
825
825
|
},
|
|
826
826
|
when
|
|
827
827
|
})));
|
|
828
828
|
}
|
|
829
829
|
getShowConflictsTitle() {
|
|
830
|
-
return localize2(
|
|
830
|
+
return localize2(10678, "Show Conflicts ({0})", this.getConflictsCount());
|
|
831
831
|
}
|
|
832
832
|
registerShowConflictsAction() {
|
|
833
833
|
this.conflictsActionDisposable.value = undefined;
|
|
@@ -865,7 +865,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
865
865
|
constructor() {
|
|
866
866
|
super({
|
|
867
867
|
id: 'workbench.userDataSync.actions.manage',
|
|
868
|
-
title: ( localize(
|
|
868
|
+
title: ( localize(10679, "Settings Sync is On")),
|
|
869
869
|
toggled: ContextKeyTrueExpr.INSTANCE,
|
|
870
870
|
menu: [
|
|
871
871
|
{
|
|
@@ -986,7 +986,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
986
986
|
catch (e) {
|
|
987
987
|
if (!isCancellationError(e)) {
|
|
988
988
|
that.notificationService.error(( localize(
|
|
989
|
-
|
|
989
|
+
10680,
|
|
990
990
|
"Error while turning off Settings Sync. Please check [logs]({0}) for more details.",
|
|
991
991
|
`command:${SHOW_SYNC_LOG_COMMAND_ID}`
|
|
992
992
|
)));
|
|
@@ -1005,7 +1005,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1005
1005
|
title: configureSyncCommand.title,
|
|
1006
1006
|
category: SYNC_TITLE,
|
|
1007
1007
|
icon: Codicon.settingsGear,
|
|
1008
|
-
tooltip: ( localize(
|
|
1008
|
+
tooltip: ( localize(10681, "Configure...")),
|
|
1009
1009
|
menu: [{
|
|
1010
1010
|
id: MenuId.CommandPalette,
|
|
1011
1011
|
when
|
|
@@ -1026,8 +1026,8 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1026
1026
|
constructor() {
|
|
1027
1027
|
super({
|
|
1028
1028
|
id: SHOW_SYNC_LOG_COMMAND_ID,
|
|
1029
|
-
title: ( localize(
|
|
1030
|
-
tooltip: ( localize(
|
|
1029
|
+
title: ( localize(10682, "{0}: Show Log", SYNC_TITLE.value)),
|
|
1030
|
+
tooltip: ( localize(10683, "Show Log")),
|
|
1031
1031
|
icon: Codicon.output,
|
|
1032
1032
|
menu: [{
|
|
1033
1033
|
id: MenuId.CommandPalette,
|
|
@@ -1092,7 +1092,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1092
1092
|
constructor() {
|
|
1093
1093
|
super({
|
|
1094
1094
|
id: 'workbench.userDataSync.actions.acceptMerges',
|
|
1095
|
-
title: ( localize(
|
|
1095
|
+
title: ( localize(10684, "Complete Merge")),
|
|
1096
1096
|
menu: [{
|
|
1097
1097
|
id: MenuId.EditorContent,
|
|
1098
1098
|
when: ( ContextKeyExpr.and(ctxIsMergeResultEditor, ( ContextKeyExpr.regex(ctxMergeBaseUri.key, ( new RegExp(`^${USER_DATA_SYNC_SCHEME}:`)))))),
|
|
@@ -1124,7 +1124,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1124
1124
|
const notificationService = accessor.get(INotificationService);
|
|
1125
1125
|
const folder = await userDataSyncWorkbenchService.downloadSyncActivity();
|
|
1126
1126
|
if (folder) {
|
|
1127
|
-
notificationService.info(( localize(
|
|
1127
|
+
notificationService.info(( localize(10685, "Successfully downloaded Settings Sync activity.")));
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
1130
|
}));
|
|
@@ -1151,7 +1151,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1151
1151
|
constructor() {
|
|
1152
1152
|
super({
|
|
1153
1153
|
id: 'workbench.actions.syncData.reset',
|
|
1154
|
-
title: ( localize(
|
|
1154
|
+
title: ( localize(10686, "Clear Data in Cloud...")),
|
|
1155
1155
|
menu: [{
|
|
1156
1156
|
id: MenuId.ViewContainerTitle,
|
|
1157
1157
|
when: ( ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID)),
|
|
@@ -44,7 +44,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
44
44
|
renderTreeView(container) {
|
|
45
45
|
super.renderTreeView(append(container, $('')));
|
|
46
46
|
const that = this;
|
|
47
|
-
this.treeView.message = ( localize(
|
|
47
|
+
this.treeView.message = ( localize(10687, "Please go through each entry and merge to resolve conflicts."));
|
|
48
48
|
this.treeView.dataProvider = { getChildren() { return that.getTreeItems(); } };
|
|
49
49
|
}
|
|
50
50
|
async getTreeItems() {
|
|
@@ -108,7 +108,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
108
108
|
constructor() {
|
|
109
109
|
super({
|
|
110
110
|
id: `workbench.actions.sync.openConflicts`,
|
|
111
|
-
title: ( localize(
|
|
111
|
+
title: ( localize(10688, "Show Conflicts")),
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
async run(accessor, handle) {
|
|
@@ -120,7 +120,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
120
120
|
constructor() {
|
|
121
121
|
super({
|
|
122
122
|
id: `workbench.actions.sync.acceptRemote`,
|
|
123
|
-
title: ( localize(
|
|
123
|
+
title: ( localize(10689, "Accept Remote")),
|
|
124
124
|
icon: Codicon.cloudDownload,
|
|
125
125
|
menu: {
|
|
126
126
|
id: MenuId.ViewItemContext,
|
|
@@ -139,7 +139,7 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
139
139
|
constructor() {
|
|
140
140
|
super({
|
|
141
141
|
id: `workbench.actions.sync.acceptLocal`,
|
|
142
|
-
title: ( localize(
|
|
142
|
+
title: ( localize(10690, "Accept Local")),
|
|
143
143
|
icon: Codicon.cloudUpload,
|
|
144
144
|
menu: {
|
|
145
145
|
id: MenuId.ViewItemContext,
|
|
@@ -161,11 +161,11 @@ let UserDataSyncConflictsViewPane = class UserDataSyncConflictsViewPane extends
|
|
|
161
161
|
))))) {
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
const remoteResourceName = ( localize(
|
|
165
|
-
const localResourceName = ( localize(
|
|
164
|
+
const remoteResourceName = ( localize(10691, "{0} (Remote)", basename(conflictToOpen.remoteResource)));
|
|
165
|
+
const localResourceName = ( localize(10692, "{0} (Local)", basename(conflictToOpen.remoteResource)));
|
|
166
166
|
await this.editorService.openEditor({
|
|
167
|
-
input1: { resource: conflictToOpen.remoteResource, label: ( localize(
|
|
168
|
-
input2: { resource: conflictToOpen.localResource, label: ( localize(
|
|
167
|
+
input1: { resource: conflictToOpen.remoteResource, label: ( localize(10693, 'Theirs')), description: remoteResourceName },
|
|
168
|
+
input2: { resource: conflictToOpen.localResource, label: ( localize(10694, 'Yours')), description: localResourceName },
|
|
169
169
|
base: { resource: conflictToOpen.baseResource },
|
|
170
170
|
result: { resource: conflictToOpen.previewResource },
|
|
171
171
|
options: {
|
|
@@ -7,7 +7,7 @@ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/reso
|
|
|
7
7
|
import { IUserDataProfilesService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
8
8
|
import { IUserDataAutoSyncService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
9
9
|
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
10
|
-
import { VIEWLET_ID } from '@codingame/monaco-vscode-
|
|
10
|
+
import { VIEWLET_ID } from '@codingame/monaco-vscode-972e8507-3a64-566d-8bc0-b78993998562-common/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
11
11
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
12
12
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
13
13
|
import { KeybindingsEditorInput } from '@codingame/monaco-vscode-e72c94ca-257a-5b75-8b68-5a5fa3c18255-common/vscode/vs/workbench/services/preferences/browser/keybindingsEditorInput';
|
|
@@ -55,7 +55,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
55
55
|
}
|
|
56
56
|
registerConflictsView(container) {
|
|
57
57
|
const viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
|
|
58
|
-
const viewName = ( localize2(
|
|
58
|
+
const viewName = ( localize2(10695, "Conflicts"));
|
|
59
59
|
const viewDescriptor = {
|
|
60
60
|
id: SYNC_CONFLICTS_VIEW_ID,
|
|
61
61
|
name: viewName,
|
|
@@ -71,7 +71,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
71
71
|
}
|
|
72
72
|
registerMachinesView(container) {
|
|
73
73
|
const id = `workbench.views.sync.machines`;
|
|
74
|
-
const name = ( localize2(
|
|
74
|
+
const name = ( localize2(10696, "Synced Machines"));
|
|
75
75
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
76
76
|
const dataProvider = this.instantiationService.createInstance(UserDataSyncMachinesViewDataProvider, treeView);
|
|
77
77
|
treeView.showRefreshAction = true;
|
|
@@ -95,7 +95,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
95
95
|
constructor() {
|
|
96
96
|
super({
|
|
97
97
|
id: `workbench.actions.sync.editMachineName`,
|
|
98
|
-
title: ( localize(
|
|
98
|
+
title: ( localize(10697, "Edit Name")),
|
|
99
99
|
icon: Codicon.edit,
|
|
100
100
|
menu: {
|
|
101
101
|
id: MenuId.ViewItemContext,
|
|
@@ -115,7 +115,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
115
115
|
constructor() {
|
|
116
116
|
super({
|
|
117
117
|
id: `workbench.actions.sync.turnOffSyncOnMachine`,
|
|
118
|
-
title: ( localize(
|
|
118
|
+
title: ( localize(10698, "Turn off Settings Sync")),
|
|
119
119
|
menu: {
|
|
120
120
|
id: MenuId.ViewItemContext,
|
|
121
121
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', id)), ( ContextKeyExpr.equals('viewItem', 'sync-machine')))),
|
|
@@ -131,7 +131,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
131
131
|
}
|
|
132
132
|
registerActivityView(container, remote) {
|
|
133
133
|
const id = `workbench.views.sync.${remote ? 'remote' : 'local'}Activity`;
|
|
134
|
-
const name = remote ? ( localize2(
|
|
134
|
+
const name = remote ? ( localize2(10699, "Sync Activity (Remote)")) : ( localize2(10700, "Sync Activity (Local)"));
|
|
135
135
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
136
136
|
treeView.showCollapseAllAction = true;
|
|
137
137
|
treeView.showRefreshAction = true;
|
|
@@ -156,7 +156,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
156
156
|
}
|
|
157
157
|
registerExternalActivityView(container) {
|
|
158
158
|
const id = `workbench.views.sync.externalActivity`;
|
|
159
|
-
const name = ( localize2(
|
|
159
|
+
const name = ( localize2(10701, "Sync Activity (Developer)"));
|
|
160
160
|
const dataProvider = this.instantiationService.createInstance(ExtractedUserDataSyncActivityViewDataProvider, undefined);
|
|
161
161
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
162
162
|
treeView.showCollapseAllAction = false;
|
|
@@ -179,7 +179,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
179
179
|
constructor() {
|
|
180
180
|
super({
|
|
181
181
|
id: `workbench.actions.sync.loadActivity`,
|
|
182
|
-
title: ( localize(
|
|
182
|
+
title: ( localize(10702, "Load Sync Activity")),
|
|
183
183
|
icon: Codicon.cloudUpload,
|
|
184
184
|
menu: {
|
|
185
185
|
id: MenuId.ViewTitle,
|
|
@@ -191,7 +191,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
191
191
|
async run(accessor) {
|
|
192
192
|
const fileDialogService = accessor.get(IFileDialogService);
|
|
193
193
|
const result = await fileDialogService.showOpenDialog({
|
|
194
|
-
title: ( localize(
|
|
194
|
+
title: ( localize(10703, "Select Sync Activity File or Folder")),
|
|
195
195
|
canSelectFiles: true,
|
|
196
196
|
canSelectFolders: true,
|
|
197
197
|
canSelectMany: false,
|
|
@@ -209,7 +209,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
209
209
|
constructor() {
|
|
210
210
|
super({
|
|
211
211
|
id: `workbench.actions.sync.${viewId}.resolveResource`,
|
|
212
|
-
title: ( localize(
|
|
212
|
+
title: ( localize(10704, "Show raw JSON sync data")),
|
|
213
213
|
menu: {
|
|
214
214
|
id: MenuId.ViewItemContext,
|
|
215
215
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', viewId)), ( ContextKeyExpr.regex('viewItem', /sync-resource-.*/i))))
|
|
@@ -226,7 +226,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
226
226
|
constructor() {
|
|
227
227
|
super({
|
|
228
228
|
id: `workbench.actions.sync.${viewId}.compareWithLocal`,
|
|
229
|
-
title: ( localize(
|
|
229
|
+
title: ( localize(10705, "Compare with Local")),
|
|
230
230
|
menu: {
|
|
231
231
|
id: MenuId.ViewItemContext,
|
|
232
232
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', viewId)), ( ContextKeyExpr.regex('viewItem', /sync-associatedResource-.*/i))))
|
|
@@ -239,10 +239,10 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
239
239
|
const remoteResource = ( URI.parse(resource));
|
|
240
240
|
const localResource = ( URI.parse(comparableResource));
|
|
241
241
|
return commandService.executeCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID, remoteResource, localResource, ( localize(
|
|
242
|
-
|
|
242
|
+
10706,
|
|
243
243
|
"{0} ↔ {1}",
|
|
244
|
-
localize(
|
|
245
|
-
localize(
|
|
244
|
+
localize(10707, "{0} (Remote)", basename(remoteResource)),
|
|
245
|
+
localize(10708, "{0} (Local)", basename(localResource))
|
|
246
246
|
)), undefined);
|
|
247
247
|
}
|
|
248
248
|
}));
|
|
@@ -250,7 +250,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
250
250
|
constructor() {
|
|
251
251
|
super({
|
|
252
252
|
id: `workbench.actions.sync.${viewId}.replaceCurrent`,
|
|
253
|
-
title: ( localize(
|
|
253
|
+
title: ( localize(10709, "Restore")),
|
|
254
254
|
icon: Codicon.discard,
|
|
255
255
|
menu: {
|
|
256
256
|
id: MenuId.ViewItemContext,
|
|
@@ -265,7 +265,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
265
265
|
const { syncResourceHandle, syncResource } = JSON.parse(handle.$treeItemHandle);
|
|
266
266
|
const result = await dialogService.confirm({
|
|
267
267
|
message: ( localize(
|
|
268
|
-
|
|
268
|
+
10710,
|
|
269
269
|
"Would you like to replace your current {0} with selected?",
|
|
270
270
|
getSyncAreaLabel(syncResource)
|
|
271
271
|
)),
|
|
@@ -280,7 +280,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
280
280
|
}
|
|
281
281
|
registerTroubleShootView(container) {
|
|
282
282
|
const id = `workbench.views.sync.troubleshoot`;
|
|
283
|
-
const name = ( localize2(
|
|
283
|
+
const name = ( localize2(10711, "Troubleshoot"));
|
|
284
284
|
const treeView = this.instantiationService.createInstance(TreeView, id, name.value);
|
|
285
285
|
const dataProvider = this.instantiationService.createInstance(UserDataSyncTroubleshootViewDataProvider);
|
|
286
286
|
treeView.showRefreshAction = true;
|
|
@@ -344,7 +344,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
344
344
|
message: error.message,
|
|
345
345
|
actions: {
|
|
346
346
|
primary: [
|
|
347
|
-
( new Action('reset', ( localize(
|
|
347
|
+
( new Action('reset', ( localize(10712, "Reset Synced Data")), undefined, true, () => this.userDataSyncWorkbenchService.resetSyncedData())),
|
|
348
348
|
]
|
|
349
349
|
}
|
|
350
350
|
});
|
|
@@ -400,7 +400,7 @@ let UserDataSyncActivityViewDataProvider = class UserDataSyncActivityViewDataPro
|
|
|
400
400
|
previousResource,
|
|
401
401
|
resource,
|
|
402
402
|
( localize(
|
|
403
|
-
|
|
403
|
+
10713,
|
|
404
404
|
"{0} ↔ {1}",
|
|
405
405
|
`${basename(resource)} (${fromNow(syncResourceHandle.previous.created, true)})`,
|
|
406
406
|
`${basename(resource)} (${fromNow(syncResourceHandle.created, true)})`
|
|
@@ -493,7 +493,7 @@ let RemoteUserDataSyncActivityViewDataProvider = class RemoteUserDataSyncActivit
|
|
|
493
493
|
if (machineId) {
|
|
494
494
|
const machines = await this.getMachines();
|
|
495
495
|
const machine = machines.find(({ id }) => id === machineId);
|
|
496
|
-
children[0].description = machine?.isCurrent ? ( localize(
|
|
496
|
+
children[0].description = machine?.isCurrent ? ( localize(10714, "Current")) : machine?.name;
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
return children;
|
|
@@ -549,7 +549,7 @@ let ExtractedUserDataSyncActivityViewDataProvider = class ExtractedUserDataSyncA
|
|
|
549
549
|
if (machineId) {
|
|
550
550
|
const machines = await this.getMachines();
|
|
551
551
|
const machine = machines.find(({ id }) => id === machineId);
|
|
552
|
-
children[0].description = machine?.isCurrent ? ( localize(
|
|
552
|
+
children[0].description = machine?.isCurrent ? ( localize(10714, "Current")) : machine?.name;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
return children;
|
|
@@ -587,12 +587,12 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
587
587
|
try {
|
|
588
588
|
let machines = await this.getMachines();
|
|
589
589
|
machines = machines.filter(m => !m.disabled).sort((m1, m2) => m1.isCurrent ? -1 : 1);
|
|
590
|
-
this.treeView.message = machines.length ? undefined : ( localize(
|
|
590
|
+
this.treeView.message = machines.length ? undefined : ( localize(10715, "No Machines"));
|
|
591
591
|
return (machines.map(({ id, name, isCurrent, platform }) => ({
|
|
592
592
|
handle: id,
|
|
593
593
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
594
594
|
label: { label: name },
|
|
595
|
-
description: isCurrent ? ( localize(
|
|
595
|
+
description: isCurrent ? ( localize(10714, "Current")) : undefined,
|
|
596
596
|
themeIcon: platform && isWebPlatform(platform) ? Codicon.globe : Codicon.vm,
|
|
597
597
|
contextValue: 'sync-machine'
|
|
598
598
|
})));
|
|
@@ -612,17 +612,17 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
612
612
|
const machines = await this.getMachines();
|
|
613
613
|
const machinesToDisable = machines.filter(({ id }) => machineIds.includes(id));
|
|
614
614
|
if (!machinesToDisable.length) {
|
|
615
|
-
throw ( new Error(( localize(
|
|
615
|
+
throw ( new Error(( localize(10716, "machine not found with id: {0}", machineIds.join(',')))));
|
|
616
616
|
}
|
|
617
617
|
const result = await this.dialogService.confirm({
|
|
618
618
|
type: 'info',
|
|
619
|
-
message: machinesToDisable.length > 1 ? ( localize(
|
|
619
|
+
message: machinesToDisable.length > 1 ? ( localize(10717, "Are you sure you want to turn off sync on selected machines?"))
|
|
620
620
|
: ( localize(
|
|
621
|
-
|
|
621
|
+
10718,
|
|
622
622
|
"Are you sure you want to turn off sync on {0}?",
|
|
623
623
|
machinesToDisable[0].name
|
|
624
624
|
)),
|
|
625
|
-
primaryButton: ( localize(
|
|
625
|
+
primaryButton: ( localize(10719, "&&Turn off")),
|
|
626
626
|
});
|
|
627
627
|
if (!result.confirmed) {
|
|
628
628
|
return false;
|
|
@@ -640,7 +640,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
640
640
|
async rename(machineId) {
|
|
641
641
|
const disposableStore = ( new DisposableStore());
|
|
642
642
|
const inputBox = disposableStore.add(this.quickInputService.createInputBox());
|
|
643
|
-
inputBox.placeholder = ( localize(
|
|
643
|
+
inputBox.placeholder = ( localize(10720, "Enter the name of the machine"));
|
|
644
644
|
inputBox.busy = true;
|
|
645
645
|
inputBox.show();
|
|
646
646
|
const machines = await this.getMachines();
|
|
@@ -648,7 +648,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
648
648
|
if (!machine) {
|
|
649
649
|
inputBox.hide();
|
|
650
650
|
disposableStore.dispose();
|
|
651
|
-
throw ( new Error(( localize(
|
|
651
|
+
throw ( new Error(( localize(10716, "machine not found with id: {0}", machineId))));
|
|
652
652
|
}
|
|
653
653
|
inputBox.busy = false;
|
|
654
654
|
inputBox.value = machine.name;
|
|
@@ -656,7 +656,7 @@ let UserDataSyncMachinesViewDataProvider = class UserDataSyncMachinesViewDataPro
|
|
|
656
656
|
machineName = machineName.trim();
|
|
657
657
|
return machineName && !( machines.some(m => m.id !== machineId && m.name === machineName)) ? machineName : null;
|
|
658
658
|
};
|
|
659
|
-
disposableStore.add(inputBox.onDidChangeValue(() => inputBox.validationMessage = validateMachineName(inputBox.value) ? '' : ( localize(
|
|
659
|
+
disposableStore.add(inputBox.onDidChangeValue(() => inputBox.validationMessage = validateMachineName(inputBox.value) ? '' : ( localize(10721, "Machine name should be unique and not empty"))));
|
|
660
660
|
return ( new Promise((c, e) => {
|
|
661
661
|
disposableStore.add(inputBox.onDidAccept(async () => {
|
|
662
662
|
const machineName = validateMachineName(inputBox.value);
|
|
@@ -696,12 +696,12 @@ let UserDataSyncTroubleshootViewDataProvider = class UserDataSyncTroubleshootVie
|
|
|
696
696
|
return [{
|
|
697
697
|
handle: 'SYNC_LOGS',
|
|
698
698
|
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
|
699
|
-
label: { label: ( localize(
|
|
699
|
+
label: { label: ( localize(10722, "Logs")) },
|
|
700
700
|
themeIcon: Codicon.folder,
|
|
701
701
|
}, {
|
|
702
702
|
handle: 'LAST_SYNC_STATES',
|
|
703
703
|
collapsibleState: TreeItemCollapsibleState.Collapsed,
|
|
704
|
-
label: { label: ( localize(
|
|
704
|
+
label: { label: ( localize(10723, "Last Synced Remotes")) },
|
|
705
705
|
themeIcon: Codicon.folder,
|
|
706
706
|
}];
|
|
707
707
|
}
|
|
@@ -739,7 +739,7 @@ let UserDataSyncTroubleshootViewDataProvider = class UserDataSyncTroubleshootVie
|
|
|
739
739
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
740
740
|
resourceUri: syncLogResource,
|
|
741
741
|
label: { label: this.uriIdentityService.extUri.basename(logFolder) },
|
|
742
|
-
description: this.uriIdentityService.extUri.isEqual(logFolder, this.environmentService.logsHome) ? ( localize(
|
|
742
|
+
description: this.uriIdentityService.extUri.isEqual(logFolder, this.environmentService.logsHome) ? ( localize(10714, "Current")) : undefined,
|
|
743
743
|
command: { id: API_OPEN_EDITOR_COMMAND_ID, title: '', arguments: [syncLogResource, undefined, undefined] },
|
|
744
744
|
});
|
|
745
745
|
}
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SyncResource } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataSync/common/userDataSync";
|
|
2
2
|
import { IUserDataSyncEnablementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataSync/common/userDataSync.service";
|
|
3
3
|
import { UserDataSyncEnablementService as BaseUserDataSyncEnablementService } from "../../../../platform/userDataSync/common/userDataSyncEnablementService.js";
|
|
4
|
-
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-
|
|
4
|
+
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
5
5
|
export declare class UserDataSyncEnablementService extends BaseUserDataSyncEnablementService implements IUserDataSyncEnablementService {
|
|
6
6
|
protected get workbenchEnvironmentService(): IBrowserWorkbenchEnvironmentService;
|
|
7
7
|
getResourceSyncStateVersion(resource: SyncResource): string | undefined;
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { ILifecycleService } from "@codingame/monaco-vscode-api/vscode/vs/workbe
|
|
|
28
28
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
29
29
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
30
30
|
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
31
|
-
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-
|
|
31
|
+
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
32
32
|
import { IUserDataInitializationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userData/browser/userDataInit.service";
|
|
33
33
|
import { ISecretStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service";
|
|
34
34
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js
CHANGED
|
@@ -37,7 +37,7 @@ import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
37
37
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
38
38
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
39
39
|
import { isDiffEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
40
|
-
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-
|
|
40
|
+
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
41
41
|
import { IUserDataInitializationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userData/browser/userDataInit.service';
|
|
42
42
|
import { ISecretStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service';
|
|
43
43
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
@@ -241,7 +241,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
241
241
|
async turnOn() {
|
|
242
242
|
if (!this.authenticationProviders.length) {
|
|
243
243
|
throw ( new Error(( localize(
|
|
244
|
-
|
|
244
|
+
12048,
|
|
245
245
|
"Settings sync cannot be turned on because there are no authentication providers available."
|
|
246
246
|
))));
|
|
247
247
|
}
|
|
@@ -256,16 +256,16 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
256
256
|
throw ( new CancellationError());
|
|
257
257
|
}
|
|
258
258
|
if (this.accountStatus !== AccountStatus.Available) {
|
|
259
|
-
throw ( new Error(( localize(
|
|
259
|
+
throw ( new Error(( localize(12049, "No account available"))));
|
|
260
260
|
}
|
|
261
261
|
const turnOnSyncCancellationToken = this.turnOnSyncCancellationToken = ( new CancellationTokenSource());
|
|
262
262
|
const disposable = isWeb ? Disposable.None : this.lifecycleService.onBeforeShutdown(e => e.veto((async () => {
|
|
263
263
|
const { confirmed } = await this.dialogService.confirm({
|
|
264
264
|
type: 'warning',
|
|
265
|
-
message: ( localize(
|
|
266
|
-
title: ( localize(
|
|
267
|
-
primaryButton: ( localize(
|
|
268
|
-
cancelButton: ( localize(
|
|
265
|
+
message: ( localize(12050, "Settings Sync is being turned on. Would you like to cancel it?")),
|
|
266
|
+
title: ( localize(12051, "Settings Sync")),
|
|
267
|
+
primaryButton: ( localize(12052, "&&Yes")),
|
|
268
|
+
cancelButton: ( localize(12053, "No"))
|
|
269
269
|
});
|
|
270
270
|
if (confirmed) {
|
|
271
271
|
turnOnSyncCancellationToken.cancel();
|
|
@@ -287,7 +287,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
287
287
|
if (this.environmentService.options?.settingsSyncOptions?.enablementHandler && this.currentAuthenticationProviderId) {
|
|
288
288
|
this.environmentService.options.settingsSyncOptions.enablementHandler(true, this.currentAuthenticationProviderId);
|
|
289
289
|
}
|
|
290
|
-
this.notificationService.info(( localize(
|
|
290
|
+
this.notificationService.info(( localize(12054, "{0} is turned on", SYNC_TITLE.value)));
|
|
291
291
|
this._onDidTurnOnSync.fire();
|
|
292
292
|
}
|
|
293
293
|
async turnoff(everywhere) {
|
|
@@ -328,13 +328,13 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
328
328
|
command: SHOW_SYNC_LOG_COMMAND_ID,
|
|
329
329
|
delay: 500,
|
|
330
330
|
}, async (progress) => {
|
|
331
|
-
progress.report({ message: ( localize(
|
|
331
|
+
progress.report({ message: ( localize(12055, "Turning on...")) });
|
|
332
332
|
disposables.add(this.userDataSyncService.onDidChangeStatus(status => {
|
|
333
333
|
if (status === SyncStatus.HasConflicts) {
|
|
334
|
-
progress.report({ message: ( localize(
|
|
334
|
+
progress.report({ message: ( localize(12056, "Resolving conflicts...")) });
|
|
335
335
|
}
|
|
336
336
|
else {
|
|
337
|
-
progress.report({ message: ( localize(
|
|
337
|
+
progress.report({ message: ( localize(12057, "Turning on...")) });
|
|
338
338
|
}
|
|
339
339
|
}));
|
|
340
340
|
await manualSyncTask.merge();
|
|
@@ -355,11 +355,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
355
355
|
async handleConflictsWhileTurningOn(token) {
|
|
356
356
|
await this.dialogService.prompt({
|
|
357
357
|
type: Severity.Warning,
|
|
358
|
-
message: ( localize(
|
|
359
|
-
detail: ( localize(
|
|
358
|
+
message: ( localize(12058, "Conflicts Detected")),
|
|
359
|
+
detail: ( localize(12059, "Please resolve conflicts to turn on...")),
|
|
360
360
|
buttons: [
|
|
361
361
|
{
|
|
362
|
-
label: ( localize(
|
|
362
|
+
label: ( localize(12060, "&&Show Conflicts")),
|
|
363
363
|
run: async () => {
|
|
364
364
|
const waitUntilConflictsAreResolvedPromise = raceCancellationError(Event.toPromise(Event.filter(this.userDataSyncService.onDidChangeConflicts, conficts => conficts.length === 0)), token);
|
|
365
365
|
await this.showConflicts(this.userDataSyncService.conflicts[0]?.conflicts[0]);
|
|
@@ -367,11 +367,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
367
367
|
}
|
|
368
368
|
},
|
|
369
369
|
{
|
|
370
|
-
label: ( localize(
|
|
370
|
+
label: ( localize(12061, "Replace &&Local")),
|
|
371
371
|
run: async () => this.replace(true)
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
|
-
label: ( localize(
|
|
374
|
+
label: ( localize(12062, "Replace &&Remote")),
|
|
375
375
|
run: () => this.replace(false)
|
|
376
376
|
},
|
|
377
377
|
],
|
|
@@ -406,11 +406,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
406
406
|
const { confirmed } = await this.dialogService.confirm({
|
|
407
407
|
type: 'info',
|
|
408
408
|
message: ( localize(
|
|
409
|
-
|
|
409
|
+
12063,
|
|
410
410
|
"This will clear your data in the cloud and stop sync on all your devices."
|
|
411
411
|
)),
|
|
412
|
-
title: ( localize(
|
|
413
|
-
primaryButton: ( localize(
|
|
412
|
+
title: ( localize(12064, "Clear")),
|
|
413
|
+
primaryButton: ( localize(12065, "&&Reset")),
|
|
414
414
|
});
|
|
415
415
|
if (confirmed) {
|
|
416
416
|
await this.userDataSyncService.resetRemote();
|
|
@@ -443,11 +443,11 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
443
443
|
}
|
|
444
444
|
async downloadSyncActivity() {
|
|
445
445
|
const result = await this.fileDialogService.showOpenDialog({
|
|
446
|
-
title: ( localize(
|
|
446
|
+
title: ( localize(12066, "Select folder to download Settings Sync activity")),
|
|
447
447
|
canSelectFiles: false,
|
|
448
448
|
canSelectFolders: true,
|
|
449
449
|
canSelectMany: false,
|
|
450
|
-
openLabel: ( localize(
|
|
450
|
+
openLabel: ( localize(12067, "Save")),
|
|
451
451
|
});
|
|
452
452
|
if (!result?.[0]) {
|
|
453
453
|
return;
|
|
@@ -503,7 +503,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
503
503
|
else {
|
|
504
504
|
if (!this.authenticationProviders.length) {
|
|
505
505
|
throw ( new Error(( localize(
|
|
506
|
-
|
|
506
|
+
12068,
|
|
507
507
|
"Cannot sign in because there are no authentication providers available."
|
|
508
508
|
))));
|
|
509
509
|
}
|
|
@@ -545,7 +545,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
545
545
|
quickPick.title = SYNC_TITLE.value;
|
|
546
546
|
quickPick.ok = false;
|
|
547
547
|
quickPick.ignoreFocusOut = true;
|
|
548
|
-
quickPick.placeholder = ( localize(
|
|
548
|
+
quickPick.placeholder = ( localize(12069, "Select an account to sign in"));
|
|
549
549
|
quickPick.show();
|
|
550
550
|
if (authenticationProviders.length > 1) {
|
|
551
551
|
quickPick.busy = true;
|
|
@@ -583,26 +583,26 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
583
583
|
createQuickpickItems(authenticationProviders, allAccounts) {
|
|
584
584
|
const quickPickItems = [];
|
|
585
585
|
if (allAccounts.size) {
|
|
586
|
-
quickPickItems.push({ type: 'separator', label: ( localize(
|
|
586
|
+
quickPickItems.push({ type: 'separator', label: ( localize(12070, "Signed in")) });
|
|
587
587
|
for (const authenticationProvider of authenticationProviders) {
|
|
588
588
|
const accounts = (allAccounts.get(authenticationProvider.id) || []).sort(({ sessionId }) => sessionId === this.currentSessionId ? -1 : 1);
|
|
589
589
|
const providerName = this.authenticationService.getProvider(authenticationProvider.id).label;
|
|
590
590
|
for (const account of accounts) {
|
|
591
591
|
quickPickItems.push({
|
|
592
592
|
label: `${account.accountName} (${providerName})`,
|
|
593
|
-
description: account.sessionId === this.current?.sessionId ? ( localize(
|
|
593
|
+
description: account.sessionId === this.current?.sessionId ? ( localize(12071, "Last Used with Sync")) : undefined,
|
|
594
594
|
account,
|
|
595
595
|
authenticationProvider,
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
quickPickItems.push({ type: 'separator', label: ( localize(
|
|
599
|
+
quickPickItems.push({ type: 'separator', label: ( localize(12072, "Others")) });
|
|
600
600
|
}
|
|
601
601
|
for (const authenticationProvider of authenticationProviders) {
|
|
602
602
|
const provider = this.authenticationService.getProvider(authenticationProvider.id);
|
|
603
603
|
if (!( allAccounts.has(authenticationProvider.id)) || provider.supportsMultipleAccounts) {
|
|
604
604
|
const providerName = provider.label;
|
|
605
|
-
quickPickItems.push({ label: ( localize(
|
|
605
|
+
quickPickItems.push({ label: ( localize(12073, "Sign in with {0}", providerName)), authenticationProvider });
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
return quickPickItems;
|