@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,267 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { $, addStandardDisposableListener, addDisposableListener, EventType, append } from 'vscode/vscode/vs/base/browser/dom';
3
- import { localize } from 'vscode/vscode/vs/nls';
4
- import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
5
- import { SideBySideDiffElementViewModel } from './diffElementViewModel.js';
6
- import { DiffSide } from './notebookDiffEditorBrowser.js';
7
- import { RenderOutputType } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
8
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
9
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
10
- import { mimetypeIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
11
- import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
12
- import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
13
- import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
14
-
15
- class OutputElement extends Disposable {
16
- constructor(_notebookEditor, _notebookTextModel, _notebookService, _quickInputService, _diffElementViewModel, _diffSide, _nestedCell, _outputContainer, output) {
17
- super();
18
- this._notebookEditor = _notebookEditor;
19
- this._notebookTextModel = _notebookTextModel;
20
- this._notebookService = _notebookService;
21
- this._quickInputService = _quickInputService;
22
- this._diffElementViewModel = _diffElementViewModel;
23
- this._diffSide = _diffSide;
24
- this._nestedCell = _nestedCell;
25
- this._outputContainer = _outputContainer;
26
- this.output = output;
27
- this.resizeListener = this._register(( (new DisposableStore())));
28
- }
29
- render(index, beforeElement) {
30
- const outputItemDiv = document.createElement('div');
31
- let result = undefined;
32
- const [mimeTypes, pick] = this.output.resolveMimeTypes(this._notebookTextModel, undefined);
33
- const pickedMimeTypeRenderer = mimeTypes[pick];
34
- if (mimeTypes.length > 1) {
35
- outputItemDiv.style.position = 'relative';
36
- const mimeTypePicker = $('.multi-mimetype-output');
37
- mimeTypePicker.classList.add(...ThemeIcon.asClassNameArray(mimetypeIcon));
38
- mimeTypePicker.tabIndex = 0;
39
- mimeTypePicker.title = ( localize(
40
- 11533,
41
- "Choose a different output mimetype, available mimetypes: {0}",
42
- ( (mimeTypes.map(mimeType => mimeType.mimeType))).join(', ')
43
- ));
44
- outputItemDiv.appendChild(mimeTypePicker);
45
- this.resizeListener.add(addStandardDisposableListener(mimeTypePicker, 'mousedown', async (e) => {
46
- if (e.leftButton) {
47
- e.preventDefault();
48
- e.stopPropagation();
49
- await this.pickActiveMimeTypeRenderer(this._notebookTextModel, this.output);
50
- }
51
- }));
52
- this.resizeListener.add((addDisposableListener(mimeTypePicker, EventType.KEY_DOWN, async (e) => {
53
- const event = ( (new StandardKeyboardEvent(e)));
54
- if ((event.equals(KeyCode.Enter) || event.equals(KeyCode.Space))) {
55
- e.preventDefault();
56
- e.stopPropagation();
57
- await this.pickActiveMimeTypeRenderer(this._notebookTextModel, this.output);
58
- }
59
- })));
60
- }
61
- const innerContainer = $('.output-inner-container');
62
- append(outputItemDiv, innerContainer);
63
- if (mimeTypes.length !== 0) {
64
- const renderer = this._notebookService.getRendererInfo(pickedMimeTypeRenderer.rendererId);
65
- result = renderer
66
- ? { type: RenderOutputType.Extension, renderer, source: this.output, mimeType: pickedMimeTypeRenderer.mimeType }
67
- : this._renderMissingRenderer(this.output, pickedMimeTypeRenderer.mimeType);
68
- this.output.pickedMimeType = pickedMimeTypeRenderer;
69
- }
70
- this.domNode = outputItemDiv;
71
- this.renderResult = result;
72
- if (!result) {
73
- return;
74
- }
75
- if (beforeElement) {
76
- this._outputContainer.insertBefore(outputItemDiv, beforeElement);
77
- }
78
- else {
79
- this._outputContainer.appendChild(outputItemDiv);
80
- }
81
- this._notebookEditor.createOutput(this._diffElementViewModel, this._nestedCell, result, () => this.getOutputOffsetInCell(index), this._diffElementViewModel instanceof SideBySideDiffElementViewModel
82
- ? this._diffSide
83
- : this._diffElementViewModel.type === 'insert' ? DiffSide.Modified : DiffSide.Original);
84
- }
85
- _renderMissingRenderer(viewModel, preferredMimeType) {
86
- if (!viewModel.model.outputs.length) {
87
- return this._renderMessage(viewModel, ( localize(11534, "Cell has no output")));
88
- }
89
- if (!preferredMimeType) {
90
- const mimeTypes = ( (viewModel.model.outputs.map(op => op.mime)));
91
- const mimeTypesMessage = mimeTypes.join(', ');
92
- return this._renderMessage(viewModel, ( localize(
93
- 11535,
94
- "No renderer could be found for output. It has the following mimetypes: {0}",
95
- mimeTypesMessage
96
- )));
97
- }
98
- return this._renderSearchForMimetype(viewModel, preferredMimeType);
99
- }
100
- _renderSearchForMimetype(viewModel, mimeType) {
101
- const query = `@tag:notebookRenderer ${mimeType}`;
102
- const p = $('p', undefined, `No renderer could be found for mimetype "${mimeType}", but one might be available on the Marketplace.`);
103
- const a = $('a', { href: `command:workbench.extensions.search?%22${query}%22`, class: 'monaco-button monaco-text-button', tabindex: 0, role: 'button', style: 'padding: 8px; text-decoration: none; color: rgb(255, 255, 255); background-color: rgb(14, 99, 156); max-width: 200px;' }, `Search Marketplace`);
104
- return {
105
- type: RenderOutputType.Html,
106
- source: viewModel,
107
- htmlContent: p.outerHTML + a.outerHTML,
108
- };
109
- }
110
- _renderMessage(viewModel, message) {
111
- const el = $('p', undefined, message);
112
- return { type: RenderOutputType.Html, source: viewModel, htmlContent: el.outerHTML };
113
- }
114
- async pickActiveMimeTypeRenderer(notebookTextModel, viewModel) {
115
- const [mimeTypes, currIndex] = viewModel.resolveMimeTypes(notebookTextModel, undefined);
116
- const items = ( (mimeTypes.filter(mimeType => mimeType.isTrusted).map((mimeType, index) => ({
117
- label: mimeType.mimeType,
118
- id: mimeType.mimeType,
119
- index: index,
120
- picked: index === currIndex,
121
- detail: this.generateRendererInfo(mimeType.rendererId),
122
- description: index === currIndex ? ( localize(11536, "Currently Active")) : undefined
123
- }))));
124
- const picker = this._quickInputService.createQuickPick();
125
- picker.items = items;
126
- picker.activeItems = items.filter(item => !!item.picked);
127
- picker.placeholder = items.length !== mimeTypes.length
128
- ? ( localize(
129
- 11537,
130
- "Select mimetype to render for current output. Rich mimetypes are available only when the notebook is trusted"
131
- ))
132
- : ( localize(11538, "Select mimetype to render for current output"));
133
- const pick = await ( (new Promise(resolve => {
134
- picker.onDidAccept(() => {
135
- resolve(picker.selectedItems.length === 1 ? picker.selectedItems[0].index : undefined);
136
- picker.dispose();
137
- });
138
- picker.show();
139
- })));
140
- if (pick === undefined) {
141
- return;
142
- }
143
- if (pick !== currIndex) {
144
- const index = this._nestedCell.outputsViewModels.indexOf(viewModel);
145
- const nextElement = this.domNode.nextElementSibling;
146
- this.resizeListener.clear();
147
- const element = this.domNode;
148
- if (element) {
149
- element.remove();
150
- this._notebookEditor.removeInset(this._diffElementViewModel, this._nestedCell, viewModel, this._diffSide);
151
- }
152
- viewModel.pickedMimeType = mimeTypes[pick];
153
- this.render(index, nextElement);
154
- }
155
- }
156
- generateRendererInfo(renderId) {
157
- const renderInfo = this._notebookService.getRendererInfo(renderId);
158
- if (renderInfo) {
159
- const displayName = renderInfo.displayName !== '' ? renderInfo.displayName : renderInfo.id;
160
- return `${displayName} (${renderInfo.extensionId.value})`;
161
- }
162
- return ( localize(11539, "built-in"));
163
- }
164
- getCellOutputCurrentIndex() {
165
- return this._diffElementViewModel.getNestedCellViewModel(this._diffSide).outputs.indexOf(this.output.model);
166
- }
167
- updateHeight(index, height) {
168
- this._diffElementViewModel.updateOutputHeight(this._diffSide, index, height);
169
- }
170
- getOutputOffsetInContainer(index) {
171
- return this._diffElementViewModel.getOutputOffsetInContainer(this._diffSide, index);
172
- }
173
- getOutputOffsetInCell(index) {
174
- return this._diffElementViewModel.getOutputOffsetInCell(this._diffSide, index);
175
- }
176
- }
177
- let OutputContainer = class OutputContainer extends Disposable {
178
- constructor(_editor, _notebookTextModel, _diffElementViewModel, _nestedCellViewModel, _diffSide, _outputContainer, _notebookService, _quickInputService) {
179
- super();
180
- this._editor = _editor;
181
- this._notebookTextModel = _notebookTextModel;
182
- this._diffElementViewModel = _diffElementViewModel;
183
- this._nestedCellViewModel = _nestedCellViewModel;
184
- this._diffSide = _diffSide;
185
- this._outputContainer = _outputContainer;
186
- this._notebookService = _notebookService;
187
- this._quickInputService = _quickInputService;
188
- this._outputEntries = ( (new Map()));
189
- this._register(this._diffElementViewModel.onDidLayoutChange(() => {
190
- this._outputEntries.forEach((value, key) => {
191
- const index = _nestedCellViewModel.outputs.indexOf(key.model);
192
- if (index >= 0) {
193
- const top = this._diffElementViewModel.getOutputOffsetInContainer(this._diffSide, index);
194
- value.domNode.style.top = `${top}px`;
195
- }
196
- });
197
- }));
198
- this._register(this._nestedCellViewModel.textModel.onDidChangeOutputs(splice => {
199
- this._updateOutputs(splice);
200
- }));
201
- }
202
- _updateOutputs(splice) {
203
- const removedKeys = [];
204
- this._outputEntries.forEach((value, key) => {
205
- if (this._nestedCellViewModel.outputsViewModels.indexOf(key) < 0) {
206
- removedKeys.push(key);
207
- value.domNode.remove();
208
- this._editor.removeInset(this._diffElementViewModel, this._nestedCellViewModel, key, this._diffSide);
209
- }
210
- });
211
- removedKeys.forEach(key => {
212
- this._outputEntries.get(key)?.dispose();
213
- this._outputEntries.delete(key);
214
- });
215
- let prevElement = undefined;
216
- const outputsToRender = this._nestedCellViewModel.outputsViewModels;
217
- outputsToRender.reverse().forEach(output => {
218
- if (( (this._outputEntries.has(output)))) {
219
- prevElement = this._outputEntries.get(output).domNode;
220
- return;
221
- }
222
- const currIndex = this._nestedCellViewModel.outputsViewModels.indexOf(output);
223
- this._renderOutput(output, currIndex, prevElement);
224
- prevElement = this._outputEntries.get(output)?.domNode;
225
- });
226
- }
227
- render() {
228
- for (let index = 0; index < this._nestedCellViewModel.outputsViewModels.length; index++) {
229
- const currOutput = this._nestedCellViewModel.outputsViewModels[index];
230
- this._renderOutput(currOutput, index, undefined);
231
- }
232
- }
233
- showOutputs() {
234
- for (let index = 0; index < this._nestedCellViewModel.outputsViewModels.length; index++) {
235
- const currOutput = this._nestedCellViewModel.outputsViewModels[index];
236
- this._editor.showInset(this._diffElementViewModel, currOutput.cellViewModel, currOutput, this._diffSide);
237
- }
238
- }
239
- hideOutputs() {
240
- this._outputEntries.forEach((outputElement, cellOutputViewModel) => {
241
- this._editor.hideInset(this._diffElementViewModel, this._nestedCellViewModel, cellOutputViewModel);
242
- });
243
- }
244
- _renderOutput(currOutput, index, beforeElement) {
245
- if (!( (this._outputEntries.has(currOutput)))) {
246
- this._outputEntries.set(currOutput, ( (new OutputElement(
247
- this._editor,
248
- this._notebookTextModel,
249
- this._notebookService,
250
- this._quickInputService,
251
- this._diffElementViewModel,
252
- this._diffSide,
253
- this._nestedCellViewModel,
254
- this._outputContainer,
255
- currOutput
256
- ))));
257
- }
258
- const renderElement = this._outputEntries.get(currOutput);
259
- renderElement.render(index, beforeElement);
260
- }
261
- };
262
- OutputContainer = ( (__decorate([
263
- ( (__param(6, INotebookService))),
264
- ( (__param(7, IQuickInputService)))
265
- ], OutputContainer)));
266
-
267
- export { OutputContainer, OutputElement };