@codingame/monaco-vscode-notebook-service-override 3.2.3 → 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 (80) hide show
  1. package/notebook.js +13 -13
  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 -8
  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 -389
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -488
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -91
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -118
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -59
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -148
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -383
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -511
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -565
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -707
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -267
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -45
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -108
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -890
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -393
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -175
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1174
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -509
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
  69. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -80
  70. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1003
  71. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
  72. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -202
  73. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
  74. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
  75. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
  76. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
  77. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -376
  78. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
  79. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
  80. 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,80 +0,0 @@
1
- class MoveCellEdit {
2
- constructor(resource, fromIndex, length, toIndex, editingDelegate, beforedSelections, endSelections) {
3
- this.resource = resource;
4
- this.fromIndex = fromIndex;
5
- this.length = length;
6
- this.toIndex = toIndex;
7
- this.editingDelegate = editingDelegate;
8
- this.beforedSelections = beforedSelections;
9
- this.endSelections = endSelections;
10
- this.type = 0 ;
11
- this.label = 'Move Cell';
12
- this.code = 'undoredo.notebooks.moveCell';
13
- }
14
- undo() {
15
- if (!this.editingDelegate.moveCell) {
16
- throw new Error('Notebook Move Cell not implemented for Undo/Redo');
17
- }
18
- this.editingDelegate.moveCell(this.toIndex, this.length, this.fromIndex, this.endSelections, this.beforedSelections);
19
- }
20
- redo() {
21
- if (!this.editingDelegate.moveCell) {
22
- throw new Error('Notebook Move Cell not implemented for Undo/Redo');
23
- }
24
- this.editingDelegate.moveCell(this.fromIndex, this.length, this.toIndex, this.beforedSelections, this.endSelections);
25
- }
26
- }
27
- class SpliceCellsEdit {
28
- constructor(resource, diffs, editingDelegate, beforeHandles, endHandles) {
29
- this.resource = resource;
30
- this.diffs = diffs;
31
- this.editingDelegate = editingDelegate;
32
- this.beforeHandles = beforeHandles;
33
- this.endHandles = endHandles;
34
- this.type = 0 ;
35
- this.label = 'Insert Cell';
36
- this.code = 'undoredo.notebooks.insertCell';
37
- }
38
- undo() {
39
- if (!this.editingDelegate.replaceCell) {
40
- throw new Error('Notebook Replace Cell not implemented for Undo/Redo');
41
- }
42
- this.diffs.forEach(diff => {
43
- this.editingDelegate.replaceCell(diff[0], diff[2].length, diff[1], this.beforeHandles);
44
- });
45
- }
46
- redo() {
47
- if (!this.editingDelegate.replaceCell) {
48
- throw new Error('Notebook Replace Cell not implemented for Undo/Redo');
49
- }
50
- this.diffs.reverse().forEach(diff => {
51
- this.editingDelegate.replaceCell(diff[0], diff[1].length, diff[2], this.endHandles);
52
- });
53
- }
54
- }
55
- class CellMetadataEdit {
56
- constructor(resource, index, oldMetadata, newMetadata, editingDelegate) {
57
- this.resource = resource;
58
- this.index = index;
59
- this.oldMetadata = oldMetadata;
60
- this.newMetadata = newMetadata;
61
- this.editingDelegate = editingDelegate;
62
- this.type = 0 ;
63
- this.label = 'Update Cell Metadata';
64
- this.code = 'undoredo.notebooks.updateCellMetadata';
65
- }
66
- undo() {
67
- if (!this.editingDelegate.updateCellMetadata) {
68
- return;
69
- }
70
- this.editingDelegate.updateCellMetadata(this.index, this.oldMetadata);
71
- }
72
- redo() {
73
- if (!this.editingDelegate.updateCellMetadata) {
74
- return;
75
- }
76
- this.editingDelegate.updateCellMetadata(this.index, this.newMetadata);
77
- }
78
- }
79
-
80
- export { CellMetadataEdit, MoveCellEdit, SpliceCellsEdit };