@codingame/monaco-vscode-notebook-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.
Files changed (94) hide show
  1. package/index.js +2 -2
  2. package/package.json +3 -3
  3. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +112 -94
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +95 -96
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +28 -19
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +15 -9
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +22 -17
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +25 -10
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +37 -44
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +211 -115
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +16 -18
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +5 -8
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +57 -49
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +24 -11
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +78 -76
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +14 -15
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +43 -28
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +65 -34
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +19 -16
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +6 -10
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +15 -17
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +28 -16
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +211 -170
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +11 -11
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +158 -156
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +109 -105
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +28 -22
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +26 -17
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +23 -16
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +72 -40
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +233 -186
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +22 -18
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +239 -151
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +85 -86
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +25 -11
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +13 -10
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +8 -5
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +218 -196
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +258 -255
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +106 -98
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +63 -49
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +55 -64
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +21 -25
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +149 -129
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +286 -0
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +82 -0
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +452 -363
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +44 -61
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +9 -11
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +203 -207
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +148 -104
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +19 -11
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +9 -11
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +9 -6
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +34 -22
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +29 -18
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +70 -52
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +31 -19
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +78 -41
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +37 -27
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +9 -6
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +8 -7
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +214 -119
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +38 -36
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.js +24 -25
  69. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.js +2 -6
  70. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +26 -15
  71. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +35 -15
  72. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +468 -258
  73. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
  74. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +113 -0
  75. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +74 -58
  76. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +1 -1
  77. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +7 -10
  78. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.js +72 -16
  79. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +70 -51
  80. package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +195 -149
  81. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +60 -81
  82. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +7 -12
  83. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +104 -66
  84. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +115 -77
  85. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +42 -26
  86. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +19 -12
  87. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +0 -7
  88. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -198
  89. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +0 -8
  90. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +0 -333
  91. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +0 -2
  92. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -7
  93. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
  94. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -261
@@ -54,13 +54,12 @@ let BaseFileWorkingCopyManager = class BaseFileWorkingCopyManager extends Dispos
54
54
  }
55
55
  async destroy() {
56
56
  try {
57
- await Promises.settled(( this.workingCopies.map(async (workingCopy) => {
57
+ await Promises.settled(( this.workingCopies.map(async workingCopy => {
58
58
  if (workingCopy.isDirty()) {
59
59
  await this.saveWithFallback(workingCopy);
60
60
  }
61
61
  })));
62
- }
63
- catch (error) {
62
+ } catch (error) {
64
63
  this.logService.error(error);
65
64
  }
66
65
  dispose(( this.mapResourceToWorkingCopy.values()));
@@ -70,21 +69,17 @@ let BaseFileWorkingCopyManager = class BaseFileWorkingCopyManager extends Dispos
70
69
  let saveSuccess = false;
71
70
  try {
72
71
  saveSuccess = await workingCopy.save();
73
- }
74
- catch (error) {
75
- }
72
+ } catch (error) {}
76
73
  if (!saveSuccess || workingCopy.isDirty()) {
77
74
  const backup = await this.workingCopyBackupService.resolve(workingCopy);
78
75
  if (backup) {
79
- await this.fileService.writeFile(workingCopy.resource, backup.value, { unlock: true });
76
+ await this.fileService.writeFile(workingCopy.resource, backup.value, {
77
+ unlock: true
78
+ });
80
79
  }
81
80
  }
82
81
  }
83
82
  };
84
- BaseFileWorkingCopyManager = ( __decorate([
85
- ( __param(0, IFileService)),
86
- ( __param(1, ILogService)),
87
- ( __param(2, IWorkingCopyBackupService))
88
- ], BaseFileWorkingCopyManager));
83
+ BaseFileWorkingCopyManager = ( __decorate([( __param(0, IFileService)), ( __param(1, ILogService)), ( __param(2, IWorkingCopyBackupService))], BaseFileWorkingCopyManager));
89
84
 
90
85
  export { BaseFileWorkingCopyManager };
@@ -47,10 +47,39 @@ import { IProgressService } from '@codingame/monaco-vscode-api/vscode/vs/platfor
47
47
 
48
48
  var FileWorkingCopyManager_1;
49
49
  let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
50
- static { FileWorkingCopyManager_1 = this; }
51
- static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localize(14623, "File Created"))); }
52
- static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localize(14624, "File Replaced"))); }
53
- constructor(workingCopyTypeId, storedWorkingCopyModelFactory, untitledWorkingCopyModelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, fileDialogService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, pathService, environmentService, dialogService, decorationsService, progressService) {
50
+ static {
51
+ FileWorkingCopyManager_1 = this;
52
+ }
53
+ static {
54
+ this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource("fileWorkingCopyCreate.source", ( localize(15020, "File Created")));
55
+ }
56
+ static {
57
+ this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource("fileWorkingCopyReplace.source", ( localize(15021, "File Replaced")));
58
+ }
59
+ constructor(
60
+ workingCopyTypeId,
61
+ storedWorkingCopyModelFactory,
62
+ untitledWorkingCopyModelFactory,
63
+ fileService,
64
+ lifecycleService,
65
+ labelService,
66
+ logService,
67
+ workingCopyFileService,
68
+ workingCopyBackupService,
69
+ uriIdentityService,
70
+ fileDialogService,
71
+ filesConfigurationService,
72
+ workingCopyService,
73
+ notificationService,
74
+ workingCopyEditorService,
75
+ editorService,
76
+ elevatedFileService,
77
+ pathService,
78
+ environmentService,
79
+ dialogService,
80
+ decorationsService,
81
+ progressService
82
+ ) {
54
83
  super();
55
84
  this.workingCopyTypeId = workingCopyTypeId;
56
85
  this.storedWorkingCopyModelFactory = storedWorkingCopyModelFactory;
@@ -104,7 +133,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
104
133
  constructor(stored) {
105
134
  super();
106
135
  this.stored = stored;
107
- this.label = ( localize(14625, "File Working Copy Decorations"));
136
+ this.label = ( localize(15022, "File Working Copy Decorations"));
108
137
  this._onDidChange = this._register(( new Emitter()));
109
138
  this.onDidChange = this._onDidChange.event;
110
139
  this.registerListeners();
@@ -115,9 +144,15 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
115
144
  this._onDidChange.fire([workingCopy.resource]);
116
145
  }
117
146
  }));
118
- this._register(this.stored.onDidRemove(workingCopyUri => this._onDidChange.fire([workingCopyUri])));
119
- this._register(this.stored.onDidChangeReadonly(workingCopy => this._onDidChange.fire([workingCopy.resource])));
120
- this._register(this.stored.onDidChangeOrphaned(workingCopy => this._onDidChange.fire([workingCopy.resource])));
147
+ this._register(
148
+ this.stored.onDidRemove(workingCopyUri => this._onDidChange.fire([workingCopyUri]))
149
+ );
150
+ this._register(
151
+ this.stored.onDidChangeReadonly(workingCopy => this._onDidChange.fire([workingCopy.resource]))
152
+ );
153
+ this._register(
154
+ this.stored.onDidChangeOrphaned(workingCopy => this._onDidChange.fire([workingCopy.resource]))
155
+ );
121
156
  }
122
157
  provideDecorations(uri) {
123
158
  const workingCopy = this.stored.get(uri);
@@ -131,20 +166,20 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
131
166
  color: listErrorForeground,
132
167
  letter: Codicon.lockSmall,
133
168
  strikethrough: true,
134
- tooltip: ( localize(14626, "Deleted, Read-only")),
169
+ tooltip: ( localize(15023, "Deleted, Read-only"))
135
170
  };
136
171
  }
137
172
  else if (isReadonly) {
138
173
  return {
139
174
  letter: Codicon.lockSmall,
140
- tooltip: ( localize(14627, "Read-only")),
175
+ tooltip: ( localize(15024, "Read-only"))
141
176
  };
142
177
  }
143
178
  else if (isOrphaned) {
144
179
  return {
145
180
  color: listErrorForeground,
146
181
  strikethrough: true,
147
- tooltip: ( localize(14628, "Deleted")),
182
+ tooltip: ( localize(15025, "Deleted"))
148
183
  };
149
184
  }
150
185
  return undefined;
@@ -161,7 +196,9 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
161
196
  resolve(arg1, arg2) {
162
197
  if (URI.isUri(arg1)) {
163
198
  if (arg1.scheme === Schemas.untitled) {
164
- return this.untitled.resolve({ untitledResource: arg1 });
199
+ return this.untitled.resolve({
200
+ untitledResource: arg1
201
+ });
165
202
  }
166
203
  else {
167
204
  return this.stored.resolve(arg1, arg2);
@@ -174,9 +211,11 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
174
211
  const workingCopy = this.get(source);
175
212
  if (workingCopy instanceof UntitledFileWorkingCopy && workingCopy.hasAssociatedFilePath) {
176
213
  target = await this.suggestSavePath(source);
177
- }
178
- else {
179
- target = await this.fileDialogService.pickFileToSave(await this.suggestSavePath(options?.suggestedTarget ?? source), options?.availableFileSystems);
214
+ } else {
215
+ target = await this.fileDialogService.pickFileToSave(
216
+ await this.suggestSavePath(options?.suggestedTarget ?? source),
217
+ options?.availableFileSystems
218
+ );
180
219
  }
181
220
  }
182
221
  if (!target) {
@@ -186,16 +225,23 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
186
225
  const confirmed = await this.confirmMakeWriteable(target);
187
226
  if (!confirmed) {
188
227
  return;
189
- }
190
- else {
228
+ } else {
191
229
  this.filesConfigurationService.updateReadonly(target, false);
192
230
  }
193
231
  }
194
232
  if (this.fileService.hasProvider(source) && isEqual(source, target)) {
195
- return this.doSave(source, { ...options, force: true });
233
+ return this.doSave(source, {
234
+ ...options,
235
+ force: true
236
+ });
196
237
  }
197
238
  if (this.fileService.hasProvider(source) && this.uriIdentityService.extUri.isEqual(source, target) && (await this.fileService.exists(source))) {
198
- await this.workingCopyFileService.move([{ file: { source, target } }], CancellationToken.None);
239
+ await this.workingCopyFileService.move([{
240
+ file: {
241
+ source,
242
+ target
243
+ }
244
+ }], CancellationToken.None);
199
245
  return (await this.doSave(source, options)) ?? (await this.doSave(target, options));
200
246
  }
201
247
  return this.doSaveAs(source, target, options);
@@ -219,11 +265,15 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
219
265
  else {
220
266
  sourceContents = (await this.fileService.readFileStream(source)).value;
221
267
  }
222
- const { targetFileExists, targetStoredFileWorkingCopy } = await this.doResolveSaveTarget(source, target);
223
- if (sourceWorkingCopy instanceof UntitledFileWorkingCopy &&
224
- sourceWorkingCopy.hasAssociatedFilePath &&
225
- targetFileExists &&
226
- this.uriIdentityService.extUri.isEqual(target, toLocalResource(sourceWorkingCopy.resource, this.environmentService.remoteAuthority, this.pathService.defaultUriScheme))) {
268
+ const {
269
+ targetFileExists,
270
+ targetStoredFileWorkingCopy
271
+ } = await this.doResolveSaveTarget(source, target);
272
+ if (sourceWorkingCopy instanceof UntitledFileWorkingCopy && sourceWorkingCopy.hasAssociatedFilePath && targetFileExists && this.uriIdentityService.extUri.isEqual(target, toLocalResource(
273
+ sourceWorkingCopy.resource,
274
+ this.environmentService.remoteAuthority,
275
+ this.pathService.defaultUriScheme
276
+ ))) {
227
277
  const overwrite = await this.confirmOverwrite(target);
228
278
  if (!overwrite) {
229
279
  return undefined;
@@ -246,8 +296,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
246
296
  }
247
297
  try {
248
298
  await sourceWorkingCopy?.revert();
249
- }
250
- catch (error) {
299
+ } catch (error) {
251
300
  this.logService.error(error);
252
301
  }
253
302
  if (source.scheme === Schemas.untitled) {
@@ -264,45 +313,53 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
264
313
  else {
265
314
  targetFileExists = await this.fileService.exists(target);
266
315
  if (!targetFileExists) {
267
- await this.workingCopyFileService.create([{ resource: target }], CancellationToken.None);
316
+ await this.workingCopyFileService.create([{
317
+ resource: target
318
+ }], CancellationToken.None);
268
319
  }
269
320
  if (this.uriIdentityService.extUri.isEqual(source, target) && this.get(source)) {
270
321
  targetStoredFileWorkingCopy = await this.stored.resolve(source);
271
- }
272
- else {
322
+ } else {
273
323
  targetStoredFileWorkingCopy = await this.stored.resolve(target);
274
324
  }
275
325
  }
276
- return { targetFileExists, targetStoredFileWorkingCopy };
326
+ return {
327
+ targetFileExists,
328
+ targetStoredFileWorkingCopy
329
+ };
277
330
  }
278
331
  async confirmOverwrite(resource) {
279
- const { confirmed } = await this.dialogService.confirm({
280
- type: 'warning',
332
+ const {
333
+ confirmed
334
+ } = await this.dialogService.confirm({
335
+ type: "warning",
281
336
  message: ( localize(
282
- 14629,
337
+ 15026,
283
338
  "'{0}' already exists. Do you want to replace it?",
284
339
  basename(resource)
285
340
  )),
286
341
  detail: ( localize(
287
- 14630,
342
+ 15027,
288
343
  "A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
289
344
  basename(resource),
290
345
  basename(dirname(resource))
291
346
  )),
292
- primaryButton: ( localize(14631, "&&Replace"))
347
+ primaryButton: ( localize(15028, "&&Replace"))
293
348
  });
294
349
  return confirmed;
295
350
  }
296
351
  async confirmMakeWriteable(resource) {
297
- const { confirmed } = await this.dialogService.confirm({
298
- type: 'warning',
352
+ const {
353
+ confirmed
354
+ } = await this.dialogService.confirm({
355
+ type: "warning",
299
356
  message: ( localize(
300
- 14632,
357
+ 15029,
301
358
  "'{0}' is marked as read-only. Do you want to save anyway?",
302
359
  basename(resource)
303
360
  )),
304
- detail: ( localize(14633, "Paths can be configured as read-only via settings.")),
305
- primaryButton: ( localize(14634, "&&Save Anyway"))
361
+ detail: ( localize(15030, "Paths can be configured as read-only via settings.")),
362
+ primaryButton: ( localize(15031, "&&Save Anyway"))
306
363
  });
307
364
  return confirmed;
308
365
  }
@@ -312,7 +369,11 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
312
369
  }
313
370
  const workingCopy = this.get(resource);
314
371
  if (workingCopy instanceof UntitledFileWorkingCopy && workingCopy.hasAssociatedFilePath) {
315
- return toLocalResource(resource, this.environmentService.remoteAuthority, this.pathService.defaultUriScheme);
372
+ return toLocalResource(
373
+ resource,
374
+ this.environmentService.remoteAuthority,
375
+ this.pathService.defaultUriScheme
376
+ );
316
377
  }
317
378
  const defaultFilePath = await this.fileDialogService.defaultFilePath();
318
379
  if (workingCopy) {
@@ -324,32 +385,9 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
324
385
  return joinPath(defaultFilePath, basename(resource));
325
386
  }
326
387
  async destroy() {
327
- await Promises.settled([
328
- this.stored.destroy(),
329
- this.untitled.destroy()
330
- ]);
388
+ await Promises.settled([this.stored.destroy(), this.untitled.destroy()]);
331
389
  }
332
390
  };
333
- FileWorkingCopyManager = FileWorkingCopyManager_1 = ( __decorate([
334
- ( __param(3, IFileService)),
335
- ( __param(4, ILifecycleService)),
336
- ( __param(5, ILabelService)),
337
- ( __param(6, ILogService)),
338
- ( __param(7, IWorkingCopyFileService)),
339
- ( __param(8, IWorkingCopyBackupService)),
340
- ( __param(9, IUriIdentityService)),
341
- ( __param(10, IFileDialogService)),
342
- ( __param(11, IFilesConfigurationService)),
343
- ( __param(12, IWorkingCopyService)),
344
- ( __param(13, INotificationService)),
345
- ( __param(14, IWorkingCopyEditorService)),
346
- ( __param(15, IEditorService)),
347
- ( __param(16, IElevatedFileService)),
348
- ( __param(17, IPathService)),
349
- ( __param(18, IWorkbenchEnvironmentService)),
350
- ( __param(19, IDialogService)),
351
- ( __param(20, IDecorationsService)),
352
- ( __param(21, IProgressService))
353
- ], FileWorkingCopyManager));
391
+ FileWorkingCopyManager = FileWorkingCopyManager_1 = ( __decorate([( __param(3, IFileService)), ( __param(4, ILifecycleService)), ( __param(5, ILabelService)), ( __param(6, ILogService)), ( __param(7, IWorkingCopyFileService)), ( __param(8, IWorkingCopyBackupService)), ( __param(9, IUriIdentityService)), ( __param(10, IFileDialogService)), ( __param(11, IFilesConfigurationService)), ( __param(12, IWorkingCopyService)), ( __param(13, INotificationService)), ( __param(14, IWorkingCopyEditorService)), ( __param(15, IEditorService)), ( __param(16, IElevatedFileService)), ( __param(17, IPathService)), ( __param(18, IWorkbenchEnvironmentService)), ( __param(19, IDialogService)), ( __param(20, IDecorationsService)), ( __param(21, IProgressService))], FileWorkingCopyManager));
354
392
 
355
393
  export { FileWorkingCopyManager };
@@ -30,7 +30,24 @@ import { SnapshotContext } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
30
30
  import { IProgressService } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service';
31
31
 
32
32
  let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends BaseFileWorkingCopyManager {
33
- constructor(workingCopyTypeId, modelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, progressService) {
33
+ constructor(
34
+ workingCopyTypeId,
35
+ modelFactory,
36
+ fileService,
37
+ lifecycleService,
38
+ labelService,
39
+ logService,
40
+ workingCopyFileService,
41
+ workingCopyBackupService,
42
+ uriIdentityService,
43
+ filesConfigurationService,
44
+ workingCopyService,
45
+ notificationService,
46
+ workingCopyEditorService,
47
+ editorService,
48
+ elevatedFileService,
49
+ progressService
50
+ ) {
34
51
  super(fileService, logService, workingCopyBackupService);
35
52
  this.workingCopyTypeId = workingCopyTypeId;
36
53
  this.modelFactory = modelFactory;
@@ -69,16 +86,32 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
69
86
  }
70
87
  registerListeners() {
71
88
  this._register(this.fileService.onDidFilesChange(e => this.onDidFilesChange(e)));
72
- this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e => this.onDidChangeFileSystemProviderCapabilities(e)));
73
- this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e => this.onDidChangeFileSystemProviderRegistrations(e)));
74
- this._register(this.workingCopyFileService.onWillRunWorkingCopyFileOperation(e => this.onWillRunWorkingCopyFileOperation(e)));
75
- this._register(this.workingCopyFileService.onDidFailWorkingCopyFileOperation(e => this.onDidFailWorkingCopyFileOperation(e)));
76
- this._register(this.workingCopyFileService.onDidRunWorkingCopyFileOperation(e => this.onDidRunWorkingCopyFileOperation(e)));
89
+ this._register(
90
+ this.fileService.onDidChangeFileSystemProviderCapabilities(e => this.onDidChangeFileSystemProviderCapabilities(e))
91
+ );
92
+ this._register(
93
+ this.fileService.onDidChangeFileSystemProviderRegistrations(e => this.onDidChangeFileSystemProviderRegistrations(e))
94
+ );
95
+ this._register(
96
+ this.workingCopyFileService.onWillRunWorkingCopyFileOperation(e => this.onWillRunWorkingCopyFileOperation(e))
97
+ );
98
+ this._register(
99
+ this.workingCopyFileService.onDidFailWorkingCopyFileOperation(e => this.onDidFailWorkingCopyFileOperation(e))
100
+ );
101
+ this._register(
102
+ this.workingCopyFileService.onDidRunWorkingCopyFileOperation(e => this.onDidRunWorkingCopyFileOperation(e))
103
+ );
77
104
  if (isWeb) {
78
- this._register(this.lifecycleService.onBeforeShutdown(event => event.veto(this.onBeforeShutdownWeb(), 'veto.fileWorkingCopyManager')));
79
- }
80
- else {
81
- this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(14652, "Saving working copies")) })));
105
+ this._register(this.lifecycleService.onBeforeShutdown(
106
+ event => event.veto(this.onBeforeShutdownWeb(), "veto.fileWorkingCopyManager")
107
+ ));
108
+ } else {
109
+ this._register(
110
+ this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), {
111
+ id: "join.fileWorkingCopyManager",
112
+ label: ( localize(15049, "Saving working copies"))
113
+ }))
114
+ );
82
115
  }
83
116
  }
84
117
  onBeforeShutdownWeb() {
@@ -91,7 +124,9 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
91
124
  }
92
125
  async onWillShutdownDesktop() {
93
126
  let pendingSavedWorkingCopies;
94
- while ((pendingSavedWorkingCopies = this.workingCopies.filter(workingCopy => workingCopy.hasState(StoredFileWorkingCopyState.PENDING_SAVE))).length > 0) {
127
+ while ((pendingSavedWorkingCopies = this.workingCopies.filter(
128
+ workingCopy => workingCopy.hasState(StoredFileWorkingCopyState.PENDING_SAVE)
129
+ )).length > 0) {
95
130
  await Promises.settled(( pendingSavedWorkingCopies.map(
96
131
  workingCopy => workingCopy.joinState(StoredFileWorkingCopyState.PENDING_SAVE)
97
132
  )));
@@ -115,10 +150,9 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
115
150
  continue;
116
151
  }
117
152
  let resolveWorkingCopy = false;
118
- if (typeof schemeOrEvent === 'string') {
153
+ if (typeof schemeOrEvent === "string") {
119
154
  resolveWorkingCopy = schemeOrEvent === workingCopy.resource.scheme;
120
- }
121
- else {
155
+ } else {
122
156
  resolveWorkingCopy = schemeOrEvent.contains(workingCopy.resource, FileChangeType.UPDATED, FileChangeType.ADDED);
123
157
  }
124
158
  if (resolveWorkingCopy) {
@@ -132,8 +166,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
132
166
  this.workingCopyResolveQueue.queueFor(workingCopy.resource, async () => {
133
167
  try {
134
168
  await this.reload(workingCopy);
135
- }
136
- catch (error) {
169
+ } catch (error) {
137
170
  this.logService.error(error);
138
171
  }
139
172
  });
@@ -143,7 +176,10 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
143
176
  if (e.operation === FileOperation.MOVE || e.operation === FileOperation.COPY) {
144
177
  e.waitUntil((async () => {
145
178
  const workingCopiesToRestore = [];
146
- for (const { source, target } of e.files) {
179
+ for (const {
180
+ source,
181
+ target
182
+ } of e.files) {
147
183
  if (source) {
148
184
  if (this.uriIdentityService.extUri.isEqual(source, target)) {
149
185
  continue;
@@ -190,32 +226,36 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
190
226
  }
191
227
  onDidRunWorkingCopyFileOperation(e) {
192
228
  switch (e.operation) {
193
- case FileOperation.CREATE:
194
- e.waitUntil((async () => {
195
- for (const { target } of e.files) {
196
- const workingCopy = this.get(target);
197
- if (workingCopy && !workingCopy.isDisposed()) {
198
- await workingCopy.revert();
199
- }
200
- }
201
- })());
202
- break;
203
- case FileOperation.MOVE:
204
- case FileOperation.COPY:
205
- e.waitUntil((async () => {
206
- const workingCopiesToRestore = this.mapCorrelationIdToWorkingCopiesToRestore.get(e.correlationId);
207
- if (workingCopiesToRestore) {
208
- this.mapCorrelationIdToWorkingCopiesToRestore.delete(e.correlationId);
209
- await Promises.settled(( workingCopiesToRestore.map(async (workingCopyToRestore) => {
210
- const target = this.uriIdentityService.asCanonicalUri(workingCopyToRestore.target);
211
- await this.resolve(target, {
212
- reload: { async: false },
213
- contents: workingCopyToRestore.snapshot
214
- });
215
- })));
229
+ case FileOperation.CREATE:
230
+ e.waitUntil((async () => {
231
+ for (const {
232
+ target
233
+ } of e.files) {
234
+ const workingCopy = this.get(target);
235
+ if (workingCopy && !workingCopy.isDisposed()) {
236
+ await workingCopy.revert();
216
237
  }
217
- })());
218
- break;
238
+ }
239
+ })());
240
+ break;
241
+ case FileOperation.MOVE:
242
+ case FileOperation.COPY:
243
+ e.waitUntil((async () => {
244
+ const workingCopiesToRestore = this.mapCorrelationIdToWorkingCopiesToRestore.get(e.correlationId);
245
+ if (workingCopiesToRestore) {
246
+ this.mapCorrelationIdToWorkingCopiesToRestore.delete(e.correlationId);
247
+ await Promises.settled(( workingCopiesToRestore.map(async workingCopyToRestore => {
248
+ const target = this.uriIdentityService.asCanonicalUri(workingCopyToRestore.target);
249
+ await this.resolve(target, {
250
+ reload: {
251
+ async: false
252
+ },
253
+ contents: workingCopyToRestore.snapshot
254
+ });
255
+ })));
256
+ }
257
+ })());
258
+ break;
219
259
  }
220
260
  }
221
261
  async reload(workingCopy) {
@@ -223,7 +263,11 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
223
263
  if (workingCopy.isDirty() || workingCopy.isDisposed() || !( this.has(workingCopy.resource))) {
224
264
  return;
225
265
  }
226
- await this.doResolve(workingCopy, { reload: { async: false } });
266
+ await this.doResolve(workingCopy, {
267
+ reload: {
268
+ async: false
269
+ }
270
+ });
227
271
  }
228
272
  async resolve(resource, options) {
229
273
  const pendingResolve = this.joinPendingResolves(resource);
@@ -238,8 +282,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
238
282
  if (URI.isUri(resourceOrWorkingCopy)) {
239
283
  resource = resourceOrWorkingCopy;
240
284
  workingCopy = this.get(resource);
241
- }
242
- else {
285
+ } else {
243
286
  resource = resourceOrWorkingCopy.resource;
244
287
  workingCopy = resourceOrWorkingCopy;
245
288
  }
@@ -260,8 +303,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
260
303
  (async () => {
261
304
  try {
262
305
  await workingCopy.resolve(resolveOptions);
263
- }
264
- catch (error) {
306
+ } catch (error) {
265
307
  if (!workingCopy.isDisposed()) {
266
308
  onUnexpectedError(error);
267
309
  }
@@ -283,7 +325,14 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
283
325
  resource,
284
326
  this.labelService.getUriBasenameLabel(resource),
285
327
  this.modelFactory,
286
- async (options) => { await this.resolve(resource, { ...options, reload: { async: false } }); },
328
+ async options => {
329
+ await this.resolve(resource, {
330
+ ...options,
331
+ reload: {
332
+ async: false
333
+ }
334
+ });
335
+ },
287
336
  this.fileService,
288
337
  this.logService,
289
338
  this.workingCopyFileService,
@@ -308,14 +357,12 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
308
357
  }
309
358
  try {
310
359
  await workingCopyResolve;
311
- }
312
- catch (error) {
360
+ } catch (error) {
313
361
  if (didCreateWorkingCopy) {
314
362
  workingCopy.dispose();
315
363
  }
316
364
  throw error;
317
- }
318
- finally {
365
+ } finally {
319
366
  this.mapResourceToPendingWorkingCopyResolve.delete(resource);
320
367
  }
321
368
  if (didCreateWorkingCopy && workingCopy.isDirty()) {
@@ -340,19 +387,26 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
340
387
  currentWorkingCopyResolve = nextPendingWorkingCopyResolve;
341
388
  try {
342
389
  await nextPendingWorkingCopyResolve;
343
- }
344
- catch (error) {
345
- }
390
+ } catch (error) {}
346
391
  }
347
392
  }
348
393
  registerWorkingCopy(workingCopy) {
349
394
  const workingCopyListeners = ( new DisposableStore());
350
395
  workingCopyListeners.add(workingCopy.onDidResolve(() => this._onDidResolve.fire(workingCopy)));
351
- workingCopyListeners.add(workingCopy.onDidChangeDirty(() => this._onDidChangeDirty.fire(workingCopy)));
352
- workingCopyListeners.add(workingCopy.onDidChangeReadonly(() => this._onDidChangeReadonly.fire(workingCopy)));
353
- workingCopyListeners.add(workingCopy.onDidChangeOrphaned(() => this._onDidChangeOrphaned.fire(workingCopy)));
396
+ workingCopyListeners.add(
397
+ workingCopy.onDidChangeDirty(() => this._onDidChangeDirty.fire(workingCopy))
398
+ );
399
+ workingCopyListeners.add(
400
+ workingCopy.onDidChangeReadonly(() => this._onDidChangeReadonly.fire(workingCopy))
401
+ );
402
+ workingCopyListeners.add(
403
+ workingCopy.onDidChangeOrphaned(() => this._onDidChangeOrphaned.fire(workingCopy))
404
+ );
354
405
  workingCopyListeners.add(workingCopy.onDidSaveError(() => this._onDidSaveError.fire(workingCopy)));
355
- workingCopyListeners.add(workingCopy.onDidSave(e => this._onDidSave.fire({ workingCopy, ...e })));
406
+ workingCopyListeners.add(workingCopy.onDidSave(e => this._onDidSave.fire({
407
+ workingCopy,
408
+ ...e
409
+ })));
356
410
  workingCopyListeners.add(workingCopy.onDidRevert(() => this._onDidRevert.fire(workingCopy)));
357
411
  this.mapResourceToWorkingCopyListeners.set(workingCopy.resource, workingCopyListeners);
358
412
  }
@@ -369,8 +423,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
369
423
  return removed;
370
424
  }
371
425
  canDispose(workingCopy) {
372
- if (workingCopy.isDisposed() ||
373
- (!( this.mapResourceToPendingWorkingCopyResolve.has(workingCopy.resource)) && !workingCopy.isDirty())) {
426
+ if (workingCopy.isDisposed() || (!( this.mapResourceToPendingWorkingCopyResolve.has(workingCopy.resource)) && !workingCopy.isDirty())) {
374
427
  return true;
375
428
  }
376
429
  return this.doCanDispose(workingCopy);
@@ -394,21 +447,6 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
394
447
  this.mapResourceToWorkingCopyListeners.clear();
395
448
  }
396
449
  };
397
- StoredFileWorkingCopyManager = ( __decorate([
398
- ( __param(2, IFileService)),
399
- ( __param(3, ILifecycleService)),
400
- ( __param(4, ILabelService)),
401
- ( __param(5, ILogService)),
402
- ( __param(6, IWorkingCopyFileService)),
403
- ( __param(7, IWorkingCopyBackupService)),
404
- ( __param(8, IUriIdentityService)),
405
- ( __param(9, IFilesConfigurationService)),
406
- ( __param(10, IWorkingCopyService)),
407
- ( __param(11, INotificationService)),
408
- ( __param(12, IWorkingCopyEditorService)),
409
- ( __param(13, IEditorService)),
410
- ( __param(14, IElevatedFileService)),
411
- ( __param(15, IProgressService))
412
- ], StoredFileWorkingCopyManager));
450
+ StoredFileWorkingCopyManager = ( __decorate([( __param(2, IFileService)), ( __param(3, ILifecycleService)), ( __param(4, ILabelService)), ( __param(5, ILogService)), ( __param(6, IWorkingCopyFileService)), ( __param(7, IWorkingCopyBackupService)), ( __param(8, IUriIdentityService)), ( __param(9, IFilesConfigurationService)), ( __param(10, IWorkingCopyService)), ( __param(11, INotificationService)), ( __param(12, IWorkingCopyEditorService)), ( __param(13, IEditorService)), ( __param(14, IElevatedFileService)), ( __param(15, IProgressService))], StoredFileWorkingCopyManager));
413
451
 
414
452
  export { StoredFileWorkingCopyManager };