@codingame/monaco-vscode-notebook-service-override 9.0.2 → 10.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 (60) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +16 -19
  3. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +62 -63
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +4 -6
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +5 -5
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +8 -9
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +35 -37
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +1 -2
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +1 -2
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +2 -2
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +16 -17
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +17 -20
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +15 -18
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +4 -6
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +1 -2
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +2 -2
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +319 -67
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +64 -61
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +2 -2
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +10 -9
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +48 -24
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +35 -37
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +45 -31
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +4 -5
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +2 -2
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +2 -2
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +124 -71
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +179 -7
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +52 -55
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +30 -32
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +28 -30
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +17 -18
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +7 -7
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +20 -22
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +126 -46
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +171 -83
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +19 -19
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +5 -6
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +4 -5
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +1 -1
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +6 -6
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +7 -8
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +3 -5
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +6 -9
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +13 -21
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +90 -39
  52. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +3 -5
  53. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +40 -31
  54. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +7 -7
  55. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +10 -11
  56. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +29 -55
  57. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +15 -17
  58. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +12 -14
  59. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +2 -4
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +0 -33
@@ -1,7 +1,6 @@
1
1
  import { parse } from 'vscode/vscode/vs/base/common/glob';
2
2
  import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
3
3
  import { joinPath } from 'vscode/vscode/vs/base/common/resources';
4
- import { RendererMessagingSpec, NotebookRendererMatch } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
5
4
 
6
5
  class DependencyList {
7
6
  constructor(value) {
@@ -35,32 +34,32 @@ class NotebookOutputRendererInfo {
35
34
  this.mimeTypeGlobs = ( this.mimeTypes.map(pattern => parse(pattern)));
36
35
  this.hardDependencies = ( new DependencyList(descriptor.dependencies ?? Iterable.empty()));
37
36
  this.optionalDependencies = ( new DependencyList(descriptor.optionalDependencies ?? Iterable.empty()));
38
- this.messaging = descriptor.requiresMessaging ?? RendererMessagingSpec.Never;
37
+ this.messaging = descriptor.requiresMessaging ?? "never" ;
39
38
  }
40
39
  matchesWithoutKernel(mimeType) {
41
40
  if (!this.matchesMimeTypeOnly(mimeType)) {
42
- return NotebookRendererMatch.Never;
41
+ return 3 ;
43
42
  }
44
43
  if (this.hardDependencies.defined) {
45
- return NotebookRendererMatch.WithHardKernelDependency;
44
+ return 0 ;
46
45
  }
47
46
  if (this.optionalDependencies.defined) {
48
- return NotebookRendererMatch.WithOptionalKernelDependency;
47
+ return 1 ;
49
48
  }
50
- return NotebookRendererMatch.Pure;
49
+ return 2 ;
51
50
  }
52
51
  matches(mimeType, kernelProvides) {
53
52
  if (!this.matchesMimeTypeOnly(mimeType)) {
54
- return NotebookRendererMatch.Never;
53
+ return 3 ;
55
54
  }
56
55
  if (this.hardDependencies.defined) {
57
56
  return this.hardDependencies.matches(kernelProvides)
58
- ? NotebookRendererMatch.WithHardKernelDependency
59
- : NotebookRendererMatch.Never;
57
+ ? 0
58
+ : 3 ;
60
59
  }
61
60
  return this.optionalDependencies.matches(kernelProvides)
62
- ? NotebookRendererMatch.WithOptionalKernelDependency
63
- : NotebookRendererMatch.Pure;
61
+ ? 1
62
+ : 2 ;
64
63
  }
65
64
  matchesMimeTypeOnly(mimeType) {
66
65
  if (this.entrypoint.extends) {
@@ -1,11 +1,11 @@
1
1
  import { LcsDiff } from 'vscode/vscode/vs/base/common/diff/diff';
2
2
  import { numberHash, doHash, hash } from 'vscode/vscode/vs/base/common/hash';
3
3
  import { URI } from 'vscode/vscode/vs/base/common/uri';
4
- import { DefaultEndOfLine, EndOfLinePreference } from 'vscode/vscode/vs/editor/common/model';
5
4
  import { PieceTreeTextBufferBuilder } from 'vscode/vscode/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder';
6
5
  import { NotebookCellsChangeType, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
7
6
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
8
7
  import { SearchParams } from 'vscode/vscode/vs/editor/common/model/textModelSearch';
8
+ import { MirrorModel } from 'vscode/vscode/vs/editor/common/services/textModelSync/textModelSync.impl';
9
9
 
10
10
  function bufferHash(buffer) {
11
11
  let initialHashVal = numberHash(104579, 0);
@@ -15,45 +15,28 @@ function bufferHash(buffer) {
15
15
  return initialHashVal;
16
16
  }
17
17
  class MirrorCell {
18
- get textBuffer() {
19
- if (this._textBuffer) {
20
- return this._textBuffer;
21
- }
22
- const builder = ( new PieceTreeTextBufferBuilder());
23
- builder.acceptChunk(Array.isArray(this._source) ? this._source.join('\n') : this._source);
24
- const bufferFactory = builder.finish(true);
25
- this._textBuffer = bufferFactory.create(DefaultEndOfLine.LF).textBuffer;
26
- return this._textBuffer;
27
- }
28
- primaryKey() {
29
- if (this._primaryKey === undefined) {
30
- this._primaryKey = hash(this.getValue());
31
- }
32
- return this._primaryKey;
18
+ get eol() {
19
+ return this._eol === '\r\n' ? 2 : 1 ;
33
20
  }
34
- constructor(handle, _source, language, cellKind, outputs, metadata, internalMetadata) {
21
+ constructor(handle, uri, source, _eol, versionId, language, cellKind, outputs, metadata, internalMetadata) {
35
22
  this.handle = handle;
36
- this._source = _source;
23
+ this._eol = _eol;
37
24
  this.language = language;
38
25
  this.cellKind = cellKind;
39
26
  this.outputs = outputs;
40
27
  this.metadata = metadata;
41
28
  this.internalMetadata = internalMetadata;
42
- this._primaryKey = null;
43
29
  this._hash = null;
30
+ this.textModel = ( new MirrorModel(uri, source, _eol, versionId));
44
31
  }
45
- getFullModelRange() {
46
- const lineCount = this.textBuffer.getLineCount();
47
- return ( new Range(1, 1, lineCount, this.textBuffer.getLineLength(lineCount) + 1));
32
+ onEvents(e) {
33
+ this.textModel.onEvents(e);
34
+ this._hash = null;
48
35
  }
49
36
  getValue() {
50
- const fullRange = this.getFullModelRange();
51
- return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.LF);
37
+ return this.textModel.getValue();
52
38
  }
53
39
  getComparisonValue() {
54
- if (this._primaryKey !== null) {
55
- return this._primaryKey;
56
- }
57
40
  this._hash = hash([hash(this.language), hash(this.getValue()), this.metadata, this.internalMetadata, ( this.outputs.map(op => ({
58
41
  outputs: ( op.outputs.map(output => ({
59
42
  mime: output.mime,
@@ -63,13 +46,6 @@ class MirrorCell {
63
46
  })))]);
64
47
  return this._hash;
65
48
  }
66
- getHashValue() {
67
- if (this._hash !== null) {
68
- return this._hash;
69
- }
70
- this._hash = hash([hash(this.getValue()), this.language, this.metadata, this.internalMetadata]);
71
- return this._hash;
72
- }
73
49
  }
74
50
  class MirrorNotebookDocument {
75
51
  constructor(uri, cells, metadata) {
@@ -105,6 +81,9 @@ class MirrorNotebookDocument {
105
81
  const cell = this.cells[e.index];
106
82
  cell.internalMetadata = e.internalMetadata;
107
83
  }
84
+ else if (e.kind === NotebookCellsChangeType.ChangeDocumentMetadata) {
85
+ this.metadata = e.metadata;
86
+ }
108
87
  });
109
88
  }
110
89
  _assertIndex(index) {
@@ -116,14 +95,7 @@ class MirrorNotebookDocument {
116
95
  splices.reverse().forEach(splice => {
117
96
  const cellDtos = splice[2];
118
97
  const newCells = ( cellDtos.map(cell => {
119
- return ( new MirrorCell(
120
- cell.handle,
121
- cell.source,
122
- cell.language,
123
- cell.cellKind,
124
- cell.outputs,
125
- cell.metadata
126
- ));
98
+ return ( new MirrorCell(cell.handle, ( URI.parse(cell.url)), cell.source, cell.eol, cell.versionId, cell.language, cell.cellKind, cell.outputs, cell.metadata));
127
99
  }));
128
100
  this.cells.splice(splice[0], splice[1], ...newCells);
129
101
  });
@@ -152,20 +124,17 @@ class NotebookEditorSimpleWorker {
152
124
  }
153
125
  dispose() {
154
126
  }
155
- $acceptNewModel(uri, data) {
156
- this._models[uri] = ( new MirrorNotebookDocument(( URI.parse(uri)), ( data.cells.map(dto => ( new MirrorCell(
157
- dto.handle,
158
- dto.source,
159
- dto.language,
160
- dto.cellKind,
161
- dto.outputs,
162
- dto.metadata
163
- )))), data.metadata));
127
+ $acceptNewModel(uri, metadata, cells) {
128
+ this._models[uri] = ( new MirrorNotebookDocument(( URI.parse(uri)), ( cells.map(dto => ( new MirrorCell(dto.handle, ( URI.parse(dto.url)), dto.source, dto.eol, dto.versionId, dto.language, dto.cellKind, dto.outputs, dto.metadata)))), metadata));
164
129
  }
165
130
  $acceptModelChanged(strURL, event) {
166
131
  const model = this._models[strURL];
167
132
  model?.acceptModelChanged(event);
168
133
  }
134
+ $acceptCellModelChanged(strURL, handle, event) {
135
+ const model = this._models[strURL];
136
+ model.cells.find(cell => cell.handle === handle)?.onEvents(event);
137
+ }
169
138
  $acceptRemovedModel(strURL) {
170
139
  if (!this._models[strURL]) {
171
140
  return;
@@ -178,6 +147,7 @@ class NotebookEditorSimpleWorker {
178
147
  const diff = ( new LcsDiff(( new CellSequence(original)), ( new CellSequence(modified))));
179
148
  const diffResult = diff.ComputeDiff(false);
180
149
  return {
150
+ metadataChanged: JSON.stringify(original.metadata) !== JSON.stringify(modified.metadata),
181
151
  cellsDiff: diffResult,
182
152
  };
183
153
  }
@@ -192,15 +162,19 @@ class NotebookEditorSimpleWorker {
192
162
  if (cell.language !== 'python') {
193
163
  continue;
194
164
  }
195
- const lineCount = cell.textBuffer.getLineCount();
196
- const maxLineCount = Math.min(lineCount, 20);
197
- const range = ( new Range(1, 1, maxLineCount, cell.textBuffer.getLineLength(maxLineCount) + 1));
198
165
  const searchParams = ( new SearchParams('import\\s*pandas|from\\s*pandas', true, false, null));
199
166
  const searchData = searchParams.parseSearchRequest();
200
167
  if (!searchData) {
201
168
  continue;
202
169
  }
203
- const cellMatches = cell.textBuffer.findMatchesLineByLine(range, searchData, true, 1);
170
+ const builder = ( new PieceTreeTextBufferBuilder());
171
+ builder.acceptChunk(cell.getValue());
172
+ const bufferFactory = builder.finish(true);
173
+ const textBuffer = bufferFactory.create(cell.eol).textBuffer;
174
+ const lineCount = textBuffer.getLineCount();
175
+ const maxLineCount = Math.min(lineCount, 20);
176
+ const range = ( new Range(1, 1, maxLineCount, textBuffer.getLineLength(maxLineCount) + 1));
177
+ const cellMatches = textBuffer.findMatchesLineByLine(range, searchData, true, 1);
204
178
  if (cellMatches.length > 0) {
205
179
  return true;
206
180
  }
@@ -12,12 +12,10 @@ import { SaveSourceRegistry } from 'vscode/vscode/vs/workbench/common/editor';
12
12
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
13
13
  import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
14
14
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
15
- import { StoredFileWorkingCopyState } from 'vscode/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
16
15
  import { StoredFileWorkingCopyManager } from './storedFileWorkingCopyManager.js';
17
16
  import { UntitledFileWorkingCopy } from './untitledFileWorkingCopy.js';
18
17
  import { UntitledFileWorkingCopyManager } from './untitledFileWorkingCopyManager.js';
19
18
  import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
20
- import { SnapshotContext } from 'vscode/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
21
19
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
22
20
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
23
21
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
@@ -47,8 +45,8 @@ import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/prog
47
45
  var FileWorkingCopyManager_1;
48
46
  let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
49
47
  static { FileWorkingCopyManager_1 = this; }
50
- static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localize(7841, "File Created"))); }
51
- static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localize(7842, "File Replaced"))); }
48
+ static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localize(7876, "File Created"))); }
49
+ static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localize(7877, "File Replaced"))); }
52
50
  constructor(workingCopyTypeId, storedWorkingCopyModelFactory, untitledWorkingCopyModelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, fileDialogService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, pathService, environmentService, dialogService, decorationsService, progressService) {
53
51
  super();
54
52
  this.workingCopyTypeId = workingCopyTypeId;
@@ -103,14 +101,14 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
103
101
  constructor(stored) {
104
102
  super();
105
103
  this.stored = stored;
106
- this.label = ( localize(7843, "File Working Copy Decorations"));
104
+ this.label = ( localize(7878, "File Working Copy Decorations"));
107
105
  this._onDidChange = this._register(( (new Emitter())));
108
106
  this.onDidChange = this._onDidChange.event;
109
107
  this.registerListeners();
110
108
  }
111
109
  registerListeners() {
112
110
  this._register(this.stored.onDidResolve(workingCopy => {
113
- if (workingCopy.isReadonly() || workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN)) {
111
+ if (workingCopy.isReadonly() || workingCopy.hasState(4 )) {
114
112
  this._onDidChange.fire([workingCopy.resource]);
115
113
  }
116
114
  }));
@@ -124,26 +122,26 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
124
122
  return undefined;
125
123
  }
126
124
  const isReadonly = workingCopy.isReadonly();
127
- const isOrphaned = workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN);
125
+ const isOrphaned = workingCopy.hasState(4 );
128
126
  if (isReadonly && isOrphaned) {
129
127
  return {
130
128
  color: listErrorForeground,
131
129
  letter: Codicon.lockSmall,
132
130
  strikethrough: true,
133
- tooltip: ( localize(7844, "Deleted, Read-only")),
131
+ tooltip: ( localize(7879, "Deleted, Read-only")),
134
132
  };
135
133
  }
136
134
  else if (isReadonly) {
137
135
  return {
138
136
  letter: Codicon.lockSmall,
139
- tooltip: ( localize(7845, "Read-only")),
137
+ tooltip: ( localize(7880, "Read-only")),
140
138
  };
141
139
  }
142
140
  else if (isOrphaned) {
143
141
  return {
144
142
  color: listErrorForeground,
145
143
  strikethrough: true,
146
- tooltip: ( localize(7846, "Deleted")),
144
+ tooltip: ( localize(7881, "Deleted")),
147
145
  };
148
146
  }
149
147
  return undefined;
@@ -213,7 +211,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
213
211
  let sourceContents;
214
212
  const sourceWorkingCopy = this.get(source);
215
213
  if (sourceWorkingCopy?.isResolved()) {
216
- sourceContents = await sourceWorkingCopy.model.snapshot(SnapshotContext.Save, CancellationToken.None);
214
+ sourceContents = await sourceWorkingCopy.model.snapshot(1 , CancellationToken.None);
217
215
  }
218
216
  else {
219
217
  sourceContents = (await this.fileService.readFileStream(source)).value;
@@ -275,17 +273,17 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
275
273
  const { confirmed } = await this.dialogService.confirm({
276
274
  type: 'warning',
277
275
  message: ( localize(
278
- 7847,
276
+ 7882,
279
277
  "'{0}' already exists. Do you want to replace it?",
280
278
  basename(resource)
281
279
  )),
282
280
  detail: ( localize(
283
- 7848,
281
+ 7883,
284
282
  "A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
285
283
  basename(resource),
286
284
  basename(dirname(resource))
287
285
  )),
288
- primaryButton: ( localize(7849, "&&Replace"))
286
+ primaryButton: ( localize(7884, "&&Replace"))
289
287
  });
290
288
  return confirmed;
291
289
  }
@@ -293,12 +291,12 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
293
291
  const { confirmed } = await this.dialogService.confirm({
294
292
  type: 'warning',
295
293
  message: ( localize(
296
- 7850,
294
+ 7885,
297
295
  "'{0}' is marked as read-only. Do you want to save anyway?",
298
296
  basename(resource)
299
297
  )),
300
- detail: ( localize(7851, "Paths can be configured as read-only via settings.")),
301
- primaryButton: ( localize(7852, "&&Save Anyway"))
298
+ detail: ( localize(7886, "Paths can be configured as read-only via settings.")),
299
+ primaryButton: ( localize(7887, "&&Save Anyway"))
302
300
  });
303
301
  return confirmed;
304
302
  }
@@ -2,10 +2,9 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { localize } from 'vscode/vscode/vs/nls';
3
3
  import { DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
4
4
  import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
5
- import { StoredFileWorkingCopyState, StoredFileWorkingCopy } from 'vscode/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
5
+ import { StoredFileWorkingCopy } from 'vscode/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
6
6
  import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
7
7
  import { ResourceQueue, Promises } from 'vscode/vscode/vs/base/common/async';
8
- import { FileChangeType, FileOperation } from 'vscode/vscode/vs/platform/files/common/files';
9
8
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
10
9
  import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
11
10
  import { URI } from 'vscode/vscode/vs/base/common/uri';
@@ -25,7 +24,6 @@ import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/w
25
24
  import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
26
25
  import { isWeb } from 'vscode/vscode/vs/base/common/platform';
27
26
  import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
28
- import { SnapshotContext } from 'vscode/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
29
27
  import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
30
28
 
31
29
  let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends BaseFileWorkingCopyManager {
@@ -77,12 +75,12 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
77
75
  this._register(this.lifecycleService.onBeforeShutdown(event => event.veto(this.onBeforeShutdownWeb(), 'veto.fileWorkingCopyManager')));
78
76
  }
79
77
  else {
80
- this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(10724, "Saving working copies")) })));
78
+ this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(10799, "Saving working copies")) })));
81
79
  }
82
80
  }
83
81
  onBeforeShutdownWeb() {
84
82
  if (( (this.workingCopies.some(
85
- workingCopy => workingCopy.hasState(StoredFileWorkingCopyState.PENDING_SAVE)
83
+ workingCopy => workingCopy.hasState(2 )
86
84
  )))) {
87
85
  return true;
88
86
  }
@@ -90,9 +88,9 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
90
88
  }
91
89
  async onWillShutdownDesktop() {
92
90
  let pendingSavedWorkingCopies;
93
- while ((pendingSavedWorkingCopies = this.workingCopies.filter(workingCopy => workingCopy.hasState(StoredFileWorkingCopyState.PENDING_SAVE))).length > 0) {
91
+ while ((pendingSavedWorkingCopies = this.workingCopies.filter(workingCopy => workingCopy.hasState(2 ))).length > 0) {
94
92
  await Promises.settled(( (pendingSavedWorkingCopies.map(
95
- workingCopy => workingCopy.joinState(StoredFileWorkingCopyState.PENDING_SAVE)
93
+ workingCopy => workingCopy.joinState(2 )
96
94
  ))));
97
95
  }
98
96
  }
@@ -118,7 +116,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
118
116
  resolveWorkingCopy = schemeOrEvent === workingCopy.resource.scheme;
119
117
  }
120
118
  else {
121
- resolveWorkingCopy = schemeOrEvent.contains(workingCopy.resource, FileChangeType.UPDATED, FileChangeType.ADDED);
119
+ resolveWorkingCopy = schemeOrEvent.contains(workingCopy.resource, 0 , 1 );
122
120
  }
123
121
  if (resolveWorkingCopy) {
124
122
  this.queueWorkingCopyReload(workingCopy);
@@ -139,7 +137,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
139
137
  }
140
138
  }
141
139
  onWillRunWorkingCopyFileOperation(e) {
142
- if (e.operation === FileOperation.MOVE || e.operation === FileOperation.COPY) {
140
+ if (e.operation === 2 || e.operation === 3 ) {
143
141
  e.waitUntil((async () => {
144
142
  const workingCopiesToRestore = [];
145
143
  for (const { source, target } of e.files) {
@@ -165,7 +163,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
165
163
  workingCopiesToRestore.push({
166
164
  source: sourceResource,
167
165
  target: targetResource,
168
- snapshot: sourceWorkingCopy.isDirty() ? await sourceWorkingCopy.model?.snapshot(SnapshotContext.Save, CancellationToken.None) : undefined
166
+ snapshot: sourceWorkingCopy.isDirty() ? await sourceWorkingCopy.model?.snapshot(1 , CancellationToken.None) : undefined
169
167
  });
170
168
  }
171
169
  }
@@ -175,7 +173,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
175
173
  }
176
174
  }
177
175
  onDidFailWorkingCopyFileOperation(e) {
178
- if ((e.operation === FileOperation.MOVE || e.operation === FileOperation.COPY)) {
176
+ if (((e.operation === 2 || e.operation === 3) )) {
179
177
  const workingCopiesToRestore = this.mapCorrelationIdToWorkingCopiesToRestore.get(e.correlationId);
180
178
  if (workingCopiesToRestore) {
181
179
  this.mapCorrelationIdToWorkingCopiesToRestore.delete(e.correlationId);
@@ -189,7 +187,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
189
187
  }
190
188
  onDidRunWorkingCopyFileOperation(e) {
191
189
  switch (e.operation) {
192
- case FileOperation.CREATE:
190
+ case 0 :
193
191
  e.waitUntil((async () => {
194
192
  for (const { target } of e.files) {
195
193
  const workingCopy = this.get(target);
@@ -199,8 +197,8 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
199
197
  }
200
198
  })());
201
199
  break;
202
- case FileOperation.MOVE:
203
- case FileOperation.COPY:
200
+ case 2 :
201
+ case 3 :
204
202
  e.waitUntil((async () => {
205
203
  const workingCopiesToRestore = this.mapCorrelationIdToWorkingCopiesToRestore.get(e.correlationId);
206
204
  if (workingCopiesToRestore) {
@@ -1,7 +1,5 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
- import { WorkingCopyCapabilities } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopy';
4
- import { SnapshotContext } from 'vscode/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
5
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
6
4
  import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
7
5
  import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
@@ -24,7 +22,7 @@ let UntitledFileWorkingCopy = class UntitledFileWorkingCopy extends Disposable {
24
22
  this.saveDelegate = saveDelegate;
25
23
  this.workingCopyBackupService = workingCopyBackupService;
26
24
  this.logService = logService;
27
- this.capabilities = this.isScratchpad ? WorkingCopyCapabilities.Untitled | WorkingCopyCapabilities.Scratchpad : WorkingCopyCapabilities.Untitled;
25
+ this.capabilities = this.isScratchpad ? 2 | 4 : 2 ;
28
26
  this._model = undefined;
29
27
  this._onDidChangeContent = this._register(( new Emitter()));
30
28
  this.onDidChangeContent = this._onDidChangeContent.event;
@@ -107,7 +105,7 @@ let UntitledFileWorkingCopy = class UntitledFileWorkingCopy extends Disposable {
107
105
  async backup(token) {
108
106
  let content = undefined;
109
107
  if (this.isResolved()) {
110
- content = await raceCancellation(this.model.snapshot(SnapshotContext.Backup, token), token);
108
+ content = await raceCancellation(this.model.snapshot(2 , token), token);
111
109
  }
112
110
  else if (this.initialContents) {
113
111
  content = this.initialContents.value;
@@ -1,33 +0,0 @@
1
- import 'vscode/vscode/vs/base/browser/dom';
2
- import 'vscode/vscode/vs/base/browser/dompurify/dompurify';
3
- import 'vscode/vscode/vs/base/common/event';
4
- import 'vscode/vscode/vs/base/browser/formattedTextRenderer';
5
- import 'vscode/vscode/vs/base/browser/browser';
6
- import 'vscode/vscode/vs/base/common/keyCodes';
7
- import 'vscode/vscode/vs/base/common/keybindings';
8
- import 'vscode/vscode/vs/base/common/platform';
9
- import 'vscode/vscode/vs/base/common/themables';
10
- import 'vscode/vscode/vs/base/common/htmlContent';
11
- import 'vscode/vscode/vs/base/common/filters';
12
- import 'vscode/vscode/vs/base/common/strings';
13
- import 'vscode/vscode/vs/base/common/lifecycle';
14
- import 'vscode/vscode/vs/base/common/charCode';
15
- import 'vscode/vscode/vs/base/common/marshallingIds';
16
- import 'vscode/vscode/vs/base/common/path';
17
- import 'vscode/vscode/vs/base/common/network';
18
- import 'vscode/vscode/vs/base/common/resources';
19
- import 'vscode/vscode/vs/nls';
20
- import 'vscode/vscode/vs/editor/common/model';
21
- import 'vscode/vscode/vs/editor/contrib/folding/browser/foldingRanges';
22
- import 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
23
- import 'vscode/vscode/vs/base/common/codicons';
24
- import 'vscode/vscode/vs/platform/markers/common/markers';
25
- import 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
26
- import 'vscode/vscode/vs/editor/common/languages';
27
-
28
- var NotebookOutlineConstants;
29
- ( (function(NotebookOutlineConstants) {
30
- NotebookOutlineConstants[NotebookOutlineConstants["NonHeaderOutlineLevel"] = 7] = "NonHeaderOutlineLevel";
31
- })(NotebookOutlineConstants || (NotebookOutlineConstants = {})));
32
-
33
- export { NotebookOutlineConstants };