@codingame/monaco-vscode-edit-sessions-service-override 25.1.2 → 26.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.
@@ -79,45 +79,82 @@ import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severit
79
79
 
80
80
  var EditSessionsContribution_1;
81
81
  const continueWorkingOnCommand = {
82
- id: '_workbench.editSessions.actions.continueEditSession',
83
- title: ( localize2(7182, 'Continue Working On...')),
84
- precondition: ( WorkspaceFolderCountContext.notEqualsTo('0')),
82
+ id: "_workbench.editSessions.actions.continueEditSession",
83
+ title: ( localize2(7493, "Continue Working On...")),
84
+ precondition: ( WorkspaceFolderCountContext.notEqualsTo("0")),
85
85
  f1: true
86
86
  };
87
87
  const openLocalFolderCommand = {
88
- id: '_workbench.editSessions.actions.continueEditSession.openLocalFolder',
89
- title: ( localize2(7183, 'Open In Local Folder')),
88
+ id: "_workbench.editSessions.actions.continueEditSession.openLocalFolder",
89
+ title: ( localize2(7494, "Open In Local Folder")),
90
90
  category: EDIT_SESSION_SYNC_CATEGORY,
91
91
  precondition: ( ContextKeyExpr.and(( IsWebContext.toNegated()), VirtualWorkspaceContext))
92
92
  };
93
93
  const showOutputChannelCommand = {
94
- id: 'workbench.editSessions.actions.showOutputChannel',
95
- title: ( localize2(7184, "Show Log")),
94
+ id: "workbench.editSessions.actions.showOutputChannel",
95
+ title: ( localize2(7495, "Show Log")),
96
96
  category: EDIT_SESSION_SYNC_CATEGORY
97
97
  };
98
98
  const installAdditionalContinueOnOptionsCommand = {
99
- id: 'workbench.action.continueOn.extensions',
100
- title: ( localize(7185, 'Install additional development environment options')),
99
+ id: "workbench.action.continueOn.extensions",
100
+ title: ( localize(7496, "Install additional development environment options"))
101
101
  };
102
102
  registerAction2(class extends Action2 {
103
103
  constructor() {
104
- super({ ...installAdditionalContinueOnOptionsCommand, f1: false });
104
+ super({
105
+ ...installAdditionalContinueOnOptionsCommand,
106
+ f1: false
107
+ });
105
108
  }
106
109
  async run(accessor) {
107
- return accessor.get(IExtensionsWorkbenchService).openSearch('@tag:continueOn');
110
+ return accessor.get(IExtensionsWorkbenchService).openSearch("@tag:continueOn");
108
111
  }
109
112
  });
110
- const resumeProgressOptionsTitle = `[${( localize(7186, 'Resuming working changes...'))}](command:${showOutputChannelCommand.id})`;
113
+ const resumeProgressOptionsTitle = `[${( localize(7497, "Resuming working changes..."))}](command:${showOutputChannelCommand.id})`;
111
114
  const resumeProgressOptions = {
112
115
  location: ProgressLocation.Window,
113
- type: 'syncing',
116
+ type: "syncing"
114
117
  };
115
- const queryParamName = 'editSessionId';
116
- const useEditSessionsWithContinueOn = 'workbench.editSessions.continueOn';
118
+ const queryParamName = "editSessionId";
119
+ const useEditSessionsWithContinueOn = "workbench.editSessions.continueOn";
117
120
  let EditSessionsContribution = class EditSessionsContribution extends Disposable {
118
- static { EditSessionsContribution_1 = this; }
119
- static { this.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY = 'applicationLaunchedViaContinueOn'; }
120
- constructor(editSessionsStorageService, fileService, progressService, openerService, telemetryService, scmService, notificationService, dialogService, logService, environmentService, instantiationService, productService, configurationService, contextService, editSessionIdentityService, quickInputService, commandService, contextKeyService, fileDialogService, lifecycleService, storageService, activityService, editorService, remoteAgentService, extensionService, requestService, userDataProfilesService, uriIdentityService, workspaceIdentityService) {
121
+ static {
122
+ EditSessionsContribution_1 = this;
123
+ }
124
+ static {
125
+ this.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY = "applicationLaunchedViaContinueOn";
126
+ }
127
+ constructor(
128
+ editSessionsStorageService,
129
+ fileService,
130
+ progressService,
131
+ openerService,
132
+ telemetryService,
133
+ scmService,
134
+ notificationService,
135
+ dialogService,
136
+ logService,
137
+ environmentService,
138
+ instantiationService,
139
+ productService,
140
+ configurationService,
141
+ contextService,
142
+ editSessionIdentityService,
143
+ quickInputService,
144
+ commandService,
145
+ contextKeyService,
146
+ fileDialogService,
147
+ lifecycleService,
148
+ storageService,
149
+ activityService,
150
+ editorService,
151
+ remoteAgentService,
152
+ extensionService,
153
+ requestService,
154
+ userDataProfilesService,
155
+ uriIdentityService,
156
+ workspaceIdentityService
157
+ ) {
121
158
  super();
122
159
  this.editSessionsStorageService = editSessionsStorageService;
123
160
  this.fileService = fileService;
@@ -154,10 +191,10 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
154
191
  this.shouldShowViewsContext = EDIT_SESSIONS_SHOW_VIEW.bindTo(this.contextKeyService);
155
192
  this.pendingEditSessionsContext = EDIT_SESSIONS_PENDING.bindTo(this.contextKeyService);
156
193
  this.pendingEditSessionsContext.set(false);
157
- if (!this.productService['editSessions.store']?.url) {
194
+ if (!this.productService["editSessions.store"]?.url) {
158
195
  return;
159
196
  }
160
- this.editSessionsStorageClient = ( new EditSessionsStoreClient(( URI.parse(this.productService['editSessions.store'].url)), this.productService, this.requestService, this.logService, this.environmentService, this.fileService, this.storageService));
197
+ this.editSessionsStorageClient = ( new EditSessionsStoreClient(( URI.parse(this.productService["editSessions.store"].url)), this.productService, this.requestService, this.logService, this.environmentService, this.fileService, this.storageService));
161
198
  this.editSessionsStorageService.storeClient = this.editSessionsStorageClient;
162
199
  this.workspaceStateSynchronizer = ( new WorkspaceStateSynchroniser(
163
200
  this.userDataProfilesService.defaultProfile,
@@ -177,76 +214,114 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
177
214
  this.registerActions();
178
215
  this.registerViews();
179
216
  this.registerContributedEditSessionOptions();
180
- this._register(this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, ( new EditSessionsFileSystemProvider(this.editSessionsStorageService))));
181
- this.lifecycleService.onWillShutdown((e) => {
182
- if (e.reason !== ShutdownReason.RELOAD && this.editSessionsStorageService.isSignedIn && this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) {
183
- e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: ( localize(7187, 'Storing current working changes...')) });
217
+ this._register(
218
+ this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, ( new EditSessionsFileSystemProvider(this.editSessionsStorageService)))
219
+ );
220
+ this.lifecycleService.onWillShutdown(e => {
221
+ if (e.reason !== ShutdownReason.RELOAD && this.editSessionsStorageService.isSignedIn && this.configurationService.getValue("workbench.experimental.cloudChanges.autoStore") === "onShutdown" && !isWeb) {
222
+ e.join(this.autoStoreEditSession(), {
223
+ id: "autoStoreWorkingChanges",
224
+ label: ( localize(7498, "Storing current working changes..."))
225
+ });
184
226
  }
185
227
  });
186
- this._register(this.editSessionsStorageService.onDidSignIn(() => this.updateAccountsMenuBadge()));
187
- this._register(this.editSessionsStorageService.onDidSignOut(() => this.updateAccountsMenuBadge()));
228
+ this._register(
229
+ this.editSessionsStorageService.onDidSignIn(() => this.updateAccountsMenuBadge())
230
+ );
231
+ this._register(
232
+ this.editSessionsStorageService.onDidSignOut(() => this.updateAccountsMenuBadge())
233
+ );
188
234
  }
189
235
  async autoResumeEditSession() {
190
- const shouldAutoResumeOnReload = this.configurationService.getValue('workbench.cloudChanges.autoResume') === 'onReload';
236
+ const shouldAutoResumeOnReload = this.configurationService.getValue("workbench.cloudChanges.autoResume") === "onReload";
191
237
  if (this.environmentService.editSessionId !== undefined) {
192
- this.logService.info(`Resuming cloud changes, reason: found editSessionId ${this.environmentService.editSessionId} in environment service...`);
193
- await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(this.environmentService.editSessionId, undefined, undefined, undefined, progress).finally(() => this.environmentService.editSessionId = undefined));
194
- }
195
- else if (shouldAutoResumeOnReload && this.editSessionsStorageService.isSignedIn) {
196
- this.logService.info('Resuming cloud changes, reason: cloud changes enabled...');
197
- await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
198
- }
199
- else if (shouldAutoResumeOnReload) {
200
- const hasApplicationLaunchedFromContinueOnFlow = this.storageService.getBoolean(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION, false);
201
- this.logService.info(`Prompting to enable cloud changes, has application previously launched from Continue On flow: ${hasApplicationLaunchedFromContinueOnFlow}`);
238
+ this.logService.info(
239
+ `Resuming cloud changes, reason: found editSessionId ${this.environmentService.editSessionId} in environment service...`
240
+ );
241
+ await this.progressService.withProgress(resumeProgressOptions, async progress => await this.resumeEditSession(
242
+ this.environmentService.editSessionId,
243
+ undefined,
244
+ undefined,
245
+ undefined,
246
+ progress
247
+ ).finally(() => this.environmentService.editSessionId = undefined));
248
+ } else if (shouldAutoResumeOnReload && this.editSessionsStorageService.isSignedIn) {
249
+ this.logService.info("Resuming cloud changes, reason: cloud changes enabled...");
250
+ await this.progressService.withProgress(
251
+ resumeProgressOptions,
252
+ async progress => await this.resumeEditSession(undefined, true, undefined, undefined, progress)
253
+ );
254
+ } else if (shouldAutoResumeOnReload) {
255
+ const hasApplicationLaunchedFromContinueOnFlow = this.storageService.getBoolean(
256
+ EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY,
257
+ StorageScope.APPLICATION,
258
+ false
259
+ );
260
+ this.logService.info(
261
+ `Prompting to enable cloud changes, has application previously launched from Continue On flow: ${hasApplicationLaunchedFromContinueOnFlow}`
262
+ );
202
263
  const handlePendingEditSessions = () => {
203
- this.logService.info('Showing badge to enable cloud changes in accounts menu...');
264
+ this.logService.info("Showing badge to enable cloud changes in accounts menu...");
204
265
  this.updateAccountsMenuBadge();
205
266
  this.pendingEditSessionsContext.set(true);
206
267
  const disposable = this.editSessionsStorageService.onDidSignIn(async () => {
207
268
  disposable.dispose();
208
- this.logService.info('Showing badge to enable cloud changes in accounts menu succeeded, resuming cloud changes...');
209
- await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
210
- this.storageService.remove(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION);
269
+ this.logService.info(
270
+ "Showing badge to enable cloud changes in accounts menu succeeded, resuming cloud changes..."
271
+ );
272
+ await this.progressService.withProgress(
273
+ resumeProgressOptions,
274
+ async progress => await this.resumeEditSession(undefined, true, undefined, undefined, progress)
275
+ );
276
+ this.storageService.remove(
277
+ EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY,
278
+ StorageScope.APPLICATION
279
+ );
211
280
  this.environmentService.continueOn = undefined;
212
281
  });
213
282
  };
214
- if ((this.environmentService.continueOn !== undefined) &&
215
- !this.editSessionsStorageService.isSignedIn &&
216
- hasApplicationLaunchedFromContinueOnFlow === false) {
217
- this.storageService.store(EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, true, StorageScope.APPLICATION, StorageTarget.MACHINE);
218
- this.logService.info('Prompting to enable cloud changes...');
219
- await this.editSessionsStorageService.initialize('read');
283
+ if ((this.environmentService.continueOn !== undefined) && !this.editSessionsStorageService.isSignedIn &&
284
+ hasApplicationLaunchedFromContinueOnFlow === false) {
285
+ this.storageService.store(
286
+ EditSessionsContribution_1.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY,
287
+ true,
288
+ StorageScope.APPLICATION,
289
+ StorageTarget.MACHINE
290
+ );
291
+ this.logService.info("Prompting to enable cloud changes...");
292
+ await this.editSessionsStorageService.initialize("read");
220
293
  if (this.editSessionsStorageService.isSignedIn) {
221
- this.logService.info('Prompting to enable cloud changes succeeded, resuming cloud changes...');
222
- await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
223
- }
224
- else {
294
+ this.logService.info("Prompting to enable cloud changes succeeded, resuming cloud changes...");
295
+ await this.progressService.withProgress(
296
+ resumeProgressOptions,
297
+ async progress => await this.resumeEditSession(undefined, true, undefined, undefined, progress)
298
+ );
299
+ } else {
225
300
  handlePendingEditSessions();
226
301
  }
227
- }
228
- else if (!this.editSessionsStorageService.isSignedIn &&
229
- hasApplicationLaunchedFromContinueOnFlow === true) {
302
+ } else if (!this.editSessionsStorageService.isSignedIn &&
303
+ hasApplicationLaunchedFromContinueOnFlow === true) {
230
304
  handlePendingEditSessions();
231
305
  }
232
- }
233
- else {
234
- this.logService.debug('Auto resuming cloud changes disabled.');
306
+ } else {
307
+ this.logService.debug("Auto resuming cloud changes disabled.");
235
308
  }
236
309
  }
237
310
  updateAccountsMenuBadge() {
238
311
  if (this.editSessionsStorageService.isSignedIn) {
239
312
  return this.accountsMenuBadgeDisposable.clear();
240
313
  }
241
- const badge = ( new NumberBadge(1, () => ( localize(7188, 'Check for pending cloud changes'))));
242
- this.accountsMenuBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
314
+ const badge = ( new NumberBadge(1, () => ( localize(7499, "Check for pending cloud changes"))));
315
+ this.accountsMenuBadgeDisposable.value = this.activityService.showAccountsActivity({
316
+ badge
317
+ });
243
318
  }
244
319
  async autoStoreEditSession() {
245
320
  const cancellationTokenSource = ( new CancellationTokenSource());
246
321
  await this.progressService.withProgress({
247
322
  location: ProgressLocation.Window,
248
- type: 'syncing',
249
- title: ( localize(7189, 'Storing working changes...'))
323
+ type: "syncing",
324
+ title: ( localize(7500, "Storing working changes..."))
250
325
  }, async () => this.storeEditSession(false, cancellationTokenSource.token), () => {
251
326
  cancellationTokenSource.cancel();
252
327
  cancellationTokenSource.dispose();
@@ -256,13 +331,14 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
256
331
  const container = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
257
332
  id: EDIT_SESSIONS_CONTAINER_ID,
258
333
  title: EDIT_SESSIONS_TITLE,
259
- ctorDescriptor: ( new SyncDescriptor(
260
- ViewPaneContainer,
261
- [EDIT_SESSIONS_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
262
- )),
334
+ ctorDescriptor: ( new SyncDescriptor(ViewPaneContainer, [EDIT_SESSIONS_CONTAINER_ID, {
335
+ mergeViewWithContainerWhenSingleView: true
336
+ }])),
263
337
  icon: EDIT_SESSIONS_VIEW_ICON,
264
338
  hideIfEmpty: true
265
- }, ViewContainerLocation.Sidebar, { doNotRegisterOpenCommand: true });
339
+ }, ViewContainerLocation.Sidebar, {
340
+ doNotRegisterOpenCommand: true
341
+ });
266
342
  this._register(this.instantiationService.createInstance(EditSessionsDataViews, container));
267
343
  }
268
344
  registerActions() {
@@ -289,8 +365,8 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
289
365
  this._register(registerAction2(class ShowEditSessionView extends Action2 {
290
366
  constructor() {
291
367
  super({
292
- id: 'workbench.editSessions.actions.showEditSessions',
293
- title: ( localize2(7190, 'Show Cloud Changes')),
368
+ id: "workbench.editSessions.actions.showEditSessions",
369
+ title: ( localize2(7501, "Show Cloud Changes")),
294
370
  category: EDIT_SESSION_SYNC_CATEGORY,
295
371
  f1: true
296
372
  });
@@ -313,38 +389,47 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
313
389
  if (!destination && !uri) {
314
390
  destination = await that.pickContinueEditSessionDestination();
315
391
  if (!destination) {
316
- that.telemetryService.publicLog2('continueOn.editSessions.pick.outcome', { outcome: 'noSelection' });
392
+ that.telemetryService.publicLog2("continueOn.editSessions.pick.outcome", {
393
+ outcome: "noSelection"
394
+ });
317
395
  return;
318
396
  }
319
397
  }
320
398
  const shouldStoreEditSession = await that.shouldContinueOnWithEditSession();
321
399
  let ref;
322
400
  if (shouldStoreEditSession) {
323
- that.telemetryService.publicLog2('continueOn.editSessions.store');
401
+ that.telemetryService.publicLog2("continueOn.editSessions.store");
324
402
  const cancellationTokenSource = ( new CancellationTokenSource());
325
403
  try {
326
404
  ref = await that.progressService.withProgress({
327
405
  location: ProgressLocation.Notification,
328
406
  cancellable: true,
329
- type: 'syncing',
330
- title: ( localize(7191, 'Storing your working changes...'))
407
+ type: "syncing",
408
+ title: ( localize(7502, "Storing your working changes..."))
331
409
  }, async () => {
332
410
  const ref = await that.storeEditSession(false, cancellationTokenSource.token);
333
411
  if (ref !== undefined) {
334
- that.telemetryService.publicLog2('continueOn.editSessions.store.outcome', { outcome: 'storeSucceeded', hashedId: hashedEditSessionId(ref) });
335
- }
336
- else {
337
- that.telemetryService.publicLog2('continueOn.editSessions.store.outcome', { outcome: 'storeSkipped' });
412
+ that.telemetryService.publicLog2("continueOn.editSessions.store.outcome", {
413
+ outcome: "storeSucceeded",
414
+ hashedId: hashedEditSessionId(ref)
415
+ });
416
+ } else {
417
+ that.telemetryService.publicLog2("continueOn.editSessions.store.outcome", {
418
+ outcome: "storeSkipped"
419
+ });
338
420
  }
339
421
  return ref;
340
422
  }, () => {
341
423
  cancellationTokenSource.cancel();
342
424
  cancellationTokenSource.dispose();
343
- that.telemetryService.publicLog2('continueOn.editSessions.store.outcome', { outcome: 'storeCancelledByUser' });
425
+ that.telemetryService.publicLog2("continueOn.editSessions.store.outcome", {
426
+ outcome: "storeCancelledByUser"
427
+ });
428
+ });
429
+ } catch (ex) {
430
+ that.telemetryService.publicLog2("continueOn.editSessions.store.outcome", {
431
+ outcome: "storeFailed"
344
432
  });
345
- }
346
- catch (ex) {
347
- that.telemetryService.publicLog2('continueOn.editSessions.store.outcome', { outcome: 'storeFailed' });
348
433
  throw ex;
349
434
  }
350
435
  }
@@ -352,20 +437,24 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
352
437
  if (uri === undefined) {
353
438
  return;
354
439
  }
355
- if (ref !== undefined && uri !== 'noDestinationUri') {
440
+ if (ref !== undefined && uri !== "noDestinationUri") {
356
441
  const encodedRef = encodeURIComponent(ref);
357
442
  uri = uri.with({
358
443
  query: uri.query.length > 0 ? (uri.query + `&${queryParamName}=${encodedRef}&continueOn=1`) : `${queryParamName}=${encodedRef}&continueOn=1`
359
444
  });
360
445
  that.logService.info(`Opening ${( uri.toString())}`);
361
- await that.openerService.open(uri, { openExternal: true });
362
- }
363
- else if ((!shouldStoreEditSession || ref === undefined) && uri !== 'noDestinationUri') {
446
+ await that.openerService.open(uri, {
447
+ openExternal: true
448
+ });
449
+ } else if ((!shouldStoreEditSession || ref === undefined) && uri !== "noDestinationUri") {
364
450
  that.logService.info(`Opening ${( uri.toString())}`);
365
- await that.openerService.open(uri, { openExternal: true });
366
- }
367
- else if (ref === undefined && shouldStoreEditSession) {
368
- that.logService.warn(`Failed to store working changes when invoking ${continueWorkingOnCommand.id}.`);
451
+ await that.openerService.open(uri, {
452
+ openExternal: true
453
+ });
454
+ } else if (ref === undefined && shouldStoreEditSession) {
455
+ that.logService.warn(
456
+ `Failed to store working changes when invoking ${continueWorkingOnCommand.id}.`
457
+ );
369
458
  }
370
459
  }
371
460
  }));
@@ -375,31 +464,42 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
375
464
  this._register(registerAction2(class ResumeLatestEditSessionAction extends Action2 {
376
465
  constructor() {
377
466
  super({
378
- id: 'workbench.editSessions.actions.resumeLatest',
379
- title: ( localize2(7192, 'Resume Latest Changes from Cloud')),
467
+ id: "workbench.editSessions.actions.resumeLatest",
468
+ title: ( localize2(7503, "Resume Latest Changes from Cloud")),
380
469
  category: EDIT_SESSION_SYNC_CATEGORY,
381
- f1: true,
470
+ f1: true
382
471
  });
383
472
  }
384
473
  async run(accessor, editSessionId, forceApplyUnrelatedChange) {
385
- await that.progressService.withProgress({ ...resumeProgressOptions, title: resumeProgressOptionsTitle }, async () => await that.resumeEditSession(editSessionId, undefined, forceApplyUnrelatedChange));
474
+ await that.progressService.withProgress({
475
+ ...resumeProgressOptions,
476
+ title: resumeProgressOptionsTitle
477
+ }, async () => await that.resumeEditSession(editSessionId, undefined, forceApplyUnrelatedChange));
386
478
  }
387
479
  }));
388
480
  this._register(registerAction2(class ResumeLatestEditSessionAction extends Action2 {
389
481
  constructor() {
390
482
  super({
391
- id: 'workbench.editSessions.actions.resumeFromSerializedPayload',
392
- title: ( localize2(7193, 'Resume Changes from Serialized Data')),
393
- category: 'Developer',
394
- f1: true,
483
+ id: "workbench.editSessions.actions.resumeFromSerializedPayload",
484
+ title: ( localize2(7504, "Resume Changes from Serialized Data")),
485
+ category: "Developer",
486
+ f1: true
395
487
  });
396
488
  }
397
489
  async run(accessor, editSessionId) {
398
- const data = await that.quickInputService.input({ prompt: 'Enter serialized data' });
490
+ const data = await that.quickInputService.input({
491
+ prompt: "Enter serialized data"
492
+ });
399
493
  if (data) {
400
- that.editSessionsStorageService.lastReadResources.set('editSessions', { content: data, ref: '' });
494
+ that.editSessionsStorageService.lastReadResources.set("editSessions", {
495
+ content: data,
496
+ ref: ""
497
+ });
401
498
  }
402
- await that.progressService.withProgress({ ...resumeProgressOptions, title: resumeProgressOptionsTitle }, async () => await that.resumeEditSession(editSessionId, undefined, undefined, undefined, undefined, data));
499
+ await that.progressService.withProgress({
500
+ ...resumeProgressOptions,
501
+ title: resumeProgressOptionsTitle
502
+ }, async () => await that.resumeEditSession(editSessionId, undefined, undefined, undefined, undefined, data));
403
503
  }
404
504
  }));
405
505
  }
@@ -408,19 +508,19 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
408
508
  this._register(registerAction2(class StoreLatestEditSessionAction extends Action2 {
409
509
  constructor() {
410
510
  super({
411
- id: 'workbench.editSessions.actions.storeCurrent',
412
- title: ( localize2(7194, 'Store Working Changes in Cloud')),
511
+ id: "workbench.editSessions.actions.storeCurrent",
512
+ title: ( localize2(7505, "Store Working Changes in Cloud")),
413
513
  category: EDIT_SESSION_SYNC_CATEGORY,
414
- f1: true,
514
+ f1: true
415
515
  });
416
516
  }
417
517
  async run(accessor) {
418
518
  const cancellationTokenSource = ( new CancellationTokenSource());
419
519
  await that.progressService.withProgress({
420
520
  location: ProgressLocation.Notification,
421
- title: ( localize(7195, 'Storing working changes...'))
521
+ title: ( localize(7506, "Storing working changes..."))
422
522
  }, async () => {
423
- that.telemetryService.publicLog2('editSessions.store');
523
+ that.telemetryService.publicLog2("editSessions.store");
424
524
  await that.storeEditSession(true, cancellationTokenSource.token);
425
525
  }, () => {
426
526
  cancellationTokenSource.cancel();
@@ -429,87 +529,122 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
429
529
  }
430
530
  }));
431
531
  }
432
- async resumeEditSession(ref, silent, forceApplyUnrelatedChange, applyPartialMatch, progress, serializedData) {
532
+ async resumeEditSession(
533
+ ref,
534
+ silent,
535
+ forceApplyUnrelatedChange,
536
+ applyPartialMatch,
537
+ progress,
538
+ serializedData
539
+ ) {
433
540
  await this.remoteAgentService.getEnvironment();
434
541
  if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
435
542
  return;
436
543
  }
437
- this.logService.info(ref !== undefined ? `Resuming changes from cloud with ref ${ref}...` : 'Checking for pending cloud changes...');
438
- if (silent && !(await this.editSessionsStorageService.initialize('read', true))) {
544
+ this.logService.info(
545
+ ref !== undefined ? `Resuming changes from cloud with ref ${ref}...` : "Checking for pending cloud changes..."
546
+ );
547
+ if (silent && !(await this.editSessionsStorageService.initialize("read", true))) {
439
548
  return;
440
549
  }
441
- this.telemetryService.publicLog2('editSessions.resume');
442
- performance.mark('code/willResumeEditSessionFromIdentifier');
443
- progress?.report({ message: ( localize(7196, 'Checking for pending cloud changes...')) });
444
- const data = serializedData ? { content: serializedData, ref: '' } : await this.editSessionsStorageService.read('editSessions', ref);
550
+ this.telemetryService.publicLog2("editSessions.resume");
551
+ performance.mark("code/willResumeEditSessionFromIdentifier");
552
+ progress?.report({
553
+ message: ( localize(7507, "Checking for pending cloud changes..."))
554
+ });
555
+ const data = serializedData ? {
556
+ content: serializedData,
557
+ ref: ""
558
+ } : await this.editSessionsStorageService.read("editSessions", ref);
445
559
  if (!data) {
446
560
  if (ref === undefined && !silent) {
447
- this.notificationService.info(( localize(7197, 'There are no changes to resume from the cloud.')));
448
- }
449
- else if (ref !== undefined) {
450
- this.notificationService.warn(( localize(7198, 'Could not resume changes from the cloud for ID {0}.', ref)));
561
+ this.notificationService.info(( localize(7508, "There are no changes to resume from the cloud.")));
562
+ } else if (ref !== undefined) {
563
+ this.notificationService.warn(( localize(7509, "Could not resume changes from the cloud for ID {0}.", ref)));
451
564
  }
452
- 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`);
565
+ this.logService.info(
566
+ 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`
567
+ );
453
568
  return;
454
569
  }
455
- progress?.report({ message: resumeProgressOptionsTitle });
570
+ progress?.report({
571
+ message: resumeProgressOptionsTitle
572
+ });
456
573
  const editSession = JSON.parse(data.content);
457
574
  ref = data.ref;
458
575
  if (editSession.version > EditSessionSchemaVersion) {
459
576
  this.notificationService.error(( localize(
460
- 7199,
577
+ 7510,
461
578
  "Please upgrade to a newer version of {0} to resume your working changes from the cloud.",
462
579
  this.productService.nameLong
463
580
  )));
464
- this.telemetryService.publicLog2('editSessions.resume.outcome', { hashedId: hashedEditSessionId(ref), outcome: 'clientUpdateNeeded' });
581
+ this.telemetryService.publicLog2("editSessions.resume.outcome", {
582
+ hashedId: hashedEditSessionId(ref),
583
+ outcome: "clientUpdateNeeded"
584
+ });
465
585
  return;
466
586
  }
467
587
  try {
468
- const { changes, conflictingChanges } = await this.generateChanges(editSession, ref, forceApplyUnrelatedChange, applyPartialMatch);
588
+ const {
589
+ changes,
590
+ conflictingChanges
591
+ } = await this.generateChanges(editSession, ref, forceApplyUnrelatedChange, applyPartialMatch);
469
592
  if (changes.length === 0) {
470
593
  return;
471
594
  }
472
595
  if (conflictingChanges.length > 0) {
473
- const { confirmed } = await this.dialogService.confirm({
596
+ const {
597
+ confirmed
598
+ } = await this.dialogService.confirm({
474
599
  type: Severity.Warning,
475
- message: conflictingChanges.length > 1 ?
476
- ( localize(
477
- 7200,
478
- 'Resuming your working changes from the cloud will overwrite the following {0} files. Do you want to proceed?',
600
+ message: conflictingChanges.length > 1 ? ( localize(
601
+ 7511,
602
+ "Resuming your working changes from the cloud will overwrite the following {0} files. Do you want to proceed?",
479
603
  conflictingChanges.length
480
- )) :
481
- ( localize(
482
- 7201,
483
- 'Resuming your working changes from the cloud will overwrite {0}. Do you want to proceed?',
604
+ )) : ( localize(
605
+ 7512,
606
+ "Resuming your working changes from the cloud will overwrite {0}. Do you want to proceed?",
484
607
  basename(conflictingChanges[0].uri)
485
608
  )),
486
- detail: conflictingChanges.length > 1 ? getFileNamesMessage(( conflictingChanges.map((c) => c.uri))) : undefined
609
+ detail: conflictingChanges.length > 1 ? getFileNamesMessage(( conflictingChanges.map(c => c.uri))) : undefined
487
610
  });
488
611
  if (!confirmed) {
489
612
  return;
490
613
  }
491
614
  }
492
- for (const { uri, type, contents } of changes) {
615
+ for (const {
616
+ uri,
617
+ type,
618
+ contents
619
+ } of changes) {
493
620
  if (type === ChangeType.Addition) {
494
621
  await this.fileService.writeFile(uri, decodeEditSessionFileContent(editSession.version, contents));
495
- }
496
- else if (type === ChangeType.Deletion && (await this.fileService.exists(uri))) {
622
+ } else if (type === ChangeType.Deletion && (await this.fileService.exists(uri))) {
497
623
  await this.fileService.del(uri);
498
624
  }
499
625
  }
500
626
  await this.workspaceStateSynchronizer?.apply();
501
- this.logService.info(`Deleting edit session with ref ${ref} after successfully applying it to current workspace...`);
502
- await this.editSessionsStorageService.delete('editSessions', ref);
627
+ this.logService.info(
628
+ `Deleting edit session with ref ${ref} after successfully applying it to current workspace...`
629
+ );
630
+ await this.editSessionsStorageService.delete("editSessions", ref);
503
631
  this.logService.info(`Deleted edit session with ref ${ref}.`);
504
- this.telemetryService.publicLog2('editSessions.resume.outcome', { hashedId: hashedEditSessionId(ref), outcome: 'resumeSucceeded' });
632
+ this.telemetryService.publicLog2("editSessions.resume.outcome", {
633
+ hashedId: hashedEditSessionId(ref),
634
+ outcome: "resumeSucceeded"
635
+ });
636
+ } catch (ex) {
637
+ this.logService.error("Failed to resume edit session, reason: ", ( ex.toString()));
638
+ this.notificationService.error(( localize(7513, "Failed to resume your working changes from the cloud.")));
505
639
  }
506
- catch (ex) {
507
- this.logService.error('Failed to resume edit session, reason: ', ( ex.toString()));
508
- this.notificationService.error(( localize(7202, "Failed to resume your working changes from the cloud.")));
509
- }
510
- performance.mark('code/didResumeEditSessionFromIdentifier');
640
+ performance.mark("code/didResumeEditSessionFromIdentifier");
511
641
  }
512
- async generateChanges(editSession, ref, forceApplyUnrelatedChange = false, applyPartialMatch = false) {
642
+ async generateChanges(
643
+ editSession,
644
+ ref,
645
+ forceApplyUnrelatedChange = false,
646
+ applyPartialMatch = false
647
+ ) {
513
648
  const changes = [];
514
649
  const conflictingChanges = [];
515
650
  const workspaceFolders = this.contextService.getWorkspace().folders;
@@ -519,7 +654,9 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
519
654
  if (folder.canonicalIdentity) {
520
655
  for (const f of workspaceFolders) {
521
656
  const identity = await this.editSessionIdentityService.getEditSessionIdentifier(f, cancellationTokenSource.token);
522
- this.logService.info(`Matching identity ${identity} against edit session folder identity ${folder.canonicalIdentity}...`);
657
+ this.logService.info(
658
+ `Matching identity ${identity} against edit session folder identity ${folder.canonicalIdentity}...`
659
+ );
523
660
  if (equals(identity, folder.canonicalIdentity) || forceApplyUnrelatedChange) {
524
661
  folderRoot = f;
525
662
  break;
@@ -529,66 +666,85 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
529
666
  if (match === EditSessionIdentityMatch.Complete) {
530
667
  folderRoot = f;
531
668
  break;
532
- }
533
- else if (match === EditSessionIdentityMatch.Partial &&
534
- this.configurationService.getValue('workbench.experimental.cloudChanges.partialMatches.enabled') === true) {
669
+ } else if (match === EditSessionIdentityMatch.Partial && this.configurationService.getValue("workbench.experimental.cloudChanges.partialMatches.enabled") === true) {
535
670
  if (!applyPartialMatch) {
536
671
  this.notificationService.prompt(Severity.Info, ( localize(
537
- 7203,
538
- 'You have pending working changes in the cloud for this workspace. Would you like to resume them?'
539
- )), [{ label: ( localize(7204, 'Resume')), run: () => this.resumeEditSession(ref, false, undefined, true) }]);
540
- }
541
- else {
672
+ 7514,
673
+ "You have pending working changes in the cloud for this workspace. Would you like to resume them?"
674
+ )), [{
675
+ label: ( localize(7515, "Resume")),
676
+ run: () => this.resumeEditSession(ref, false, undefined, true)
677
+ }]);
678
+ } else {
542
679
  folderRoot = f;
543
680
  break;
544
681
  }
545
682
  }
546
683
  }
547
684
  }
548
- }
549
- else {
550
- folderRoot = workspaceFolders.find((f) => f.name === folder.name);
685
+ } else {
686
+ folderRoot = workspaceFolders.find(f => f.name === folder.name);
551
687
  }
552
688
  if (!folderRoot) {
553
- this.logService.info(`Skipping applying ${folder.workingChanges.length} changes from edit session with ref ${ref} as no matching workspace folder was found.`);
554
- return { changes: [], conflictingChanges: [], contributedStateHandlers: [] };
689
+ this.logService.info(
690
+ `Skipping applying ${folder.workingChanges.length} changes from edit session with ref ${ref} as no matching workspace folder was found.`
691
+ );
692
+ return {
693
+ changes: [],
694
+ conflictingChanges: [],
695
+ contributedStateHandlers: []
696
+ };
555
697
  }
556
698
  const localChanges = ( new Set());
557
699
  for (const repository of this.scmService.repositories) {
558
- if (repository.provider.rootUri !== undefined &&
559
- this.contextService.getWorkspaceFolder(repository.provider.rootUri)?.name === folder.name) {
700
+ if (repository.provider.rootUri !== undefined && this.contextService.getWorkspaceFolder(repository.provider.rootUri)?.name === folder.name) {
560
701
  const repositoryChanges = this.getChangedResources(repository);
561
- repositoryChanges.forEach((change) => localChanges.add(( change.toString())));
702
+ repositoryChanges.forEach(change => localChanges.add(( change.toString())));
562
703
  }
563
704
  }
564
705
  for (const change of folder.workingChanges) {
565
706
  const uri = joinPath(folderRoot.uri, change.relativeFilePath);
566
- changes.push({ uri, type: change.type, contents: change.contents });
707
+ changes.push({
708
+ uri,
709
+ type: change.type,
710
+ contents: change.contents
711
+ });
567
712
  if (await this.willChangeLocalContents(localChanges, uri, change)) {
568
- conflictingChanges.push({ uri, type: change.type, contents: change.contents });
713
+ conflictingChanges.push({
714
+ uri,
715
+ type: change.type,
716
+ contents: change.contents
717
+ });
569
718
  }
570
719
  }
571
720
  }
572
- return { changes, conflictingChanges };
721
+ return {
722
+ changes,
723
+ conflictingChanges
724
+ };
573
725
  }
574
726
  async willChangeLocalContents(localChanges, uriWithIncomingChanges, incomingChange) {
575
727
  if (!( localChanges.has(( uriWithIncomingChanges.toString())))) {
576
728
  return false;
577
729
  }
578
- const { contents, type } = incomingChange;
730
+ const {
731
+ contents,
732
+ type
733
+ } = incomingChange;
579
734
  switch (type) {
580
- case (ChangeType.Addition): {
581
- const [originalContents, incomingContents] = await Promise.all([
582
- hashAsync(contents),
583
- hashAsync(encodeBase64((await this.fileService.readFile(uriWithIncomingChanges)).value))
584
- ]);
735
+ case (ChangeType.Addition):
736
+ {
737
+ const [originalContents, incomingContents] = await Promise.all([hashAsync(contents), hashAsync(
738
+ encodeBase64((await this.fileService.readFile(uriWithIncomingChanges)).value)
739
+ )]);
585
740
  return originalContents !== incomingContents;
586
741
  }
587
- case (ChangeType.Deletion): {
742
+ case (ChangeType.Deletion):
743
+ {
588
744
  return await this.fileService.exists(uriWithIncomingChanges);
589
745
  }
590
- default:
591
- throw ( new Error('Unhandled change type.'));
746
+ default:
747
+ throw ( new Error("Unhandled change type."));
592
748
  }
593
749
  }
594
750
  async storeEditSession(fromStoreCommand, cancellationToken) {
@@ -614,7 +770,9 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
614
770
  for (const repository of this.scmService.repositories) {
615
771
  const trackedUris = this.getChangedResources(repository);
616
772
  const workingChanges = [];
617
- const { rootUri } = repository.provider;
773
+ const {
774
+ rootUri
775
+ } = repository.provider;
618
776
  const workspaceFolder = rootUri ? this.contextService.getWorkspaceFolder(rootUri) : undefined;
619
777
  let name = workspaceFolder?.name;
620
778
  for (const uri of trackedUris) {
@@ -629,58 +787,80 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
629
787
  if (!(await this.fileService.stat(uri)).isFile) {
630
788
  continue;
631
789
  }
632
- }
633
- catch { }
790
+ } catch {}
634
791
  hasEdits = true;
635
792
  if (await this.fileService.exists(uri)) {
636
793
  const contents = encodeBase64((await this.fileService.readFile(uri)).value);
637
794
  editSessionSize += contents.length;
638
795
  if (editSessionSize > this.editSessionsStorageService.SIZE_LIMIT) {
639
- this.notificationService.error(( localize(7205, 'Your working changes exceed the size limit and cannot be stored.')));
796
+ this.notificationService.error(( localize(7516, "Your working changes exceed the size limit and cannot be stored.")));
640
797
  return undefined;
641
798
  }
642
- workingChanges.push({ type: ChangeType.Addition, fileType: FileType.File, contents: contents, relativeFilePath: relativeFilePath });
643
- }
644
- else {
645
- workingChanges.push({ type: ChangeType.Deletion, fileType: FileType.File, contents: undefined, relativeFilePath: relativeFilePath });
799
+ workingChanges.push({
800
+ type: ChangeType.Addition,
801
+ fileType: FileType.File,
802
+ contents: contents,
803
+ relativeFilePath: relativeFilePath
804
+ });
805
+ } else {
806
+ workingChanges.push({
807
+ type: ChangeType.Deletion,
808
+ fileType: FileType.File,
809
+ contents: undefined,
810
+ relativeFilePath: relativeFilePath
811
+ });
646
812
  }
647
813
  }
648
814
  let canonicalIdentity = undefined;
649
815
  if (workspaceFolder !== null && workspaceFolder !== undefined) {
650
816
  canonicalIdentity = await this.editSessionIdentityService.getEditSessionIdentifier(workspaceFolder, cancellationToken);
651
817
  }
652
- folders.push({ workingChanges, name: name ?? '', canonicalIdentity: canonicalIdentity ?? undefined, absoluteUri: workspaceFolder?.uri.toString() });
818
+ folders.push({
819
+ workingChanges,
820
+ name: name ?? "",
821
+ canonicalIdentity: canonicalIdentity ?? undefined,
822
+ absoluteUri: workspaceFolder?.uri.toString()
823
+ });
653
824
  }
654
825
  await this.workspaceStateSynchronizer?.sync();
655
826
  if (!hasEdits) {
656
- this.logService.info('Skipped storing working changes in the cloud as there are no edits to store.');
827
+ this.logService.info(
828
+ "Skipped storing working changes in the cloud as there are no edits to store."
829
+ );
657
830
  if (fromStoreCommand) {
658
831
  this.notificationService.info(( localize(
659
- 7206,
660
- 'Skipped storing working changes in the cloud as there are no edits to store.'
832
+ 7517,
833
+ "Skipped storing working changes in the cloud as there are no edits to store."
661
834
  )));
662
835
  }
663
836
  return undefined;
664
837
  }
665
- const data = { folders, version: 2, workspaceStateId: this.editSessionsStorageService.lastWrittenResources.get('workspaceState')?.ref };
838
+ const data = {
839
+ folders,
840
+ version: 2,
841
+ workspaceStateId: this.editSessionsStorageService.lastWrittenResources.get("workspaceState")?.ref
842
+ };
666
843
  try {
667
844
  this.logService.info(`Storing edit session...`);
668
- const ref = await this.editSessionsStorageService.write('editSessions', data);
845
+ const ref = await this.editSessionsStorageService.write("editSessions", data);
669
846
  this.logService.info(`Stored edit session with ref ${ref}.`);
670
847
  return ref;
671
- }
672
- catch (ex) {
848
+ } catch (ex) {
673
849
  this.logService.error(`Failed to store edit session, reason: `, ( ex.toString()));
674
850
  if (ex instanceof UserDataSyncStoreError) {
675
851
  switch (ex.code) {
676
- case UserDataSyncErrorCode.TooLarge:
677
- this.telemetryService.publicLog2('editSessions.upload.failed', { reason: 'TooLarge' });
678
- this.notificationService.error(( localize(7205, 'Your working changes exceed the size limit and cannot be stored.')));
679
- break;
680
- default:
681
- this.telemetryService.publicLog2('editSessions.upload.failed', { reason: 'unknown' });
682
- this.notificationService.error(( localize(7207, 'Your working changes cannot be stored.')));
683
- break;
852
+ case UserDataSyncErrorCode.TooLarge:
853
+ this.telemetryService.publicLog2("editSessions.upload.failed", {
854
+ reason: "TooLarge"
855
+ });
856
+ this.notificationService.error(( localize(7516, "Your working changes exceed the size limit and cannot be stored.")));
857
+ break;
858
+ default:
859
+ this.telemetryService.publicLog2("editSessions.upload.failed", {
860
+ reason: "unknown"
861
+ });
862
+ this.notificationService.error(( localize(7518, "Your working changes cannot be stored.")));
863
+ break;
684
864
  }
685
865
  }
686
866
  }
@@ -688,7 +868,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
688
868
  }
689
869
  getChangedResources(repository) {
690
870
  return repository.provider.groups.reduce((resources, resourceGroups) => {
691
- resourceGroups.resources.forEach((resource) => resources.add(resource.sourceUri));
871
+ resourceGroups.resources.forEach(resource => resources.add(resource.sourceUri));
692
872
  return resources;
693
873
  }, ( new Set()));
694
874
  }
@@ -704,18 +884,24 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
704
884
  if (this.editSessionsStorageService.isSignedIn) {
705
885
  return this.hasEditSession();
706
886
  }
707
- if (this.configurationService.getValue(useEditSessionsWithContinueOn) === 'off') {
708
- this.telemetryService.publicLog2('continueOn.editSessions.canStore.outcome', { outcome: 'disabledEditSessionsViaSetting' });
887
+ if (this.configurationService.getValue(useEditSessionsWithContinueOn) === "off") {
888
+ this.telemetryService.publicLog2("continueOn.editSessions.canStore.outcome", {
889
+ outcome: "disabledEditSessionsViaSetting"
890
+ });
709
891
  return false;
710
892
  }
711
893
  if (this.hasEditSession()) {
712
894
  const disposables = ( new DisposableStore());
713
895
  const quickpick = disposables.add(this.quickInputService.createQuickPick());
714
- quickpick.placeholder = ( localize(7208, "Select whether to bring your working changes with you"));
896
+ quickpick.placeholder = ( localize(7519, "Select whether to bring your working changes with you"));
715
897
  quickpick.ok = false;
716
898
  quickpick.ignoreFocusOut = true;
717
- const withCloudChanges = { label: ( localize(7209, "Yes, continue with my working changes")) };
718
- const withoutCloudChanges = { label: ( localize(7210, "No, continue without my working changes")) };
899
+ const withCloudChanges = {
900
+ label: ( localize(7520, "Yes, continue with my working changes"))
901
+ };
902
+ const withoutCloudChanges = {
903
+ label: ( localize(7521, "No, continue without my working changes"))
904
+ };
719
905
  quickpick.items = [withCloudChanges, withoutCloudChanges];
720
906
  const continueWithCloudChanges = await ( new Promise((resolve, reject) => {
721
907
  disposables.add(quickpick.onDidAccept(() => {
@@ -729,12 +915,16 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
729
915
  quickpick.show();
730
916
  }));
731
917
  if (!continueWithCloudChanges) {
732
- this.telemetryService.publicLog2('continueOn.editSessions.canStore.outcome', { outcome: 'didNotEnableEditSessionsWhenPrompted' });
918
+ this.telemetryService.publicLog2("continueOn.editSessions.canStore.outcome", {
919
+ outcome: "didNotEnableEditSessionsWhenPrompted"
920
+ });
733
921
  return continueWithCloudChanges;
734
922
  }
735
- const initialized = await this.editSessionsStorageService.initialize('write');
923
+ const initialized = await this.editSessionsStorageService.initialize("write");
736
924
  if (!initialized) {
737
- this.telemetryService.publicLog2('continueOn.editSessions.canStore.outcome', { outcome: 'didNotEnableEditSessionsWhenPrompted' });
925
+ this.telemetryService.publicLog2("continueOn.editSessions.canStore.outcome", {
926
+ outcome: "didNotEnableEditSessionsWhenPrompted"
927
+ });
738
928
  }
739
929
  return initialized;
740
930
  }
@@ -744,7 +934,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
744
934
  continueEditSessionExtPoint.setHandler(extensions => {
745
935
  const continueEditSessionOptions = [];
746
936
  for (const extension of extensions) {
747
- if (!isProposedApiEnabled(extension.description, 'contribEditSessions')) {
937
+ if (!isProposedApiEnabled(extension.description, "contribEditSessions")) {
748
938
  continue;
749
939
  }
750
940
  if (!Array.isArray(extension.value)) {
@@ -756,7 +946,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
756
946
  return;
757
947
  }
758
948
  const icon = command.icon;
759
- const title = typeof command.title === 'string' ? command.title : command.title.value;
949
+ const title = typeof command.title === "string" ? command.title : command.title.value;
760
950
  const when = ContextKeyExpr.deserialize(contribution.when);
761
951
  continueEditSessionOptions.push(( new ContinueEditSessionItem(
762
952
  ThemeIcon.isThemeIcon(icon) ? `$(${icon.id}) ${title}` : title,
@@ -766,7 +956,13 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
766
956
  contribution.documentation
767
957
  )));
768
958
  if (contribution.qualifiedName) {
769
- this.generateStandaloneOptionCommand(command.id, contribution.qualifiedName, contribution.category ?? command.category, when, contribution.remoteGroup);
959
+ this.generateStandaloneOptionCommand(
960
+ command.id,
961
+ contribution.qualifiedName,
962
+ contribution.category ?? command.category,
963
+ when,
964
+ contribution.remoteGroup
965
+ );
770
966
  }
771
967
  }
772
968
  }
@@ -776,8 +972,14 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
776
972
  generateStandaloneOptionCommand(commandId, qualifiedName, category, when, remoteGroup) {
777
973
  const command = {
778
974
  id: `${continueWorkingOnCommand.id}.${commandId}`,
779
- title: { original: qualifiedName, value: qualifiedName },
780
- category: typeof category === 'string' ? { original: category, value: category } : category,
975
+ title: {
976
+ original: qualifiedName,
977
+ value: qualifiedName
978
+ },
979
+ category: typeof category === "string" ? {
980
+ original: category,
981
+ value: category
982
+ } : category,
781
983
  precondition: when,
782
984
  f1: true
783
985
  };
@@ -808,7 +1010,7 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
808
1010
  }
809
1011
  async run(accessor) {
810
1012
  const selection = await that.fileDialogService.showOpenDialog({
811
- title: ( localize(7211, 'Select a local folder to continue working in')),
1013
+ title: ( localize(7522, "Select a local folder to continue working in")),
812
1014
  canSelectFolders: true,
813
1015
  canSelectMany: false,
814
1016
  canSelectFiles: false,
@@ -822,17 +1024,17 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
822
1024
  }
823
1025
  }));
824
1026
  if (getVirtualWorkspaceLocation(this.contextService.getWorkspace()) !== undefined && isNative) {
825
- this.generateStandaloneOptionCommand(openLocalFolderCommand.id, ( localize(7212, 'Continue Working in Existing Local Folder')), undefined, openLocalFolderCommand.precondition, undefined);
1027
+ this.generateStandaloneOptionCommand(openLocalFolderCommand.id, ( localize(7523, "Continue Working in Existing Local Folder")), undefined, openLocalFolderCommand.precondition, undefined);
826
1028
  }
827
1029
  }
828
1030
  async pickContinueEditSessionDestination() {
829
1031
  const disposables = ( new DisposableStore());
830
- const quickPick = disposables.add(this.quickInputService.createQuickPick({ useSeparators: true }));
831
- const workspaceContext = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER
832
- ? this.contextService.getWorkspace().folders[0].name
833
- : ( this.contextService.getWorkspace().folders.map((folder) => folder.name)).join(', ');
1032
+ const quickPick = disposables.add(this.quickInputService.createQuickPick({
1033
+ useSeparators: true
1034
+ }));
1035
+ const workspaceContext = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER ? this.contextService.getWorkspace().folders[0].name : ( this.contextService.getWorkspace().folders.map(folder => folder.name)).join(", ");
834
1036
  quickPick.placeholder = ( localize(
835
- 7213,
1037
+ 7524,
836
1038
  "Select a development environment to continue working on {0} in",
837
1039
  `'${workspaceContext}'`
838
1040
  ));
@@ -845,22 +1047,23 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
845
1047
  disposables.dispose();
846
1048
  resolve(undefined);
847
1049
  }));
848
- disposables.add(quickPick.onDidAccept((e) => {
1050
+ disposables.add(quickPick.onDidAccept(e => {
849
1051
  const selection = quickPick.activeItems[0].command;
850
1052
  if (selection === installAdditionalContinueOnOptionsCommand.id) {
851
1053
  void this.commandService.executeCommand(installAdditionalContinueOnOptionsCommand.id);
852
- }
853
- else {
1054
+ } else {
854
1055
  resolve(selection);
855
1056
  quickPick.hide();
856
1057
  }
857
1058
  }));
858
1059
  quickPick.show();
859
- disposables.add(quickPick.onDidTriggerItemButton(async (e) => {
1060
+ disposables.add(quickPick.onDidTriggerItemButton(async e => {
860
1061
  if (e.item.documentation !== undefined) {
861
1062
  const uri = URI.isUri(e.item.documentation) ? ( URI.parse(e.item.documentation)) : await this.commandService.executeCommand(e.item.documentation);
862
1063
  if (uri) {
863
- void this.openerService.open(uri, { openExternal: true });
1064
+ void this.openerService.open(uri, {
1065
+ openExternal: true
1066
+ });
864
1067
  }
865
1068
  }
866
1069
  }));
@@ -872,69 +1075,56 @@ let EditSessionsContribution = class EditSessionsContribution extends Disposable
872
1075
  try {
873
1076
  const uri = await this.commandService.executeCommand(command);
874
1077
  if (uri === undefined) {
875
- this.telemetryService.publicLog2('continueOn.openDestination.outcome', { selection: command, outcome: 'noDestinationUri' });
876
- return 'noDestinationUri';
1078
+ this.telemetryService.publicLog2("continueOn.openDestination.outcome", {
1079
+ selection: command,
1080
+ outcome: "noDestinationUri"
1081
+ });
1082
+ return "noDestinationUri";
877
1083
  }
878
1084
  if (URI.isUri(uri)) {
879
- this.telemetryService.publicLog2('continueOn.openDestination.outcome', { selection: command, outcome: 'resolvedUri' });
1085
+ this.telemetryService.publicLog2("continueOn.openDestination.outcome", {
1086
+ selection: command,
1087
+ outcome: "resolvedUri"
1088
+ });
880
1089
  return uri;
881
1090
  }
882
- this.telemetryService.publicLog2('continueOn.openDestination.outcome', { selection: command, outcome: 'invalidDestination' });
1091
+ this.telemetryService.publicLog2("continueOn.openDestination.outcome", {
1092
+ selection: command,
1093
+ outcome: "invalidDestination"
1094
+ });
883
1095
  return undefined;
884
- }
885
- catch (ex) {
1096
+ } catch (ex) {
886
1097
  if (ex instanceof CancellationError) {
887
- this.telemetryService.publicLog2('continueOn.openDestination.outcome', { selection: command, outcome: 'cancelled' });
888
- }
889
- else {
890
- this.telemetryService.publicLog2('continueOn.openDestination.outcome', { selection: command, outcome: 'unknownError' });
1098
+ this.telemetryService.publicLog2("continueOn.openDestination.outcome", {
1099
+ selection: command,
1100
+ outcome: "cancelled"
1101
+ });
1102
+ } else {
1103
+ this.telemetryService.publicLog2("continueOn.openDestination.outcome", {
1104
+ selection: command,
1105
+ outcome: "unknownError"
1106
+ });
891
1107
  }
892
1108
  return undefined;
893
1109
  }
894
1110
  }
895
1111
  createPickItems() {
896
- const items = [...this.continueEditSessionOptions].filter((option) => option.when === undefined || this.contextKeyService.contextMatchesRules(option.when));
1112
+ const items = [...this.continueEditSessionOptions].filter(
1113
+ option => option.when === undefined || this.contextKeyService.contextMatchesRules(option.when)
1114
+ );
897
1115
  if (getVirtualWorkspaceLocation(this.contextService.getWorkspace()) !== undefined && isNative) {
898
- items.push(( new ContinueEditSessionItem('$(folder) ' + ( localize(7214, 'Open in Local Folder')), openLocalFolderCommand.id, ( localize(7215, 'Built-in')))));
1116
+ items.push(( new ContinueEditSessionItem("$(folder) " + ( localize(7525, "Open in Local Folder")), openLocalFolderCommand.id, ( localize(7526, "Built-in")))));
899
1117
  }
900
1118
  const sortedItems = items.sort((item1, item2) => item1.label.localeCompare(item2.label));
901
- return sortedItems.concat({ type: 'separator' }, ( new ContinueEditSessionItem(
1119
+ return sortedItems.concat({
1120
+ type: "separator"
1121
+ }, ( new ContinueEditSessionItem(
902
1122
  installAdditionalContinueOnOptionsCommand.title,
903
1123
  installAdditionalContinueOnOptionsCommand.id
904
1124
  )));
905
1125
  }
906
1126
  };
907
- EditSessionsContribution = EditSessionsContribution_1 = ( __decorate([
908
- ( __param(0, IEditSessionsStorageService)),
909
- ( __param(1, IFileService)),
910
- ( __param(2, IProgressService)),
911
- ( __param(3, IOpenerService)),
912
- ( __param(4, ITelemetryService)),
913
- ( __param(5, ISCMService)),
914
- ( __param(6, INotificationService)),
915
- ( __param(7, IDialogService)),
916
- ( __param(8, IEditSessionsLogService)),
917
- ( __param(9, IEnvironmentService)),
918
- ( __param(10, IInstantiationService)),
919
- ( __param(11, IProductService)),
920
- ( __param(12, IConfigurationService)),
921
- ( __param(13, IWorkspaceContextService)),
922
- ( __param(14, IEditSessionIdentityService)),
923
- ( __param(15, IQuickInputService)),
924
- ( __param(16, ICommandService)),
925
- ( __param(17, IContextKeyService)),
926
- ( __param(18, IFileDialogService)),
927
- ( __param(19, ILifecycleService)),
928
- ( __param(20, IStorageService)),
929
- ( __param(21, IActivityService)),
930
- ( __param(22, IEditorService)),
931
- ( __param(23, IRemoteAgentService)),
932
- ( __param(24, IExtensionService)),
933
- ( __param(25, IRequestService)),
934
- ( __param(26, IUserDataProfilesService)),
935
- ( __param(27, IUriIdentityService)),
936
- ( __param(28, IWorkspaceIdentityService))
937
- ], EditSessionsContribution));
1127
+ EditSessionsContribution = EditSessionsContribution_1 = ( __decorate([( __param(0, IEditSessionsStorageService)), ( __param(1, IFileService)), ( __param(2, IProgressService)), ( __param(3, IOpenerService)), ( __param(4, ITelemetryService)), ( __param(5, ISCMService)), ( __param(6, INotificationService)), ( __param(7, IDialogService)), ( __param(8, IEditSessionsLogService)), ( __param(9, IEnvironmentService)), ( __param(10, IInstantiationService)), ( __param(11, IProductService)), ( __param(12, IConfigurationService)), ( __param(13, IWorkspaceContextService)), ( __param(14, IEditSessionIdentityService)), ( __param(15, IQuickInputService)), ( __param(16, ICommandService)), ( __param(17, IContextKeyService)), ( __param(18, IFileDialogService)), ( __param(19, ILifecycleService)), ( __param(20, IStorageService)), ( __param(21, IActivityService)), ( __param(22, IEditorService)), ( __param(23, IRemoteAgentService)), ( __param(24, IExtensionService)), ( __param(25, IRequestService)), ( __param(26, IUserDataProfilesService)), ( __param(27, IUriIdentityService)), ( __param(28, IWorkspaceIdentityService))], EditSessionsContribution));
938
1128
  const infoButtonClass = ThemeIcon.asClassName(Codicon.info);
939
1129
  class ContinueEditSessionItem {
940
1130
  constructor(label, command, description, when, documentation) {
@@ -945,58 +1135,58 @@ class ContinueEditSessionItem {
945
1135
  this.documentation = documentation;
946
1136
  if (documentation !== undefined) {
947
1137
  this.buttons = [{
948
- iconClass: infoButtonClass,
949
- tooltip: ( localize(7216, 'Learn More')),
950
- }];
1138
+ iconClass: infoButtonClass,
1139
+ tooltip: ( localize(7527, "Learn More"))
1140
+ }];
951
1141
  }
952
1142
  }
953
1143
  }
954
1144
  const continueEditSessionExtPoint = ExtensionsRegistry.registerExtensionPoint({
955
- extensionPoint: 'continueEditSession',
1145
+ extensionPoint: "continueEditSession",
956
1146
  jsonSchema: {
957
1147
  description: ( localize(
958
- 7217,
959
- 'Contributes options for continuing the current edit session in a different environment'
1148
+ 7528,
1149
+ "Contributes options for continuing the current edit session in a different environment"
960
1150
  )),
961
- type: 'array',
1151
+ type: "array",
962
1152
  items: {
963
- type: 'object',
1153
+ type: "object",
964
1154
  properties: {
965
1155
  command: {
966
1156
  description: ( localize(
967
- 7218,
968
- '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.'
1157
+ 7529,
1158
+ "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."
969
1159
  )),
970
- type: 'string'
1160
+ type: "string"
971
1161
  },
972
1162
  group: {
973
- description: ( localize(7219, 'Group into which this item belongs.')),
974
- type: 'string'
1163
+ description: ( localize(7530, "Group into which this item belongs.")),
1164
+ type: "string"
975
1165
  },
976
1166
  qualifiedName: {
977
1167
  description: ( localize(
978
- 7220,
979
- 'A fully qualified name for this item which is used for display in menus.'
1168
+ 7531,
1169
+ "A fully qualified name for this item which is used for display in menus."
980
1170
  )),
981
- type: 'string'
1171
+ type: "string"
982
1172
  },
983
1173
  description: {
984
1174
  description: ( localize(
985
- 7221,
1175
+ 7532,
986
1176
  "The url, or a command that returns the url, to the option's documentation page."
987
1177
  )),
988
- type: 'string'
1178
+ type: "string"
989
1179
  },
990
1180
  remoteGroup: {
991
- description: ( localize(7222, 'Group into which this item belongs in the remote indicator.')),
992
- type: 'string'
1181
+ description: ( localize(7533, "Group into which this item belongs in the remote indicator.")),
1182
+ type: "string"
993
1183
  },
994
1184
  when: {
995
- description: ( localize(7223, 'Condition which must be true to show this item.')),
996
- type: 'string'
1185
+ description: ( localize(7534, "Condition which must be true to show this item.")),
1186
+ type: "string"
997
1187
  }
998
1188
  },
999
- required: ['command']
1189
+ required: ["command"]
1000
1190
  }
1001
1191
  }
1002
1192
  });
@@ -1004,67 +1194,58 @@ const workbenchRegistry = ( Registry.as(Extensions$1.Workbench));
1004
1194
  workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, LifecyclePhase.Restored);
1005
1195
  ( Registry.as(Extensions$2.Configuration)).registerConfiguration({
1006
1196
  ...workbenchConfigurationNodeBase,
1007
- 'properties': {
1008
- 'workbench.experimental.cloudChanges.autoStore': {
1009
- enum: ['onShutdown', 'off'],
1010
- enumDescriptions: [
1011
- ( localize(
1012
- 7224,
1197
+ "properties": {
1198
+ "workbench.experimental.cloudChanges.autoStore": {
1199
+ enum: ["onShutdown", "off"],
1200
+ enumDescriptions: [( localize(
1201
+ 7535,
1013
1202
  "Automatically store current working changes in the cloud on window close."
1014
- )),
1015
- ( localize(7225, "Never attempt to automatically store working changes in the cloud."))
1016
- ],
1017
- 'type': 'string',
1018
- 'tags': ['experimental', 'usesOnlineServices'],
1019
- 'default': 'off',
1020
- 'markdownDescription': ( localize(
1021
- 7226,
1203
+ )), ( localize(7536, "Never attempt to automatically store working changes in the cloud."))],
1204
+ "type": "string",
1205
+ "tags": ["experimental", "usesOnlineServices"],
1206
+ "default": "off",
1207
+ "markdownDescription": ( localize(
1208
+ 7537,
1022
1209
  "Controls whether to automatically store available working changes in the cloud for the current workspace. This setting has no effect in the web."
1023
- )),
1210
+ ))
1024
1211
  },
1025
- 'workbench.cloudChanges.autoResume': {
1026
- enum: ['onReload', 'off'],
1027
- enumDescriptions: [
1028
- ( localize(
1029
- 7227,
1212
+ "workbench.cloudChanges.autoResume": {
1213
+ enum: ["onReload", "off"],
1214
+ enumDescriptions: [( localize(
1215
+ 7538,
1030
1216
  "Automatically resume available working changes from the cloud on window reload."
1031
- )),
1032
- ( localize(7228, "Never attempt to resume working changes from the cloud."))
1033
- ],
1034
- 'type': 'string',
1035
- 'tags': ['usesOnlineServices'],
1036
- 'default': 'onReload',
1037
- 'markdownDescription': ( localize(
1038
- 7229,
1217
+ )), ( localize(7539, "Never attempt to resume working changes from the cloud."))],
1218
+ "type": "string",
1219
+ "tags": ["usesOnlineServices"],
1220
+ "default": "onReload",
1221
+ "markdownDescription": ( localize(
1222
+ 7540,
1039
1223
  "Controls whether to automatically resume available working changes stored in the cloud for the current workspace."
1040
- )),
1041
- },
1042
- 'workbench.cloudChanges.continueOn': {
1043
- enum: ['prompt', 'off'],
1044
- enumDescriptions: [
1045
- ( localize(
1046
- 7230,
1047
- 'Prompt the user to sign in to store working changes in the cloud with Continue Working On.'
1048
- )),
1049
- ( localize(
1050
- 7231,
1051
- 'Do not store working changes in the cloud with Continue Working On unless the user has already turned on Cloud Changes.'
1052
1224
  ))
1053
- ],
1054
- type: 'string',
1055
- tags: ['usesOnlineServices'],
1056
- default: 'prompt',
1225
+ },
1226
+ "workbench.cloudChanges.continueOn": {
1227
+ enum: ["prompt", "off"],
1228
+ enumDescriptions: [( localize(
1229
+ 7541,
1230
+ "Prompt the user to sign in to store working changes in the cloud with Continue Working On."
1231
+ )), ( localize(
1232
+ 7542,
1233
+ "Do not store working changes in the cloud with Continue Working On unless the user has already turned on Cloud Changes."
1234
+ ))],
1235
+ type: "string",
1236
+ tags: ["usesOnlineServices"],
1237
+ default: "prompt",
1057
1238
  markdownDescription: ( localize(
1058
- 7232,
1059
- 'Controls whether to prompt the user to store working changes in the cloud when using Continue Working On.'
1239
+ 7543,
1240
+ "Controls whether to prompt the user to store working changes in the cloud when using Continue Working On."
1060
1241
  ))
1061
1242
  },
1062
- 'workbench.experimental.cloudChanges.partialMatches.enabled': {
1063
- 'type': 'boolean',
1064
- 'tags': ['experimental', 'usesOnlineServices'],
1065
- 'default': false,
1066
- 'markdownDescription': ( localize(
1067
- 7233,
1243
+ "workbench.experimental.cloudChanges.partialMatches.enabled": {
1244
+ "type": "boolean",
1245
+ "tags": ["experimental", "usesOnlineServices"],
1246
+ "default": false,
1247
+ "markdownDescription": ( localize(
1248
+ 7544,
1068
1249
  "Controls whether to surface cloud changes which partially match the current session."
1069
1250
  ))
1070
1251
  }