@codingame/monaco-vscode-notebook-service-override 4.0.0 → 4.1.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 (77) hide show
  1. package/notebook.js +12 -12
  2. package/package.json +2 -2
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -10
  6. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
  7. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +0 -391
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -544
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -101
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -120
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -60
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -150
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -656
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -517
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -652
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -721
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -315
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +0 -199
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -47
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -115
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -911
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -395
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -185
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1187
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -510
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
  67. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -90
  68. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1002
  69. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
  70. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -203
  71. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
  72. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
  73. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
  74. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -386
  75. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
  76. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
  77. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
@@ -1,200 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
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';
5
- import { NotebookCellsChangeType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
6
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
7
-
8
- let NotebookEditorWorkerServiceImpl = class NotebookEditorWorkerServiceImpl extends Disposable {
9
- constructor(notebookService) {
10
- super();
11
- this._workerManager = this._register(( new WorkerManager(notebookService)));
12
- }
13
- canComputeDiff(original, modified) {
14
- throw new Error('Method not implemented.');
15
- }
16
- computeDiff(original, modified) {
17
- return this._workerManager.withWorker().then(client => {
18
- return client.computeDiff(original, modified);
19
- });
20
- }
21
- canPromptRecommendation(model) {
22
- return this._workerManager.withWorker().then(client => {
23
- return client.canPromptRecommendation(model);
24
- });
25
- }
26
- };
27
- NotebookEditorWorkerServiceImpl = ( __decorate([
28
- ( __param(0, INotebookService))
29
- ], NotebookEditorWorkerServiceImpl));
30
- class WorkerManager extends Disposable {
31
- constructor(_notebookService) {
32
- super();
33
- this._notebookService = _notebookService;
34
- this._editorWorkerClient = null;
35
- }
36
- withWorker() {
37
- if (!this._editorWorkerClient) {
38
- this._editorWorkerClient = ( new NotebookWorkerClient(this._notebookService, 'notebookEditorWorkerService'));
39
- }
40
- return Promise.resolve(this._editorWorkerClient);
41
- }
42
- }
43
- class NotebookEditorModelManager extends Disposable {
44
- constructor(_proxy, _notebookService) {
45
- super();
46
- this._proxy = _proxy;
47
- this._notebookService = _notebookService;
48
- this._syncedModels = Object.create(null);
49
- this._syncedModelsLastUsedTime = Object.create(null);
50
- }
51
- ensureSyncedResources(resources) {
52
- for (const resource of resources) {
53
- const resourceStr = ( resource.toString());
54
- if (!this._syncedModels[resourceStr]) {
55
- this._beginModelSync(resource);
56
- }
57
- if (this._syncedModels[resourceStr]) {
58
- this._syncedModelsLastUsedTime[resourceStr] = (( new Date())).getTime();
59
- }
60
- }
61
- }
62
- _beginModelSync(resource) {
63
- const model = this._notebookService.listNotebookDocuments().find(document => ( document.uri.toString()) === ( resource.toString()));
64
- if (!model) {
65
- return;
66
- }
67
- const modelUrl = ( resource.toString());
68
- this._proxy.acceptNewModel(( model.uri.toString()), {
69
- cells: ( model.cells.map(cell => ({
70
- handle: cell.handle,
71
- uri: cell.uri,
72
- source: cell.getValue(),
73
- eol: cell.textBuffer.getEOL(),
74
- language: cell.language,
75
- mime: cell.mime,
76
- cellKind: cell.cellKind,
77
- outputs: ( cell.outputs.map(op => ({ outputId: op.outputId, outputs: op.outputs }))),
78
- metadata: cell.metadata,
79
- internalMetadata: cell.internalMetadata,
80
- }))),
81
- metadata: model.metadata
82
- });
83
- const toDispose = ( new DisposableStore());
84
- const cellToDto = (cell) => {
85
- return {
86
- handle: cell.handle,
87
- uri: cell.uri,
88
- source: cell.textBuffer.getLinesContent(),
89
- eol: cell.textBuffer.getEOL(),
90
- language: cell.language,
91
- cellKind: cell.cellKind,
92
- outputs: ( cell.outputs.map(op => ({ outputId: op.outputId, outputs: op.outputs }))),
93
- metadata: cell.metadata,
94
- internalMetadata: cell.internalMetadata,
95
- };
96
- };
97
- toDispose.add(model.onDidChangeContent((event) => {
98
- const dto = ( event.rawEvents.map(e => {
99
- const data = e.kind === NotebookCellsChangeType.ModelChange || e.kind === NotebookCellsChangeType.Initialize
100
- ? {
101
- kind: e.kind,
102
- versionId: event.versionId,
103
- changes: ( e.changes.map(diff => [diff[0], diff[1], ( diff[2].map(cell => cellToDto(cell)))]))
104
- }
105
- : (e.kind === NotebookCellsChangeType.Move
106
- ? {
107
- kind: e.kind,
108
- index: e.index,
109
- length: e.length,
110
- newIdx: e.newIdx,
111
- versionId: event.versionId,
112
- cells: ( e.cells.map(cell => cellToDto(cell)))
113
- }
114
- : e);
115
- return data;
116
- }));
117
- this._proxy.acceptModelChanged(( modelUrl.toString()), {
118
- rawEvents: dto,
119
- versionId: event.versionId
120
- });
121
- }));
122
- toDispose.add(model.onWillDispose(() => {
123
- this._stopModelSync(modelUrl);
124
- }));
125
- toDispose.add(toDisposable(() => {
126
- this._proxy.acceptRemovedModel(modelUrl);
127
- }));
128
- this._syncedModels[modelUrl] = toDispose;
129
- }
130
- _stopModelSync(modelUrl) {
131
- const toDispose = this._syncedModels[modelUrl];
132
- delete this._syncedModels[modelUrl];
133
- delete this._syncedModelsLastUsedTime[modelUrl];
134
- dispose(toDispose);
135
- }
136
- }
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
- class NotebookWorkerClient extends Disposable {
146
- constructor(_notebookService, label) {
147
- super();
148
- this._notebookService = _notebookService;
149
- this._workerFactory = ( new DefaultWorkerFactory(label));
150
- this._worker = null;
151
- this._modelManager = null;
152
- }
153
- fhr(method, args) {
154
- throw new Error(`Not implemented!`);
155
- }
156
- computeDiff(original, modified) {
157
- return this._withSyncedResources([original, modified]).then(proxy => {
158
- return proxy.computeDiff(( original.toString()), ( modified.toString()));
159
- });
160
- }
161
- canPromptRecommendation(modelUri) {
162
- return this._withSyncedResources([modelUri]).then(proxy => {
163
- return proxy.canPromptRecommendation(( modelUri.toString()));
164
- });
165
- }
166
- _getOrCreateModelManager(proxy) {
167
- if (!this._modelManager) {
168
- this._modelManager = this._register(( new NotebookEditorModelManager(proxy, this._notebookService)));
169
- }
170
- return this._modelManager;
171
- }
172
- _withSyncedResources(resources) {
173
- return this._getProxy().then((proxy) => {
174
- this._getOrCreateModelManager(proxy).ensureSyncedResources(resources);
175
- return proxy;
176
- });
177
- }
178
- _getOrCreateWorker() {
179
- if (!this._worker) {
180
- try {
181
- this._worker = this._register(( new SimpleWorkerClient(
182
- this._workerFactory,
183
- 'vs/workbench/contrib/notebook/common/services/notebookSimpleWorker',
184
- ( new NotebookWorkerHost(this))
185
- )));
186
- }
187
- catch (err) {
188
- throw (err);
189
- }
190
- }
191
- return this._worker;
192
- }
193
- _getProxy() {
194
- return this._getOrCreateWorker().getProxyObject().then(undefined, (err) => {
195
- throw (err);
196
- });
197
- }
198
- }
199
-
200
- export { NotebookEditorWorkerServiceImpl };
@@ -1,90 +0,0 @@
1
- class MoveCellEdit {
2
- get label() {
3
- return this.length === 1 ? 'Move Cell' : 'Move Cells';
4
- }
5
- constructor(resource, fromIndex, length, toIndex, editingDelegate, beforedSelections, endSelections) {
6
- this.resource = resource;
7
- this.fromIndex = fromIndex;
8
- this.length = length;
9
- this.toIndex = toIndex;
10
- this.editingDelegate = editingDelegate;
11
- this.beforedSelections = beforedSelections;
12
- this.endSelections = endSelections;
13
- this.type = 0 ;
14
- this.code = 'undoredo.textBufferEdit';
15
- }
16
- undo() {
17
- if (!this.editingDelegate.moveCell) {
18
- throw new Error('Notebook Move Cell not implemented for Undo/Redo');
19
- }
20
- this.editingDelegate.moveCell(this.toIndex, this.length, this.fromIndex, this.endSelections, this.beforedSelections);
21
- }
22
- redo() {
23
- if (!this.editingDelegate.moveCell) {
24
- throw new Error('Notebook Move Cell not implemented for Undo/Redo');
25
- }
26
- this.editingDelegate.moveCell(this.fromIndex, this.length, this.toIndex, this.beforedSelections, this.endSelections);
27
- }
28
- }
29
- class SpliceCellsEdit {
30
- get label() {
31
- if (this.diffs.length === 1 && this.diffs[0][1].length === 0) {
32
- return this.diffs[0][2].length > 1 ? 'Insert Cells' : 'Insert Cell';
33
- }
34
- if (this.diffs.length === 1 && this.diffs[0][2].length === 0) {
35
- return this.diffs[0][1].length > 1 ? 'Delete Cells' : 'Delete Cell';
36
- }
37
- return 'Insert Cell';
38
- }
39
- constructor(resource, diffs, editingDelegate, beforeHandles, endHandles) {
40
- this.resource = resource;
41
- this.diffs = diffs;
42
- this.editingDelegate = editingDelegate;
43
- this.beforeHandles = beforeHandles;
44
- this.endHandles = endHandles;
45
- this.type = 0 ;
46
- this.code = 'undoredo.textBufferEdit';
47
- }
48
- undo() {
49
- if (!this.editingDelegate.replaceCell) {
50
- throw new Error('Notebook Replace Cell not implemented for Undo/Redo');
51
- }
52
- this.diffs.forEach(diff => {
53
- this.editingDelegate.replaceCell(diff[0], diff[2].length, diff[1], this.beforeHandles);
54
- });
55
- }
56
- redo() {
57
- if (!this.editingDelegate.replaceCell) {
58
- throw new Error('Notebook Replace Cell not implemented for Undo/Redo');
59
- }
60
- this.diffs.reverse().forEach(diff => {
61
- this.editingDelegate.replaceCell(diff[0], diff[1].length, diff[2], this.endHandles);
62
- });
63
- }
64
- }
65
- class CellMetadataEdit {
66
- constructor(resource, index, oldMetadata, newMetadata, editingDelegate) {
67
- this.resource = resource;
68
- this.index = index;
69
- this.oldMetadata = oldMetadata;
70
- this.newMetadata = newMetadata;
71
- this.editingDelegate = editingDelegate;
72
- this.type = 0 ;
73
- this.label = 'Update Cell Metadata';
74
- this.code = 'undoredo.textBufferEdit';
75
- }
76
- undo() {
77
- if (!this.editingDelegate.updateCellMetadata) {
78
- return;
79
- }
80
- this.editingDelegate.updateCellMetadata(this.index, this.oldMetadata);
81
- }
82
- redo() {
83
- if (!this.editingDelegate.updateCellMetadata) {
84
- return;
85
- }
86
- this.editingDelegate.updateCellMetadata(this.index, this.newMetadata);
87
- }
88
- }
89
-
90
- export { CellMetadataEdit, MoveCellEdit, SpliceCellsEdit };