@codingame/monaco-vscode-edit-sessions-service-override 8.0.3 → 9.0.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 +2 -2
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.js +71 -66
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.js +16 -15
- package/vscode/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.js +13 -13
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +3 -3
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessionsLogService.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-edit-sessions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@9.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
+
import { Disposable, MutableDisposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
4
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
5
|
import { ShutdownReason, LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
@@ -79,24 +79,24 @@ import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
|
79
79
|
var EditSessionsContribution_1;
|
|
80
80
|
const continueWorkingOnCommand = {
|
|
81
81
|
id: '_workbench.editSessions.actions.continueEditSession',
|
|
82
|
-
title: ( localize2(
|
|
82
|
+
title: ( localize2(1916, 'Continue Working On...')),
|
|
83
83
|
precondition: ( (WorkspaceFolderCountContext.notEqualsTo('0'))),
|
|
84
84
|
f1: true
|
|
85
85
|
};
|
|
86
86
|
const openLocalFolderCommand = {
|
|
87
87
|
id: '_workbench.editSessions.actions.continueEditSession.openLocalFolder',
|
|
88
|
-
title: ( localize2(
|
|
88
|
+
title: ( localize2(1917, 'Open In Local Folder')),
|
|
89
89
|
category: EDIT_SESSION_SYNC_CATEGORY,
|
|
90
90
|
precondition: ( (ContextKeyExpr.and( (IsWebContext.toNegated()), VirtualWorkspaceContext)))
|
|
91
91
|
};
|
|
92
92
|
const showOutputChannelCommand = {
|
|
93
93
|
id: 'workbench.editSessions.actions.showOutputChannel',
|
|
94
|
-
title: ( localize2(
|
|
94
|
+
title: ( localize2(1918, "Show Log")),
|
|
95
95
|
category: EDIT_SESSION_SYNC_CATEGORY
|
|
96
96
|
};
|
|
97
97
|
const installAdditionalContinueOnOptionsCommand = {
|
|
98
98
|
id: 'workbench.action.continueOn.extensions',
|
|
99
|
-
title: ( localize(
|
|
99
|
+
title: ( localize(1919, 'Install additional development environment options')),
|
|
100
100
|
};
|
|
101
101
|
registerAction2(class extends Action2 {
|
|
102
102
|
constructor() {
|
|
@@ -109,7 +109,7 @@ registerAction2(class extends Action2 {
|
|
|
109
109
|
view?.search('@tag:continueOn');
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
const resumeProgressOptionsTitle = `[${( localize(
|
|
112
|
+
const resumeProgressOptionsTitle = `[${( localize(1920, 'Resuming working changes...'))}](command:${showOutputChannelCommand.id})`;
|
|
113
113
|
const resumeProgressOptions = {
|
|
114
114
|
location: ProgressLocation.Window,
|
|
115
115
|
type: 'syncing',
|
|
@@ -190,7 +190,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
190
190
|
this._register(this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, ( (new EditSessionsFileSystemProvider(this.editSessionsStorageService)))));
|
|
191
191
|
this.lifecycleService.onWillShutdown((e) => {
|
|
192
192
|
if (e.reason !== ShutdownReason.RELOAD && this.editSessionsStorageService.isSignedIn && this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) {
|
|
193
|
-
e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: ( localize(
|
|
193
|
+
e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: ( localize(1921, 'Storing current working changes...')) });
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
this._register(this.editSessionsStorageService.onDidSignIn(() => this.updateAccountsMenuBadge()));
|
|
@@ -248,7 +248,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
248
248
|
if (this.editSessionsStorageService.isSignedIn) {
|
|
249
249
|
return this.accountsMenuBadgeDisposable.clear();
|
|
250
250
|
}
|
|
251
|
-
const badge = ( (new NumberBadge(1, () => ( localize(
|
|
251
|
+
const badge = ( (new NumberBadge(1, () => ( localize(1922, 'Check for pending cloud changes')))));
|
|
252
252
|
this.accountsMenuBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
|
|
253
253
|
}
|
|
254
254
|
async autoStoreEditSession() {
|
|
@@ -256,7 +256,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
256
256
|
await this.progressService.withProgress({
|
|
257
257
|
location: ProgressLocation.Window,
|
|
258
258
|
type: 'syncing',
|
|
259
|
-
title: ( localize(
|
|
259
|
+
title: ( localize(1923, 'Storing working changes...'))
|
|
260
260
|
}, async () => this.storeEditSession(false, cancellationTokenSource.token), () => {
|
|
261
261
|
cancellationTokenSource.cancel();
|
|
262
262
|
cancellationTokenSource.dispose();
|
|
@@ -300,7 +300,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
300
300
|
constructor() {
|
|
301
301
|
super({
|
|
302
302
|
id: 'workbench.editSessions.actions.showEditSessions',
|
|
303
|
-
title: ( localize2(
|
|
303
|
+
title: ( localize2(1924, 'Show Cloud Changes')),
|
|
304
304
|
category: EDIT_SESSION_SYNC_CATEGORY,
|
|
305
305
|
f1: true
|
|
306
306
|
});
|
|
@@ -337,7 +337,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
337
337
|
location: ProgressLocation.Notification,
|
|
338
338
|
cancellable: true,
|
|
339
339
|
type: 'syncing',
|
|
340
|
-
title: ( localize(
|
|
340
|
+
title: ( localize(1925, 'Storing your working changes...'))
|
|
341
341
|
}, async () => {
|
|
342
342
|
const ref = await that.storeEditSession(false, cancellationTokenSource.token);
|
|
343
343
|
if (ref !== undefined) {
|
|
@@ -386,7 +386,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
386
386
|
constructor() {
|
|
387
387
|
super({
|
|
388
388
|
id: 'workbench.editSessions.actions.resumeLatest',
|
|
389
|
-
title: ( localize2(
|
|
389
|
+
title: ( localize2(1926, 'Resume Latest Changes from Cloud')),
|
|
390
390
|
category: EDIT_SESSION_SYNC_CATEGORY,
|
|
391
391
|
f1: true,
|
|
392
392
|
});
|
|
@@ -399,7 +399,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
399
399
|
constructor() {
|
|
400
400
|
super({
|
|
401
401
|
id: 'workbench.editSessions.actions.resumeFromSerializedPayload',
|
|
402
|
-
title: ( localize2(
|
|
402
|
+
title: ( localize2(1927, 'Resume Changes from Serialized Data')),
|
|
403
403
|
category: 'Developer',
|
|
404
404
|
f1: true,
|
|
405
405
|
});
|
|
@@ -419,7 +419,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
419
419
|
constructor() {
|
|
420
420
|
super({
|
|
421
421
|
id: 'workbench.editSessions.actions.storeCurrent',
|
|
422
|
-
title: ( localize2(
|
|
422
|
+
title: ( localize2(1928, 'Store Working Changes in Cloud')),
|
|
423
423
|
category: EDIT_SESSION_SYNC_CATEGORY,
|
|
424
424
|
f1: true,
|
|
425
425
|
});
|
|
@@ -428,7 +428,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
428
428
|
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
429
429
|
await that.progressService.withProgress({
|
|
430
430
|
location: ProgressLocation.Notification,
|
|
431
|
-
title: ( localize(
|
|
431
|
+
title: ( localize(1929, 'Storing working changes...'))
|
|
432
432
|
}, async () => {
|
|
433
433
|
that.telemetryService.publicLog2('editSessions.store');
|
|
434
434
|
await that.storeEditSession(true, cancellationTokenSource.token);
|
|
@@ -450,14 +450,14 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
450
450
|
}
|
|
451
451
|
this.telemetryService.publicLog2('editSessions.resume');
|
|
452
452
|
performance.mark('code/willResumeEditSessionFromIdentifier');
|
|
453
|
-
progress?.report({ message: ( localize(
|
|
453
|
+
progress?.report({ message: ( localize(1930, 'Checking for pending cloud changes...')) });
|
|
454
454
|
const data = serializedData ? { content: serializedData, ref: '' } : await this.editSessionsStorageService.read('editSessions', ref);
|
|
455
455
|
if (!data) {
|
|
456
456
|
if (ref === undefined && !silent) {
|
|
457
|
-
this.notificationService.info(( localize(
|
|
457
|
+
this.notificationService.info(( localize(1931, 'There are no changes to resume from the cloud.')));
|
|
458
458
|
}
|
|
459
459
|
else if (ref !== undefined) {
|
|
460
|
-
this.notificationService.warn(( localize(
|
|
460
|
+
this.notificationService.warn(( localize(1932, 'Could not resume changes from the cloud for ID {0}.', ref)));
|
|
461
461
|
}
|
|
462
462
|
this.logService.info(ref !== undefined ? `Aborting resuming changes from cloud as no edit session content is available to be applied from ref ${ref}.` : `Aborting resuming edit session as no edit session content is available to be applied`);
|
|
463
463
|
return;
|
|
@@ -467,7 +467,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
467
467
|
ref = data.ref;
|
|
468
468
|
if (editSession.version > EditSessionSchemaVersion) {
|
|
469
469
|
this.notificationService.error(( localize(
|
|
470
|
-
|
|
470
|
+
1933,
|
|
471
471
|
"Please upgrade to a newer version of {0} to resume your working changes from the cloud.",
|
|
472
472
|
this.productService.nameLong
|
|
473
473
|
)));
|
|
@@ -484,12 +484,12 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
484
484
|
type: Severity$1.Warning,
|
|
485
485
|
message: conflictingChanges.length > 1 ?
|
|
486
486
|
( localize(
|
|
487
|
-
|
|
487
|
+
1934,
|
|
488
488
|
'Resuming your working changes from the cloud will overwrite the following {0} files. Do you want to proceed?',
|
|
489
489
|
conflictingChanges.length
|
|
490
490
|
)) :
|
|
491
491
|
( localize(
|
|
492
|
-
|
|
492
|
+
1935,
|
|
493
493
|
'Resuming your working changes from the cloud will overwrite {0}. Do you want to proceed?',
|
|
494
494
|
basename(conflictingChanges[0].uri)
|
|
495
495
|
)),
|
|
@@ -515,7 +515,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
515
515
|
}
|
|
516
516
|
catch (ex) {
|
|
517
517
|
this.logService.error('Failed to resume edit session, reason: ', ( (ex.toString())));
|
|
518
|
-
this.notificationService.error(( localize(
|
|
518
|
+
this.notificationService.error(( localize(1936, "Failed to resume your working changes from the cloud.")));
|
|
519
519
|
}
|
|
520
520
|
performance.mark('code/didResumeEditSessionFromIdentifier');
|
|
521
521
|
}
|
|
@@ -544,9 +544,9 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
544
544
|
this.configurationService.getValue('workbench.experimental.cloudChanges.partialMatches.enabled') === true) {
|
|
545
545
|
if (!applyPartialMatch) {
|
|
546
546
|
this.notificationService.prompt(Severity$1.Info, ( localize(
|
|
547
|
-
|
|
547
|
+
1937,
|
|
548
548
|
'You have pending working changes in the cloud for this workspace. Would you like to resume them?'
|
|
549
|
-
)), [{ label: ( localize(
|
|
549
|
+
)), [{ label: ( localize(1938, 'Resume')), run: () => this.resumeEditSession(ref, false, undefined, true) }]);
|
|
550
550
|
}
|
|
551
551
|
else {
|
|
552
552
|
folderRoot = f;
|
|
@@ -629,7 +629,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
629
629
|
const contents = encodeBase64((await this.fileService.readFile(uri)).value);
|
|
630
630
|
editSessionSize += contents.length;
|
|
631
631
|
if (editSessionSize > this.editSessionsStorageService.SIZE_LIMIT) {
|
|
632
|
-
this.notificationService.error(( localize(
|
|
632
|
+
this.notificationService.error(( localize(1939, 'Your working changes exceed the size limit and cannot be stored.')));
|
|
633
633
|
return undefined;
|
|
634
634
|
}
|
|
635
635
|
workingChanges.push({ type: ChangeType.Addition, fileType: FileType.File, contents: contents, relativeFilePath: relativeFilePath });
|
|
@@ -649,7 +649,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
649
649
|
this.logService.info('Skipped storing working changes in the cloud as there are no edits to store.');
|
|
650
650
|
if (fromStoreCommand) {
|
|
651
651
|
this.notificationService.info(( localize(
|
|
652
|
-
|
|
652
|
+
1940,
|
|
653
653
|
'Skipped storing working changes in the cloud as there are no edits to store.'
|
|
654
654
|
)));
|
|
655
655
|
}
|
|
@@ -668,11 +668,11 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
668
668
|
switch (ex.code) {
|
|
669
669
|
case UserDataSyncErrorCode.TooLarge:
|
|
670
670
|
this.telemetryService.publicLog2('editSessions.upload.failed', { reason: 'TooLarge' });
|
|
671
|
-
this.notificationService.error(( localize(
|
|
671
|
+
this.notificationService.error(( localize(1939, 'Your working changes exceed the size limit and cannot be stored.')));
|
|
672
672
|
break;
|
|
673
673
|
default:
|
|
674
674
|
this.telemetryService.publicLog2('editSessions.upload.failed', { reason: 'unknown' });
|
|
675
|
-
this.notificationService.error(( localize(
|
|
675
|
+
this.notificationService.error(( localize(1941, 'Your working changes cannot be stored.')));
|
|
676
676
|
break;
|
|
677
677
|
}
|
|
678
678
|
}
|
|
@@ -702,22 +702,23 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
702
702
|
return false;
|
|
703
703
|
}
|
|
704
704
|
if (this.hasEditSession()) {
|
|
705
|
-
const
|
|
706
|
-
quickpick
|
|
705
|
+
const disposables = ( (new DisposableStore()));
|
|
706
|
+
const quickpick = disposables.add(this.quickInputService.createQuickPick());
|
|
707
|
+
quickpick.placeholder = ( localize(1942, "Select whether to bring your working changes with you"));
|
|
707
708
|
quickpick.ok = false;
|
|
708
709
|
quickpick.ignoreFocusOut = true;
|
|
709
|
-
const withCloudChanges = { label: ( localize(
|
|
710
|
-
const withoutCloudChanges = { label: ( localize(
|
|
710
|
+
const withCloudChanges = { label: ( localize(1943, "Yes, continue with my working changes")) };
|
|
711
|
+
const withoutCloudChanges = { label: ( localize(1944, "No, continue without my working changes")) };
|
|
711
712
|
quickpick.items = [withCloudChanges, withoutCloudChanges];
|
|
712
713
|
const continueWithCloudChanges = await ( (new Promise((resolve, reject) => {
|
|
713
|
-
quickpick.onDidAccept(() => {
|
|
714
|
+
disposables.add(quickpick.onDidAccept(() => {
|
|
714
715
|
resolve(quickpick.selectedItems[0] === withCloudChanges);
|
|
715
|
-
|
|
716
|
-
});
|
|
717
|
-
quickpick.onDidHide(() => {
|
|
716
|
+
disposables.dispose();
|
|
717
|
+
}));
|
|
718
|
+
disposables.add(quickpick.onDidHide(() => {
|
|
718
719
|
reject(( (new CancellationError())));
|
|
719
|
-
|
|
720
|
-
});
|
|
720
|
+
disposables.dispose();
|
|
721
|
+
}));
|
|
721
722
|
quickpick.show();
|
|
722
723
|
})));
|
|
723
724
|
if (!continueWithCloudChanges) {
|
|
@@ -800,7 +801,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
800
801
|
}
|
|
801
802
|
async run(accessor) {
|
|
802
803
|
const selection = await that.fileDialogService.showOpenDialog({
|
|
803
|
-
title: ( localize(
|
|
804
|
+
title: ( localize(1945, 'Select a local folder to continue working in')),
|
|
804
805
|
canSelectFolders: true,
|
|
805
806
|
canSelectMany: false,
|
|
806
807
|
canSelectFiles: false,
|
|
@@ -814,16 +815,17 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
814
815
|
}
|
|
815
816
|
}));
|
|
816
817
|
if (getVirtualWorkspaceLocation(this.contextService.getWorkspace()) !== undefined && isNative) {
|
|
817
|
-
this.generateStandaloneOptionCommand(openLocalFolderCommand.id, ( localize(
|
|
818
|
+
this.generateStandaloneOptionCommand(openLocalFolderCommand.id, ( localize(1946, 'Continue Working in Existing Local Folder')), undefined, openLocalFolderCommand.precondition, undefined);
|
|
818
819
|
}
|
|
819
820
|
}
|
|
820
821
|
async pickContinueEditSessionDestination() {
|
|
821
|
-
const
|
|
822
|
+
const disposables = ( (new DisposableStore()));
|
|
823
|
+
const quickPick = disposables.add(this.quickInputService.createQuickPick({ useSeparators: true }));
|
|
822
824
|
const workspaceContext = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER
|
|
823
825
|
? this.contextService.getWorkspace().folders[0].name
|
|
824
826
|
: ( (this.contextService.getWorkspace().folders.map((folder) => folder.name))).join(', ');
|
|
825
827
|
quickPick.placeholder = ( localize(
|
|
826
|
-
|
|
828
|
+
1947,
|
|
827
829
|
"Select a development environment to continue working on {0} in",
|
|
828
830
|
`'${workspaceContext}'`
|
|
829
831
|
));
|
|
@@ -832,8 +834,11 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
832
834
|
quickPick.items = this.createPickItems();
|
|
833
835
|
});
|
|
834
836
|
const command = await ( (new Promise((resolve, reject) => {
|
|
835
|
-
quickPick.onDidHide(() =>
|
|
836
|
-
|
|
837
|
+
disposables.add(quickPick.onDidHide(() => {
|
|
838
|
+
disposables.dispose();
|
|
839
|
+
resolve(undefined);
|
|
840
|
+
}));
|
|
841
|
+
disposables.add(quickPick.onDidAccept((e) => {
|
|
837
842
|
const selection = quickPick.activeItems[0].command;
|
|
838
843
|
if (selection === installAdditionalContinueOnOptionsCommand.id) {
|
|
839
844
|
void this.commandService.executeCommand(installAdditionalContinueOnOptionsCommand.id);
|
|
@@ -842,14 +847,14 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
842
847
|
resolve(selection);
|
|
843
848
|
quickPick.hide();
|
|
844
849
|
}
|
|
845
|
-
});
|
|
850
|
+
}));
|
|
846
851
|
quickPick.show();
|
|
847
|
-
quickPick.onDidTriggerItemButton(async (e) => {
|
|
852
|
+
disposables.add(quickPick.onDidTriggerItemButton(async (e) => {
|
|
848
853
|
if (e.item.documentation !== undefined) {
|
|
849
854
|
const uri = URI.isUri(e.item.documentation) ? ( (URI.parse(e.item.documentation))) : await this.commandService.executeCommand(e.item.documentation);
|
|
850
855
|
void this.openerService.open(uri, { openExternal: true });
|
|
851
856
|
}
|
|
852
|
-
});
|
|
857
|
+
}));
|
|
853
858
|
})));
|
|
854
859
|
quickPick.dispose();
|
|
855
860
|
return command;
|
|
@@ -881,7 +886,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
|
|
|
881
886
|
createPickItems() {
|
|
882
887
|
const items = [...this.continueEditSessionOptions].filter((option) => option.when === undefined || this.contextKeyService.contextMatchesRules(option.when));
|
|
883
888
|
if (getVirtualWorkspaceLocation(this.contextService.getWorkspace()) !== undefined && isNative) {
|
|
884
|
-
items.push(( (new ContinueEditSessionItem('$(folder) ' + ( localize(
|
|
889
|
+
items.push(( (new ContinueEditSessionItem('$(folder) ' + ( localize(1948, 'Open in Local Folder')), openLocalFolderCommand.id, ( localize(1949, 'Built-in'))))));
|
|
885
890
|
}
|
|
886
891
|
const sortedItems = items.sort((item1, item2) => item1.label.localeCompare(item2.label));
|
|
887
892
|
return sortedItems.concat({ type: 'separator' }, ( (new ContinueEditSessionItem(
|
|
@@ -932,7 +937,7 @@ class ContinueEditSessionItem {
|
|
|
932
937
|
if (documentation !== undefined) {
|
|
933
938
|
this.buttons = [{
|
|
934
939
|
iconClass: infoButtonClass,
|
|
935
|
-
tooltip: ( localize(
|
|
940
|
+
tooltip: ( localize(1950, 'Learn More')),
|
|
936
941
|
}];
|
|
937
942
|
}
|
|
938
943
|
}
|
|
@@ -941,7 +946,7 @@ const continueEditSessionExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
941
946
|
extensionPoint: 'continueEditSession',
|
|
942
947
|
jsonSchema: {
|
|
943
948
|
description: ( localize(
|
|
944
|
-
|
|
949
|
+
1951,
|
|
945
950
|
'Contributes options for continuing the current edit session in a different environment'
|
|
946
951
|
)),
|
|
947
952
|
type: 'array',
|
|
@@ -950,35 +955,35 @@ const continueEditSessionExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
950
955
|
properties: {
|
|
951
956
|
command: {
|
|
952
957
|
description: ( localize(
|
|
953
|
-
|
|
958
|
+
1952,
|
|
954
959
|
'Identifier of the command to execute. The command must be declared in the \'commands\'-section and return a URI representing a different environment where the current edit session can be continued.'
|
|
955
960
|
)),
|
|
956
961
|
type: 'string'
|
|
957
962
|
},
|
|
958
963
|
group: {
|
|
959
|
-
description: ( localize(
|
|
964
|
+
description: ( localize(1953, 'Group into which this item belongs.')),
|
|
960
965
|
type: 'string'
|
|
961
966
|
},
|
|
962
967
|
qualifiedName: {
|
|
963
968
|
description: ( localize(
|
|
964
|
-
|
|
969
|
+
1954,
|
|
965
970
|
'A fully qualified name for this item which is used for display in menus.'
|
|
966
971
|
)),
|
|
967
972
|
type: 'string'
|
|
968
973
|
},
|
|
969
974
|
description: {
|
|
970
975
|
description: ( localize(
|
|
971
|
-
|
|
976
|
+
1955,
|
|
972
977
|
"The url, or a command that returns the url, to the option's documentation page."
|
|
973
978
|
)),
|
|
974
979
|
type: 'string'
|
|
975
980
|
},
|
|
976
981
|
remoteGroup: {
|
|
977
|
-
description: ( localize(
|
|
982
|
+
description: ( localize(1956, 'Group into which this item belongs in the remote indicator.')),
|
|
978
983
|
type: 'string'
|
|
979
984
|
},
|
|
980
985
|
when: {
|
|
981
|
-
description: ( localize(
|
|
986
|
+
description: ( localize(1957, 'Condition which must be true to show this item.')),
|
|
982
987
|
type: 'string'
|
|
983
988
|
}
|
|
984
989
|
},
|
|
@@ -995,16 +1000,16 @@ workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, Lifecy
|
|
|
995
1000
|
enum: ['onShutdown', 'off'],
|
|
996
1001
|
enumDescriptions: [
|
|
997
1002
|
( localize(
|
|
998
|
-
|
|
1003
|
+
1958,
|
|
999
1004
|
"Automatically store current working changes in the cloud on window close."
|
|
1000
1005
|
)),
|
|
1001
|
-
( localize(
|
|
1006
|
+
( localize(1959, "Never attempt to automatically store working changes in the cloud."))
|
|
1002
1007
|
],
|
|
1003
1008
|
'type': 'string',
|
|
1004
1009
|
'tags': ['experimental', 'usesOnlineServices'],
|
|
1005
1010
|
'default': 'off',
|
|
1006
1011
|
'markdownDescription': ( localize(
|
|
1007
|
-
|
|
1012
|
+
1960,
|
|
1008
1013
|
"Controls whether to automatically store available working changes in the cloud for the current workspace. This setting has no effect in the web."
|
|
1009
1014
|
)),
|
|
1010
1015
|
},
|
|
@@ -1012,16 +1017,16 @@ workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, Lifecy
|
|
|
1012
1017
|
enum: ['onReload', 'off'],
|
|
1013
1018
|
enumDescriptions: [
|
|
1014
1019
|
( localize(
|
|
1015
|
-
|
|
1020
|
+
1961,
|
|
1016
1021
|
"Automatically resume available working changes from the cloud on window reload."
|
|
1017
1022
|
)),
|
|
1018
|
-
( localize(
|
|
1023
|
+
( localize(1962, "Never attempt to resume working changes from the cloud."))
|
|
1019
1024
|
],
|
|
1020
1025
|
'type': 'string',
|
|
1021
1026
|
'tags': ['usesOnlineServices'],
|
|
1022
1027
|
'default': 'onReload',
|
|
1023
1028
|
'markdownDescription': ( localize(
|
|
1024
|
-
|
|
1029
|
+
1963,
|
|
1025
1030
|
"Controls whether to automatically resume available working changes stored in the cloud for the current workspace."
|
|
1026
1031
|
)),
|
|
1027
1032
|
},
|
|
@@ -1029,11 +1034,11 @@ workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, Lifecy
|
|
|
1029
1034
|
enum: ['prompt', 'off'],
|
|
1030
1035
|
enumDescriptions: [
|
|
1031
1036
|
( localize(
|
|
1032
|
-
|
|
1037
|
+
1964,
|
|
1033
1038
|
'Prompt the user to sign in to store working changes in the cloud with Continue Working On.'
|
|
1034
1039
|
)),
|
|
1035
1040
|
( localize(
|
|
1036
|
-
|
|
1041
|
+
1965,
|
|
1037
1042
|
'Do not store working changes in the cloud with Continue Working On unless the user has already turned on Cloud Changes.'
|
|
1038
1043
|
))
|
|
1039
1044
|
],
|
|
@@ -1041,7 +1046,7 @@ workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, Lifecy
|
|
|
1041
1046
|
tags: ['usesOnlineServices'],
|
|
1042
1047
|
default: 'prompt',
|
|
1043
1048
|
markdownDescription: ( localize(
|
|
1044
|
-
|
|
1049
|
+
1966,
|
|
1045
1050
|
'Controls whether to prompt the user to store working changes in the cloud when using Continue Working On.'
|
|
1046
1051
|
))
|
|
1047
1052
|
},
|
|
@@ -1050,7 +1055,7 @@ workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, Lifecy
|
|
|
1050
1055
|
'tags': ['experimental', 'usesOnlineServices'],
|
|
1051
1056
|
'default': false,
|
|
1052
1057
|
'markdownDescription': ( localize(
|
|
1053
|
-
|
|
1058
|
+
1967,
|
|
1054
1059
|
"Controls whether to surface cloud changes which partially match the current session."
|
|
1055
1060
|
))
|
|
1056
1061
|
}
|
|
@@ -230,38 +230,39 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
230
230
|
return isWeb && this.storageService.isNew(StorageScope.APPLICATION) && this.storageService.isNew(StorageScope.WORKSPACE);
|
|
231
231
|
}
|
|
232
232
|
async getAccountPreference(reason) {
|
|
233
|
-
const
|
|
233
|
+
const disposables = ( (new DisposableStore()));
|
|
234
|
+
const quickpick = disposables.add(this.quickInputService.createQuickPick({ useSeparators: true }));
|
|
234
235
|
quickpick.ok = false;
|
|
235
|
-
quickpick.placeholder = reason === 'read' ? ( localize(
|
|
236
|
+
quickpick.placeholder = reason === 'read' ? ( localize(1906, "Select an account to restore your working changes from the cloud")) : ( localize(1907, "Select an account to store your working changes in the cloud"));
|
|
236
237
|
quickpick.ignoreFocusOut = true;
|
|
237
238
|
quickpick.items = await this.createQuickpickItems();
|
|
238
239
|
return (
|
|
239
240
|
(new Promise((resolve, reject) => {
|
|
240
|
-
quickpick.onDidHide((e) => {
|
|
241
|
+
disposables.add(quickpick.onDidHide((e) => {
|
|
241
242
|
reject(( (new CancellationError())));
|
|
242
|
-
|
|
243
|
-
});
|
|
244
|
-
quickpick.onDidAccept(async (e) => {
|
|
243
|
+
disposables.dispose();
|
|
244
|
+
}));
|
|
245
|
+
disposables.add(quickpick.onDidAccept(async (e) => {
|
|
245
246
|
const selection = quickpick.selectedItems[0];
|
|
246
247
|
const session = 'provider' in selection ? { ...(await this.authenticationService.createSession(selection.provider.id, selection.provider.scopes)), providerId: selection.provider.id } : ('session' in selection ? selection.session : undefined);
|
|
247
248
|
resolve(session);
|
|
248
249
|
quickpick.hide();
|
|
249
|
-
});
|
|
250
|
+
}));
|
|
250
251
|
quickpick.show();
|
|
251
252
|
}))
|
|
252
253
|
);
|
|
253
254
|
}
|
|
254
255
|
async createQuickpickItems() {
|
|
255
256
|
const options = [];
|
|
256
|
-
options.push({ type: 'separator', label: ( localize(
|
|
257
|
+
options.push({ type: 'separator', label: ( localize(1908, "Signed In")) });
|
|
257
258
|
const sessions = await this.getAllSessions();
|
|
258
259
|
options.push(...sessions);
|
|
259
|
-
options.push({ type: 'separator', label: ( localize(
|
|
260
|
+
options.push({ type: 'separator', label: ( localize(1909, "Others")) });
|
|
260
261
|
for (const authenticationProvider of (await this.getAuthenticationProviders())) {
|
|
261
262
|
const signedInForProvider = ( (sessions.some(account => account.session.providerId === authenticationProvider.id)));
|
|
262
263
|
if (!signedInForProvider || this.authenticationService.getProvider(authenticationProvider.id).supportsMultipleAccounts) {
|
|
263
264
|
const providerName = this.authenticationService.getProvider(authenticationProvider.id).label;
|
|
264
|
-
options.push({ label: ( localize(
|
|
265
|
+
options.push({ label: ( localize(1910, "Sign in with {0}", providerName)), provider: authenticationProvider });
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
268
|
return options;
|
|
@@ -350,7 +351,7 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
350
351
|
constructor() {
|
|
351
352
|
super({
|
|
352
353
|
id,
|
|
353
|
-
title: ( localize(
|
|
354
|
+
title: ( localize(1911, 'Turn on Cloud Changes...')),
|
|
354
355
|
category: EDIT_SESSION_SYNC_CATEGORY,
|
|
355
356
|
precondition: when,
|
|
356
357
|
menu: [{
|
|
@@ -371,7 +372,7 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
371
372
|
group: '2_editSessions',
|
|
372
373
|
command: {
|
|
373
374
|
id,
|
|
374
|
-
title: ( localize(
|
|
375
|
+
title: ( localize(1912, 'Turn on Cloud Changes... (1)')),
|
|
375
376
|
},
|
|
376
377
|
when: ( (ContextKeyExpr.and(
|
|
377
378
|
(ContextKeyExpr.equals(EDIT_SESSIONS_PENDING_KEY, true)),
|
|
@@ -385,7 +386,7 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
385
386
|
constructor() {
|
|
386
387
|
super({
|
|
387
388
|
id: 'workbench.editSessions.actions.resetAuth',
|
|
388
|
-
title: ( localize(
|
|
389
|
+
title: ( localize(1913, 'Turn off Cloud Changes...')),
|
|
389
390
|
category: EDIT_SESSION_SYNC_CATEGORY,
|
|
390
391
|
precondition: ( (ContextKeyExpr.equals(EDIT_SESSIONS_SIGNED_IN_KEY, true))),
|
|
391
392
|
menu: [{
|
|
@@ -400,8 +401,8 @@ let EditSessionsWorkbenchService = class EditSessionsWorkbenchService extends Di
|
|
|
400
401
|
}
|
|
401
402
|
async run() {
|
|
402
403
|
const result = await that.dialogService.confirm({
|
|
403
|
-
message: ( localize(
|
|
404
|
-
checkbox: { label: ( localize(
|
|
404
|
+
message: ( localize(1914, 'Do you want to disable storing working changes in the cloud?')),
|
|
405
|
+
checkbox: { label: ( localize(1915, 'Delete all stored data from the cloud.')) }
|
|
405
406
|
});
|
|
406
407
|
if (result.confirmed) {
|
|
407
408
|
if (result.checkboxChecked) {
|
|
@@ -51,9 +51,9 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
51
51
|
}], container);
|
|
52
52
|
viewsRegistry.registerViewWelcomeContent(viewId, {
|
|
53
53
|
content: ( localize(
|
|
54
|
-
|
|
54
|
+
5633,
|
|
55
55
|
'You have no stored changes in the cloud to display.\n{0}',
|
|
56
|
-
`[${( localize(
|
|
56
|
+
`[${( localize(5634, 'Store Working Changes'))}](command:workbench.editSessions.actions.store)`
|
|
57
57
|
)),
|
|
58
58
|
when: ( (ContextKeyExpr.equals(EDIT_SESSIONS_COUNT_KEY, 0))),
|
|
59
59
|
order: 1
|
|
@@ -62,7 +62,7 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
62
62
|
constructor() {
|
|
63
63
|
super({
|
|
64
64
|
id: 'workbench.editSessions.actions.resume',
|
|
65
|
-
title: ( localize(
|
|
65
|
+
title: ( localize(5635, "Resume Working Changes")),
|
|
66
66
|
icon: Codicon.desktopDownload,
|
|
67
67
|
menu: {
|
|
68
68
|
id: MenuId.ViewItemContext,
|
|
@@ -85,7 +85,7 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
85
85
|
constructor() {
|
|
86
86
|
super({
|
|
87
87
|
id: 'workbench.editSessions.actions.store',
|
|
88
|
-
title: ( localize(
|
|
88
|
+
title: ( localize(5636, "Store Working Changes")),
|
|
89
89
|
icon: Codicon.cloudUpload,
|
|
90
90
|
});
|
|
91
91
|
}
|
|
@@ -99,7 +99,7 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
99
99
|
constructor() {
|
|
100
100
|
super({
|
|
101
101
|
id: 'workbench.editSessions.actions.delete',
|
|
102
|
-
title: ( localize(
|
|
102
|
+
title: ( localize(5637, "Delete Working Changes")),
|
|
103
103
|
icon: Codicon.trash,
|
|
104
104
|
menu: {
|
|
105
105
|
id: MenuId.ViewItemContext,
|
|
@@ -117,11 +117,11 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
117
117
|
const editSessionStorageService = accessor.get(IEditSessionsStorageService);
|
|
118
118
|
const result = await dialogService.confirm({
|
|
119
119
|
message: ( localize(
|
|
120
|
-
|
|
120
|
+
5638,
|
|
121
121
|
'Are you sure you want to permanently delete your working changes with ref {0}?',
|
|
122
122
|
editSessionId
|
|
123
123
|
)),
|
|
124
|
-
detail: ( localize(
|
|
124
|
+
detail: ( localize(5639, ' You cannot undo this action.')),
|
|
125
125
|
type: 'warning',
|
|
126
126
|
title: EDIT_SESSIONS_TITLE.value
|
|
127
127
|
});
|
|
@@ -135,7 +135,7 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
135
135
|
constructor() {
|
|
136
136
|
super({
|
|
137
137
|
id: 'workbench.editSessions.actions.deleteAll',
|
|
138
|
-
title: ( localize(
|
|
138
|
+
title: ( localize(5640, "Delete All Working Changes from Cloud")),
|
|
139
139
|
icon: Codicon.trash,
|
|
140
140
|
menu: {
|
|
141
141
|
id: MenuId.ViewTitle,
|
|
@@ -151,10 +151,10 @@ let EditSessionsDataViews = class EditSessionsDataViews extends Disposable {
|
|
|
151
151
|
const editSessionStorageService = accessor.get(IEditSessionsStorageService);
|
|
152
152
|
const result = await dialogService.confirm({
|
|
153
153
|
message: ( localize(
|
|
154
|
-
|
|
154
|
+
5641,
|
|
155
155
|
'Are you sure you want to permanently delete all stored changes from the cloud?'
|
|
156
156
|
)),
|
|
157
|
-
detail: ( localize(
|
|
157
|
+
detail: ( localize(5642, ' You cannot undo this action.')),
|
|
158
158
|
type: 'warning',
|
|
159
159
|
title: EDIT_SESSIONS_TITLE.value
|
|
160
160
|
});
|
|
@@ -268,11 +268,11 @@ let EditSessionDataViewDataProvider = class EditSessionDataViewDataProvider {
|
|
|
268
268
|
themeIcon: Codicon.file,
|
|
269
269
|
command: {
|
|
270
270
|
id: 'vscode.diff',
|
|
271
|
-
title: ( localize(
|
|
271
|
+
title: ( localize(5643, 'Compare Changes')),
|
|
272
272
|
arguments: [
|
|
273
273
|
localCopy,
|
|
274
274
|
cloudChangeUri,
|
|
275
|
-
`${basename(change.relativeFilePath)} (${( localize(
|
|
275
|
+
`${basename(change.relativeFilePath)} (${( localize(5644, 'Local Copy'))} \u2194 ${( localize(5645, 'Cloud Changes'))})`,
|
|
276
276
|
undefined
|
|
277
277
|
]
|
|
278
278
|
}
|
|
@@ -287,7 +287,7 @@ let EditSessionDataViewDataProvider = class EditSessionDataViewDataProvider {
|
|
|
287
287
|
themeIcon: Codicon.file,
|
|
288
288
|
command: {
|
|
289
289
|
id: API_OPEN_EDITOR_COMMAND_ID,
|
|
290
|
-
title: ( localize(
|
|
290
|
+
title: ( localize(5646, 'Open File')),
|
|
291
291
|
arguments: [cloudChangeUri, undefined, undefined]
|
|
292
292
|
}
|
|
293
293
|
};
|
|
@@ -5,7 +5,7 @@ import { RawContextKey } from 'vscode/vscode/vs/platform/contextkey/common/conte
|
|
|
5
5
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
6
6
|
import { StringSHA1 } from 'vscode/vscode/vs/base/common/hash';
|
|
7
7
|
|
|
8
|
-
const EDIT_SESSION_SYNC_CATEGORY = ( localize2(
|
|
8
|
+
const EDIT_SESSION_SYNC_CATEGORY = ( localize2(5621, 'Cloud Changes'));
|
|
9
9
|
var ChangeType;
|
|
10
10
|
( ((function(ChangeType) {
|
|
11
11
|
ChangeType[ChangeType["Addition"] = 1] = "Addition";
|
|
@@ -22,8 +22,8 @@ const EDIT_SESSIONS_PENDING_KEY = 'editSessionsPending';
|
|
|
22
22
|
const EDIT_SESSIONS_PENDING = ( (new RawContextKey(EDIT_SESSIONS_PENDING_KEY, false)));
|
|
23
23
|
const EDIT_SESSIONS_CONTAINER_ID = 'workbench.view.editSessions';
|
|
24
24
|
const EDIT_SESSIONS_DATA_VIEW_ID = 'workbench.views.editSessions.data';
|
|
25
|
-
const EDIT_SESSIONS_TITLE = ( localize2(
|
|
26
|
-
const EDIT_SESSIONS_VIEW_ICON = registerIcon('edit-sessions-view-icon', Codicon.cloudDownload, ( localize(
|
|
25
|
+
const EDIT_SESSIONS_TITLE = ( localize2(5621, 'Cloud Changes'));
|
|
26
|
+
const EDIT_SESSIONS_VIEW_ICON = registerIcon('edit-sessions-view-icon', Codicon.cloudDownload, ( localize(5622, 'View icon of the cloud changes view.')));
|
|
27
27
|
const EDIT_SESSIONS_SHOW_VIEW = ( (new RawContextKey('editSessionsShowView', false)));
|
|
28
28
|
const EDIT_SESSIONS_SCHEME = 'vscode-edit-sessions';
|
|
29
29
|
function decodeEditSessionFileContent(version, content) {
|
|
@@ -9,7 +9,7 @@ import { editSessionsLogId } from './editSessions.js';
|
|
|
9
9
|
let EditSessionsLogService = class EditSessionsLogService extends AbstractLogger {
|
|
10
10
|
constructor(loggerService, environmentService) {
|
|
11
11
|
super();
|
|
12
|
-
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${editSessionsLogId}.log`), { id: editSessionsLogId, name: ( localize(
|
|
12
|
+
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${editSessionsLogId}.log`), { id: editSessionsLogId, name: ( localize(1905, "Cloud Changes")) }));
|
|
13
13
|
}
|
|
14
14
|
trace(message, ...args) {
|
|
15
15
|
this.logger.trace(message, ...args);
|