@codingame/monaco-vscode-notebook-service-override 8.0.4 → 9.0.2

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 (58) hide show
  1. package/package.json +3 -2
  2. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +8 -8
  3. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +21 -21
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +2 -2
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +1 -1
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +3 -3
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +6 -6
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +26 -24
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +2 -2
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +4 -4
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +1 -1
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +1 -1
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +624 -0
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +13 -13
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +1 -1
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +4 -5
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +9 -9
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +12 -12
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +3 -3
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +24 -24
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +54 -55
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +22 -22
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +23 -21
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +7 -7
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +12 -12
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +297 -21
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +124 -73
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +27 -19
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +62 -39
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +7 -6
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +3 -3
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +7 -1
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +18 -6
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +15 -40
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +0 -1
  42. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +28 -0
  43. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +55 -45
  44. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +6 -6
  45. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +12 -12
  46. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -47
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1303
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -267
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -569
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -115
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -903
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -397
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -186
  58. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -107
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Disposable, DisposableStore, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { SimpleWorkerClient } from 'vscode/vscode/vs/base/common/worker/simpleWorker';
4
- import { DefaultWorkerFactory } from 'vscode/vscode/vs/base/browser/defaultWorkerFactory';
3
+ import { createWebWorker } from 'vscode/vscode/vs/base/browser/defaultWorkerFactory';
5
4
  import { NotebookCellsChangeType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
6
5
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
7
6
 
@@ -35,7 +34,7 @@ class WorkerManager extends Disposable {
35
34
  }
36
35
  withWorker() {
37
36
  if (!this._editorWorkerClient) {
38
- this._editorWorkerClient = ( new NotebookWorkerClient(this._notebookService, 'notebookEditorWorkerService'));
37
+ this._editorWorkerClient = ( new NotebookWorkerClient(this._notebookService));
39
38
  }
40
39
  return Promise.resolve(this._editorWorkerClient);
41
40
  }
@@ -65,7 +64,7 @@ class NotebookEditorModelManager extends Disposable {
65
64
  return;
66
65
  }
67
66
  const modelUrl = ( resource.toString());
68
- this._proxy.acceptNewModel(( model.uri.toString()), {
67
+ this._proxy.$acceptNewModel(( model.uri.toString()), {
69
68
  cells: ( model.cells.map(cell => ({
70
69
  handle: cell.handle,
71
70
  uri: cell.uri,
@@ -114,7 +113,7 @@ class NotebookEditorModelManager extends Disposable {
114
113
  : e);
115
114
  return data;
116
115
  }));
117
- this._proxy.acceptModelChanged(( modelUrl.toString()), {
116
+ this._proxy.$acceptModelChanged(( modelUrl.toString()), {
118
117
  rawEvents: dto,
119
118
  versionId: event.versionId
120
119
  });
@@ -123,7 +122,7 @@ class NotebookEditorModelManager extends Disposable {
123
122
  this._stopModelSync(modelUrl);
124
123
  }));
125
124
  toDispose.add(toDisposable(() => {
126
- this._proxy.acceptRemovedModel(modelUrl);
125
+ this._proxy.$acceptRemovedModel(modelUrl);
127
126
  }));
128
127
  this._syncedModels[modelUrl] = toDispose;
129
128
  }
@@ -134,34 +133,20 @@ class NotebookEditorModelManager extends Disposable {
134
133
  dispose(toDispose);
135
134
  }
136
135
  }
137
- class NotebookWorkerHost {
138
- constructor(workerClient) {
139
- this._workerClient = workerClient;
140
- }
141
- fhr(method, args) {
142
- return this._workerClient.fhr(method, args);
143
- }
144
- }
145
136
  class NotebookWorkerClient extends Disposable {
146
- constructor(_notebookService, label) {
137
+ constructor(_notebookService) {
147
138
  super();
148
139
  this._notebookService = _notebookService;
149
- this._workerFactory = ( new DefaultWorkerFactory(label));
150
140
  this._worker = null;
151
141
  this._modelManager = null;
152
142
  }
153
- fhr(method, args) {
154
- throw ( new Error(`Not implemented!`));
155
- }
156
143
  computeDiff(original, modified) {
157
- return this._withSyncedResources([original, modified]).then(proxy => {
158
- return proxy.computeDiff(( original.toString()), ( modified.toString()));
159
- });
144
+ const proxy = this._ensureSyncedResources([original, modified]);
145
+ return proxy.$computeDiff(( original.toString()), ( modified.toString()));
160
146
  }
161
147
  canPromptRecommendation(modelUri) {
162
- return this._withSyncedResources([modelUri]).then(proxy => {
163
- return proxy.canPromptRecommendation(( modelUri.toString()));
164
- });
148
+ const proxy = this._ensureSyncedResources([modelUri]);
149
+ return proxy.$canPromptRecommendation(( modelUri.toString()));
165
150
  }
166
151
  _getOrCreateModelManager(proxy) {
167
152
  if (!this._modelManager) {
@@ -169,20 +154,15 @@ class NotebookWorkerClient extends Disposable {
169
154
  }
170
155
  return this._modelManager;
171
156
  }
172
- _withSyncedResources(resources) {
173
- return this._getProxy().then((proxy) => {
174
- this._getOrCreateModelManager(proxy).ensureSyncedResources(resources);
175
- return proxy;
176
- });
157
+ _ensureSyncedResources(resources) {
158
+ const proxy = this._getOrCreateWorker().proxy;
159
+ this._getOrCreateModelManager(proxy).ensureSyncedResources(resources);
160
+ return proxy;
177
161
  }
178
162
  _getOrCreateWorker() {
179
163
  if (!this._worker) {
180
164
  try {
181
- this._worker = this._register(( new SimpleWorkerClient(
182
- this._workerFactory,
183
- 'vs/workbench/contrib/notebook/common/services/notebookSimpleWorker',
184
- ( new NotebookWorkerHost(this))
185
- )));
165
+ this._worker = this._register(createWebWorker('vs/workbench/contrib/notebook/common/services/notebookSimpleWorker', 'NotebookEditorWorker'));
186
166
  }
187
167
  catch (err) {
188
168
  throw (err);
@@ -190,11 +170,6 @@ class NotebookWorkerClient extends Disposable {
190
170
  }
191
171
  return this._worker;
192
172
  }
193
- _getProxy() {
194
- return this._getOrCreateWorker().getProxyObject().then(undefined, (err) => {
195
- throw (err);
196
- });
197
- }
198
173
  }
199
174
 
200
175
  export { NotebookEditorWorkerServiceImpl };
@@ -11,7 +11,6 @@ import 'vscode/vscode/vs/base/common/htmlContent';
11
11
  import 'vscode/vscode/vs/base/common/filters';
12
12
  import 'vscode/vscode/vs/base/common/strings';
13
13
  import 'vscode/vscode/vs/base/common/lifecycle';
14
- import 'vscode/external/vscode-marked/lib/marked.esm.js';
15
14
  import 'vscode/vscode/vs/base/common/charCode';
16
15
  import 'vscode/vscode/vs/base/common/marshallingIds';
17
16
  import 'vscode/vscode/vs/base/common/path';
@@ -16,6 +16,8 @@ import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/langu
16
16
  import { TextModel } from 'vscode/vscode/vs/editor/common/model/textModel';
17
17
  import { isDefined } from 'vscode/vscode/vs/base/common/types';
18
18
  import { ILanguageDetectionService } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.service';
19
+ import { Range } from 'vscode/vscode/vs/editor/common/core/range';
20
+ import { SearchParams } from 'vscode/vscode/vs/editor/common/model/textModelSearch';
19
21
 
20
22
  var NotebookTextModel_1;
21
23
  class StackOperation {
@@ -1000,6 +1002,32 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
1000
1002
  _indexIsInvalid(index) {
1001
1003
  return index < 0 || index >= this._cells.length;
1002
1004
  }
1005
+ findNextMatch(searchString, searchStart, isRegex, matchCase, wordSeparators) {
1006
+ this._assertIndex(searchStart.cellIndex);
1007
+ const searchParams = ( new SearchParams(searchString, isRegex, matchCase, wordSeparators));
1008
+ const searchData = searchParams.parseSearchRequest();
1009
+ if (!searchData) {
1010
+ return null;
1011
+ }
1012
+ let cellIndex = searchStart.cellIndex;
1013
+ let searchStartPosition = searchStart.position;
1014
+ while (cellIndex < this._cells.length) {
1015
+ const cell = this._cells[cellIndex];
1016
+ const searchRange = ( new Range(
1017
+ searchStartPosition.lineNumber,
1018
+ searchStartPosition.column,
1019
+ cell.textBuffer.getLineCount(),
1020
+ cell.textBuffer.getLineMaxColumn(cell.textBuffer.getLineCount())
1021
+ ));
1022
+ const result = cell.textBuffer.findMatchesLineByLine(searchRange, searchData, false, 1);
1023
+ if (result.length > 0) {
1024
+ return { cell, match: result[0] };
1025
+ }
1026
+ cellIndex++;
1027
+ searchStartPosition = { lineNumber: 1, column: 1 };
1028
+ }
1029
+ return null;
1030
+ }
1003
1031
  };
1004
1032
  NotebookTextModel = NotebookTextModel_1 = ( __decorate([
1005
1033
  ( __param(5, IUndoRedoService)),
@@ -5,7 +5,6 @@ import { NotebookWorkingCopyTypeIdentifier, NotebookSetting, CellUri } from 'vsc
5
5
  import { NotebookFileWorkingCopyModelFactory, SimpleNotebookEditorModel } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
6
6
  import { ReferenceCollection, DisposableStore, dispose, combinedDisposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
7
7
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
8
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
9
8
  import { Emitter, AsyncEmitter } from 'vscode/vscode/vs/base/common/event';
10
9
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
11
10
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
@@ -17,15 +16,16 @@ import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
17
16
  import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
18
17
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
19
18
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
19
+ import { INotebookLoggingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service';
20
20
 
21
21
  let NotebookModelReferenceCollection = class NotebookModelReferenceCollection extends ReferenceCollection {
22
- constructor(_instantiationService, _notebookService, _logService, _configurationService, _telemetryService) {
22
+ constructor(_instantiationService, _notebookService, _configurationService, _telemetryService, _notebookLoggingService) {
23
23
  super();
24
24
  this._instantiationService = _instantiationService;
25
25
  this._notebookService = _notebookService;
26
- this._logService = _logService;
27
26
  this._configurationService = _configurationService;
28
27
  this._telemetryService = _telemetryService;
28
+ this._notebookLoggingService = _notebookLoggingService;
29
29
  this._disposables = ( new DisposableStore());
30
30
  this._workingCopyManagers = ( new Map());
31
31
  this._modelListener = ( new Map());
@@ -57,7 +57,7 @@ let NotebookModelReferenceCollection = class NotebookModelReferenceCollection ex
57
57
  this._notebookService,
58
58
  this._configurationService,
59
59
  this._telemetryService,
60
- this._logService
60
+ this._notebookLoggingService
61
61
  ));
62
62
  workingCopyManager = this._instantiationService.createInstance(FileWorkingCopyManager, workingCopyTypeId, factory, factory);
63
63
  this._workingCopyManagers.set(workingCopyTypeId, workingCopyManager);
@@ -99,7 +99,7 @@ let NotebookModelReferenceCollection = class NotebookModelReferenceCollection ex
99
99
  model.dispose();
100
100
  }
101
101
  catch (err) {
102
- this._logService.error('FAILED to destory notebook', err);
102
+ this._notebookLoggingService.error('NotebookModelCollection', 'FAILED to destory notebook - ' + err);
103
103
  }
104
104
  finally {
105
105
  this.modelsToDispose.delete(key);
@@ -110,9 +110,9 @@ let NotebookModelReferenceCollection = class NotebookModelReferenceCollection ex
110
110
  NotebookModelReferenceCollection = ( __decorate([
111
111
  ( __param(0, IInstantiationService)),
112
112
  ( __param(1, INotebookService)),
113
- ( __param(2, ILogService)),
114
- ( __param(3, IConfigurationService)),
115
- ( __param(4, ITelemetryService))
113
+ ( __param(2, IConfigurationService)),
114
+ ( __param(3, ITelemetryService)),
115
+ ( __param(4, INotebookLoggingService))
116
116
  ], NotebookModelReferenceCollection));
117
117
  let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
118
118
  constructor(instantiationService, _notebookService, _extensionService, _uriIdentService) {
@@ -131,45 +131,33 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
131
131
  isDirty(resource) {
132
132
  return this._data.isDirty(resource);
133
133
  }
134
- async resolve(arg0, viewType, options) {
135
- let resource;
136
- let hasAssociatedFilePath = false;
137
- if (URI.isUri(arg0)) {
138
- resource = arg0;
134
+ createUntitledUri(notebookType) {
135
+ const info = this._notebookService.getContributedNotebookType(assertIsDefined(notebookType));
136
+ if (!info) {
137
+ throw ( new Error('UNKNOWN notebook type: ' + notebookType));
139
138
  }
140
- else {
141
- if (!arg0.untitledResource) {
142
- const info = this._notebookService.getContributedNotebookType(assertIsDefined(viewType));
143
- if (!info) {
144
- throw ( new Error('UNKNOWN view type: ' + viewType));
145
- }
146
- const suffix = NotebookProviderInfo.possibleFileEnding(info.selectors) ?? '';
147
- for (let counter = 1;; counter++) {
148
- const candidate = ( URI.from(
149
- { scheme: Schemas.untitled, path: `Untitled-${counter}${suffix}`, query: viewType }
150
- ));
151
- if (!this._notebookService.getNotebookTextModel(candidate)) {
152
- resource = candidate;
153
- break;
154
- }
155
- }
156
- }
157
- else if (arg0.untitledResource.scheme === Schemas.untitled) {
158
- resource = arg0.untitledResource;
159
- }
160
- else {
161
- resource = arg0.untitledResource.with({ scheme: Schemas.untitled });
162
- hasAssociatedFilePath = true;
139
+ const suffix = NotebookProviderInfo.possibleFileEnding(info.selectors) ?? '';
140
+ for (let counter = 1;; counter++) {
141
+ const candidate = ( URI.from(
142
+ { scheme: Schemas.untitled, path: `Untitled-${counter}${suffix}`, query: notebookType }
143
+ ));
144
+ if (!this._notebookService.getNotebookTextModel(candidate)) {
145
+ return candidate;
163
146
  }
164
147
  }
165
- if (resource.scheme === CellUri.scheme) {
166
- throw ( new Error(`CANNOT open a cell-uri as notebook. Tried with ${( resource.toString())}`));
148
+ }
149
+ async validateResourceViewType(uri, viewType) {
150
+ if (!uri && !viewType) {
151
+ throw ( new Error('Must provide at least one of resource or viewType'));
152
+ }
153
+ if (uri?.scheme === CellUri.scheme) {
154
+ throw ( new Error(`CANNOT open a cell-uri as notebook. Tried with ${( uri.toString())}`));
167
155
  }
168
- resource = this._uriIdentService.asCanonicalUri(resource);
169
- const existingViewType = this._notebookService.getNotebookTextModel(resource)?.viewType;
156
+ const resource = this._uriIdentService.asCanonicalUri(uri ?? this.createUntitledUri(viewType));
157
+ const existingNotebook = this._notebookService.getNotebookTextModel(resource);
170
158
  if (!viewType) {
171
- if (existingViewType) {
172
- viewType = existingViewType;
159
+ if (existingNotebook) {
160
+ viewType = existingNotebook.viewType;
173
161
  }
174
162
  else {
175
163
  await this._extensionService.whenInstalledExtensionsRegistered();
@@ -182,8 +170,8 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
182
170
  if (!viewType) {
183
171
  throw ( new Error(`Missing viewType for '${resource}'`));
184
172
  }
185
- if (existingViewType && existingViewType !== viewType) {
186
- await this._onWillFailWithConflict.fireAsync({ resource, viewType }, CancellationToken.None);
173
+ if (existingNotebook && existingNotebook.viewType !== viewType) {
174
+ await this._onWillFailWithConflict.fireAsync({ resource: resource, viewType }, CancellationToken.None);
187
175
  const existingViewType2 = this._notebookService.getNotebookTextModel(resource)?.viewType;
188
176
  if (existingViewType2 && existingViewType2 !== viewType) {
189
177
  throw ( new Error(
@@ -191,7 +179,29 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
191
179
  ));
192
180
  }
193
181
  }
194
- const reference = this._data.acquire(( resource.toString()), viewType, hasAssociatedFilePath, options?.limits, options?.scratchpad);
182
+ return { resource, viewType };
183
+ }
184
+ async createUntitledNotebookTextModel(viewType) {
185
+ const resource = this._uriIdentService.asCanonicalUri(this.createUntitledUri(viewType));
186
+ return (await this._notebookService.createNotebookTextModel(viewType, resource));
187
+ }
188
+ async resolve(arg0, viewType, options) {
189
+ let resource;
190
+ let hasAssociatedFilePath;
191
+ if (URI.isUri(arg0)) {
192
+ resource = arg0;
193
+ }
194
+ else if (arg0.untitledResource) {
195
+ if (arg0.untitledResource.scheme === Schemas.untitled) {
196
+ resource = arg0.untitledResource;
197
+ }
198
+ else {
199
+ resource = arg0.untitledResource.with({ scheme: Schemas.untitled });
200
+ hasAssociatedFilePath = true;
201
+ }
202
+ }
203
+ const validated = await this.validateResourceViewType(resource, viewType);
204
+ const reference = this._data.acquire(( validated.resource.toString()), validated.viewType, hasAssociatedFilePath, options?.limits, options?.scratchpad);
195
205
  try {
196
206
  const model = await reference.object;
197
207
  return {
@@ -152,7 +152,7 @@ class NotebookEditorSimpleWorker {
152
152
  }
153
153
  dispose() {
154
154
  }
155
- acceptNewModel(uri, data) {
155
+ $acceptNewModel(uri, data) {
156
156
  this._models[uri] = ( new MirrorNotebookDocument(( URI.parse(uri)), ( data.cells.map(dto => ( new MirrorCell(
157
157
  dto.handle,
158
158
  dto.source,
@@ -162,17 +162,17 @@ class NotebookEditorSimpleWorker {
162
162
  dto.metadata
163
163
  )))), data.metadata));
164
164
  }
165
- acceptModelChanged(strURL, event) {
165
+ $acceptModelChanged(strURL, event) {
166
166
  const model = this._models[strURL];
167
167
  model?.acceptModelChanged(event);
168
168
  }
169
- acceptRemovedModel(strURL) {
169
+ $acceptRemovedModel(strURL) {
170
170
  if (!this._models[strURL]) {
171
171
  return;
172
172
  }
173
173
  delete this._models[strURL];
174
174
  }
175
- computeDiff(originalUrl, modifiedUrl) {
175
+ $computeDiff(originalUrl, modifiedUrl) {
176
176
  const original = this._getModel(originalUrl);
177
177
  const modified = this._getModel(modifiedUrl);
178
178
  const diff = ( new LcsDiff(( new CellSequence(original)), ( new CellSequence(modified))));
@@ -181,7 +181,7 @@ class NotebookEditorSimpleWorker {
181
181
  cellsDiff: diffResult,
182
182
  };
183
183
  }
184
- canPromptRecommendation(modelUrl) {
184
+ $canPromptRecommendation(modelUrl) {
185
185
  const model = this._getModel(modelUrl);
186
186
  const cells = model.cells;
187
187
  for (let i = 0; i < cells.length; i++) {
@@ -211,7 +211,7 @@ class NotebookEditorSimpleWorker {
211
211
  return this._models[uri];
212
212
  }
213
213
  }
214
- function create(host) {
214
+ function create(workerServer) {
215
215
  return ( new NotebookEditorSimpleWorker());
216
216
  }
217
217
 
@@ -47,8 +47,8 @@ import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/prog
47
47
  var FileWorkingCopyManager_1;
48
48
  let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
49
49
  static { FileWorkingCopyManager_1 = this; }
50
- static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localize(8049, "File Created"))); }
51
- static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localize(8050, "File Replaced"))); }
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"))); }
52
52
  constructor(workingCopyTypeId, storedWorkingCopyModelFactory, untitledWorkingCopyModelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, fileDialogService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, pathService, environmentService, dialogService, decorationsService, progressService) {
53
53
  super();
54
54
  this.workingCopyTypeId = workingCopyTypeId;
@@ -103,7 +103,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
103
103
  constructor(stored) {
104
104
  super();
105
105
  this.stored = stored;
106
- this.label = ( localize(8051, "File Working Copy Decorations"));
106
+ this.label = ( localize(7843, "File Working Copy Decorations"));
107
107
  this._onDidChange = this._register(( (new Emitter())));
108
108
  this.onDidChange = this._onDidChange.event;
109
109
  this.registerListeners();
@@ -130,20 +130,20 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
130
130
  color: listErrorForeground,
131
131
  letter: Codicon.lockSmall,
132
132
  strikethrough: true,
133
- tooltip: ( localize(8052, "Deleted, Read-only")),
133
+ tooltip: ( localize(7844, "Deleted, Read-only")),
134
134
  };
135
135
  }
136
136
  else if (isReadonly) {
137
137
  return {
138
138
  letter: Codicon.lockSmall,
139
- tooltip: ( localize(8053, "Read-only")),
139
+ tooltip: ( localize(7845, "Read-only")),
140
140
  };
141
141
  }
142
142
  else if (isOrphaned) {
143
143
  return {
144
144
  color: listErrorForeground,
145
145
  strikethrough: true,
146
- tooltip: ( localize(8054, "Deleted")),
146
+ tooltip: ( localize(7846, "Deleted")),
147
147
  };
148
148
  }
149
149
  return undefined;
@@ -275,17 +275,17 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
275
275
  const { confirmed } = await this.dialogService.confirm({
276
276
  type: 'warning',
277
277
  message: ( localize(
278
- 8055,
278
+ 7847,
279
279
  "'{0}' already exists. Do you want to replace it?",
280
280
  basename(resource)
281
281
  )),
282
282
  detail: ( localize(
283
- 8056,
283
+ 7848,
284
284
  "A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
285
285
  basename(resource),
286
286
  basename(dirname(resource))
287
287
  )),
288
- primaryButton: ( localize(8057, "&&Replace"))
288
+ primaryButton: ( localize(7849, "&&Replace"))
289
289
  });
290
290
  return confirmed;
291
291
  }
@@ -293,12 +293,12 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
293
293
  const { confirmed } = await this.dialogService.confirm({
294
294
  type: 'warning',
295
295
  message: ( localize(
296
- 8058,
296
+ 7850,
297
297
  "'{0}' is marked as read-only. Do you want to save anyway?",
298
298
  basename(resource)
299
299
  )),
300
- detail: ( localize(8059, "Paths can be configured as read-only via settings.")),
301
- primaryButton: ( localize(8060, "&&Save Anyway"))
300
+ detail: ( localize(7851, "Paths can be configured as read-only via settings.")),
301
+ primaryButton: ( localize(7852, "&&Save Anyway"))
302
302
  });
303
303
  return confirmed;
304
304
  }
@@ -77,7 +77,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
77
77
  this._register(this.lifecycleService.onBeforeShutdown(event => event.veto(this.onBeforeShutdownWeb(), 'veto.fileWorkingCopyManager')));
78
78
  }
79
79
  else {
80
- this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(10717, "Saving working copies")) })));
80
+ this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(10724, "Saving working copies")) })));
81
81
  }
82
82
  }
83
83
  onBeforeShutdownWeb() {
@@ -1,47 +0,0 @@
1
- const fixedEditorPadding = {
2
- top: 12,
3
- bottom: 12
4
- };
5
- const fixedEditorOptions = {
6
- padding: fixedEditorPadding,
7
- scrollBeyondLastLine: false,
8
- scrollbar: {
9
- verticalScrollbarSize: 14,
10
- horizontal: 'auto',
11
- vertical: 'auto',
12
- useShadows: true,
13
- verticalHasArrows: false,
14
- horizontalHasArrows: false,
15
- alwaysConsumeMouseWheel: false,
16
- },
17
- renderLineHighlightOnlyWhenFocus: true,
18
- overviewRulerLanes: 0,
19
- overviewRulerBorder: false,
20
- selectOnLineNumbers: false,
21
- wordWrap: 'off',
22
- lineNumbers: 'off',
23
- lineDecorationsWidth: 0,
24
- glyphMargin: false,
25
- fixedOverflowWidgets: true,
26
- minimap: { enabled: false },
27
- renderValidationDecorations: 'on',
28
- renderLineHighlight: 'none',
29
- readOnly: true
30
- };
31
- const fixedDiffEditorOptions = {
32
- ...fixedEditorOptions,
33
- glyphMargin: true,
34
- enableSplitViewResizing: false,
35
- renderIndicators: true,
36
- renderMarginRevertIcon: false,
37
- readOnly: false,
38
- isInEmbeddedEditor: true,
39
- renderOverviewRuler: false,
40
- wordWrap: 'off',
41
- diffWordWrap: 'off',
42
- diffAlgorithm: 'advanced',
43
- renderSideBySide: true,
44
- useInlineViewWhenSpaceIsLimited: false
45
- };
46
-
47
- export { fixedDiffEditorOptions, fixedEditorOptions, fixedEditorPadding };