@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,903 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { localize } from 'vscode/vscode/vs/nls';
3
- import { $ as $$1, append, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, scheduleAtNextAnimationFrame } from 'vscode/vscode/vs/base/browser/dom';
4
- import { findLastIdx } from 'vscode/vscode/vs/base/common/arraysFind';
5
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
6
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
7
- import { registerThemingParticipant } from 'vscode/vscode/vs/platform/theme/common/themeService';
8
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
9
- import { EditorPaneSelectionCompareResult, EditorPaneSelectionChangeReason } from 'vscode/vscode/vs/workbench/common/editor';
10
- import { getDefaultNotebookCreationOptions } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget';
11
- import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
12
- import { SideBySideDiffElementViewModel, SingleSideDiffElementViewModel } from './diffElementViewModel.js';
13
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
14
- import { CellDiffSingleSideRenderer, CellDiffSideBySideRenderer, NotebookTextDiffList, NotebookCellTextDiffListDelegate } from './notebookDiffList.js';
15
- import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
16
- import 'vscode/vscode/vs/platform/theme/common/colorUtils';
17
- import { foreground, focusBorder } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
18
- import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
19
- import { editorBackground, diffDiagonalFill } from 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
20
- import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
21
- import 'vscode/vscode/vs/platform/theme/common/colors/listColors';
22
- import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
23
- import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
24
- import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
25
- import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
26
- import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
27
- import { INotebookEditorWorkerService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service';
28
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
29
- import { BareFontInfo } from 'vscode/vscode/vs/editor/common/config/fontInfo';
30
- import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
31
- import { DiffSide, DIFF_CELL_MARGIN } from './notebookDiffEditorBrowser.js';
32
- import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
33
- import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
34
- import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
35
- import { NOTEBOOK_DIFF_EDITOR_ID, NotebookSetting, CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
36
- import { SequencerByKey } from 'vscode/vscode/vs/base/common/async';
37
- import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
38
- import { DiffNestedCellViewModel } from './diffNestedCellViewModel.js';
39
- import { BackLayerWebView } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView';
40
- import { NotebookDiffEditorEventDispatcher, NotebookDiffLayoutChangedEvent } from './eventDispatcher.js';
41
- import { FontMeasurements } from 'vscode/vscode/vs/editor/browser/config/fontMeasurements';
42
- import { NotebookOptions } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookOptions';
43
- import { cellIndexesToRanges, cellRangesToIndexes } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRange';
44
- import { NotebookDiffOverviewRuler } from './notebookDiffOverviewRuler.js';
45
- import { registerZIndex, ZIndex } from 'vscode/vscode/vs/platform/layout/browser/zIndexRegistry';
46
-
47
- var NotebookTextDiffEditor_1;
48
- const $ = $$1;
49
- class NotebookDiffEditorSelection {
50
- constructor(selections) {
51
- this.selections = selections;
52
- }
53
- compare(other) {
54
- if (!(other instanceof NotebookDiffEditorSelection)) {
55
- return EditorPaneSelectionCompareResult.DIFFERENT;
56
- }
57
- if (this.selections.length !== other.selections.length) {
58
- return EditorPaneSelectionCompareResult.DIFFERENT;
59
- }
60
- for (let i = 0; i < this.selections.length; i++) {
61
- if (this.selections[i] !== other.selections[i]) {
62
- return EditorPaneSelectionCompareResult.DIFFERENT;
63
- }
64
- }
65
- return EditorPaneSelectionCompareResult.IDENTICAL;
66
- }
67
- restore(options) {
68
- const notebookOptions = {
69
- cellSelections: cellIndexesToRanges(this.selections)
70
- };
71
- Object.assign(notebookOptions, options);
72
- return notebookOptions;
73
- }
74
- }
75
- let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
76
- static { NotebookTextDiffEditor_1 = this; }
77
- static { this.ENTIRE_DIFF_OVERVIEW_WIDTH = 30; }
78
- static { this.ID = NOTEBOOK_DIFF_EDITOR_ID; }
79
- get textModel() {
80
- return this._model?.modified.notebook;
81
- }
82
- get notebookOptions() {
83
- return this._notebookOptions;
84
- }
85
- get isDisposed() {
86
- return this._isDisposed;
87
- }
88
- constructor(group, instantiationService, themeService, contextKeyService, notebookEditorWorkerService, configurationService, telemetryService, storageService) {
89
- super(NotebookTextDiffEditor_1.ID, group, telemetryService, themeService, storageService);
90
- this.instantiationService = instantiationService;
91
- this.contextKeyService = contextKeyService;
92
- this.notebookEditorWorkerService = notebookEditorWorkerService;
93
- this.configurationService = configurationService;
94
- this.creationOptions = getDefaultNotebookCreationOptions();
95
- this._dimension = null;
96
- this._diffElementViewModels = [];
97
- this._modifiedWebview = null;
98
- this._originalWebview = null;
99
- this._webviewTransparentCover = null;
100
- this._onMouseUp = this._register(( (new Emitter())));
101
- this.onMouseUp = this._onMouseUp.event;
102
- this._onDidScroll = this._register(( (new Emitter())));
103
- this.onDidScroll = this._onDidScroll.event;
104
- this.onDidChangeScroll = this._onDidScroll.event;
105
- this._model = null;
106
- this._modifiedResourceDisposableStore = this._register(( (new DisposableStore())));
107
- this._insetModifyQueueByOutputId = ( (new SequencerByKey()));
108
- this._onDidDynamicOutputRendered = this._register(( (new Emitter())));
109
- this.onDidDynamicOutputRendered = this._onDidDynamicOutputRendered.event;
110
- this._localStore = this._register(( (new DisposableStore())));
111
- this._onDidChangeSelection = this._register(( (new Emitter())));
112
- this.onDidChangeSelection = this._onDidChangeSelection.event;
113
- this._isDisposed = false;
114
- this.pendingLayouts = ( (new WeakMap()));
115
- this._notebookOptions = instantiationService.createInstance(NotebookOptions, this.window, false, undefined);
116
- this._register(this._notebookOptions);
117
- this._revealFirst = true;
118
- }
119
- get fontInfo() {
120
- if (!this._fontInfo) {
121
- this._fontInfo = this.createFontInfo();
122
- }
123
- return this._fontInfo;
124
- }
125
- createFontInfo() {
126
- const editorOptions = this.configurationService.getValue('editor');
127
- return FontMeasurements.readFontInfo(this.window, BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.getInstance(this.window).value));
128
- }
129
- isOverviewRulerEnabled() {
130
- return this.configurationService.getValue(NotebookSetting.diffOverviewRuler) ?? false;
131
- }
132
- getSelection() {
133
- const selections = this._list.getFocus();
134
- return (
135
- (new NotebookDiffEditorSelection(selections))
136
- );
137
- }
138
- toggleNotebookCellSelection(cell) {
139
- }
140
- updatePerformanceMetadata(cellId, executionId, duration, rendererId) {
141
- }
142
- async focusNotebookCell(cell, focus) {
143
- }
144
- async focusNextNotebookCell(cell, focus) {
145
- }
146
- didFocusOutputInputChange(inputFocused) {
147
- }
148
- getScrollTop() {
149
- return this._list?.scrollTop ?? 0;
150
- }
151
- getScrollHeight() {
152
- return this._list?.scrollHeight ?? 0;
153
- }
154
- getScrollPosition() {
155
- return {
156
- scrollTop: this.getScrollTop(),
157
- scrollLeft: this._list?.scrollLeft ?? 0
158
- };
159
- }
160
- setScrollPosition(scrollPosition) {
161
- if (!this._list) {
162
- return;
163
- }
164
- this._list.scrollTop = scrollPosition.scrollTop;
165
- if (scrollPosition.scrollLeft !== undefined) {
166
- this._list.scrollLeft = scrollPosition.scrollLeft;
167
- }
168
- }
169
- delegateVerticalScrollbarPointerDown(browserEvent) {
170
- this._list?.delegateVerticalScrollbarPointerDown(browserEvent);
171
- }
172
- updateOutputHeight(cellInfo, output, outputHeight, isInit) {
173
- const diffElement = cellInfo.diffElement;
174
- const cell = this.getCellByInfo(cellInfo);
175
- const outputIndex = cell.outputsViewModels.indexOf(output);
176
- if (diffElement instanceof SideBySideDiffElementViewModel) {
177
- const info = CellUri.parse(cellInfo.cellUri);
178
- if (!info) {
179
- return;
180
- }
181
- diffElement.updateOutputHeight(( (info.notebook.toString())) === this._model?.original.resource.toString() ? DiffSide.Original : DiffSide.Modified, outputIndex, outputHeight);
182
- }
183
- else {
184
- diffElement.updateOutputHeight(diffElement.type === 'insert' ? DiffSide.Modified : DiffSide.Original, outputIndex, outputHeight);
185
- }
186
- if (isInit) {
187
- this._onDidDynamicOutputRendered.fire({ cell, output });
188
- }
189
- }
190
- setMarkupCellEditState(cellId, editState) {
191
- }
192
- didStartDragMarkupCell(cellId, event) {
193
- }
194
- didDragMarkupCell(cellId, event) {
195
- }
196
- didEndDragMarkupCell(cellId) {
197
- }
198
- didDropMarkupCell(cellId) {
199
- }
200
- didResizeOutput(cellId) {
201
- }
202
- createEditor(parent) {
203
- this._rootElement = append(parent, $$1('.notebook-text-diff-editor'));
204
- this._overflowContainer = document.createElement('div');
205
- this._overflowContainer.classList.add('notebook-overflow-widget-container', 'monaco-editor');
206
- append(parent, this._overflowContainer);
207
- const renderers = [
208
- this.instantiationService.createInstance(CellDiffSingleSideRenderer, this),
209
- this.instantiationService.createInstance(CellDiffSideBySideRenderer, this),
210
- ];
211
- this._listViewContainer = append(this._rootElement, $$1('.notebook-diff-list-view'));
212
- this._list = this.instantiationService.createInstance(NotebookTextDiffList, 'NotebookTextDiff', this._listViewContainer, this.instantiationService.createInstance(NotebookCellTextDiffListDelegate, this.window), renderers, this.contextKeyService, {
213
- setRowLineHeight: false,
214
- setRowHeight: false,
215
- supportDynamicHeights: true,
216
- horizontalScrolling: false,
217
- keyboardSupport: false,
218
- mouseSupport: true,
219
- multipleSelectionSupport: false,
220
- typeNavigationEnabled: true,
221
- paddingBottom: 0,
222
- styleController: (_suffix) => { return this._list; },
223
- overrideStyles: {
224
- listBackground: editorBackground,
225
- listActiveSelectionBackground: editorBackground,
226
- listActiveSelectionForeground: foreground,
227
- listFocusAndSelectionBackground: editorBackground,
228
- listFocusAndSelectionForeground: foreground,
229
- listFocusBackground: editorBackground,
230
- listFocusForeground: foreground,
231
- listHoverForeground: foreground,
232
- listHoverBackground: editorBackground,
233
- listHoverOutline: focusBorder,
234
- listFocusOutline: focusBorder,
235
- listInactiveSelectionBackground: editorBackground,
236
- listInactiveSelectionForeground: foreground,
237
- listInactiveFocusBackground: editorBackground,
238
- listInactiveFocusOutline: editorBackground,
239
- },
240
- accessibilityProvider: {
241
- getAriaLabel() { return null; },
242
- getWidgetAriaLabel() {
243
- return ( localize(8086, "Notebook Text Diff"));
244
- }
245
- },
246
- });
247
- this._register(this._list);
248
- this._register(this._list.onMouseUp(e => {
249
- if (e.element) {
250
- this._onMouseUp.fire({ event: e.browserEvent, target: e.element });
251
- }
252
- }));
253
- this._register(this._list.onDidScroll(() => {
254
- this._onDidScroll.fire();
255
- }));
256
- this._register(this._list.onDidChangeFocus(() => this._onDidChangeSelection.fire({ reason: EditorPaneSelectionChangeReason.USER })));
257
- this._overviewRulerContainer = document.createElement('div');
258
- this._overviewRulerContainer.classList.add('notebook-overview-ruler-container');
259
- this._rootElement.appendChild(this._overviewRulerContainer);
260
- this._registerOverviewRuler();
261
- this._webviewTransparentCover = append(this._list.rowsContainer, $('.webview-cover'));
262
- this._webviewTransparentCover.style.display = 'none';
263
- this._register(addStandardDisposableGenericMouseDownListener(this._overflowContainer, (e) => {
264
- if (e.target.classList.contains('slider') && this._webviewTransparentCover) {
265
- this._webviewTransparentCover.style.display = 'block';
266
- }
267
- }));
268
- this._register(addStandardDisposableGenericMouseUpListener(this._overflowContainer, () => {
269
- if (this._webviewTransparentCover) {
270
- this._webviewTransparentCover.style.display = 'none';
271
- }
272
- }));
273
- this._register(this._list.onDidScroll(e => {
274
- this._webviewTransparentCover.style.top = `${e.scrollTop}px`;
275
- }));
276
- }
277
- _registerOverviewRuler() {
278
- this._overviewRuler = this._register(this.instantiationService.createInstance(NotebookDiffOverviewRuler, this, NotebookTextDiffEditor_1.ENTIRE_DIFF_OVERVIEW_WIDTH, this._overviewRulerContainer));
279
- }
280
- _updateOutputsOffsetsInWebview(scrollTop, scrollHeight, activeWebview, getActiveNestedCell, diffSide) {
281
- activeWebview.element.style.height = `${scrollHeight}px`;
282
- if (activeWebview.insetMapping) {
283
- const updateItems = [];
284
- const removedItems = [];
285
- activeWebview.insetMapping.forEach((value, key) => {
286
- const cell = getActiveNestedCell(value.cellInfo.diffElement);
287
- if (!cell) {
288
- return;
289
- }
290
- const viewIndex = this._list.indexOf(value.cellInfo.diffElement);
291
- if (viewIndex === undefined) {
292
- return;
293
- }
294
- if (cell.outputsViewModels.indexOf(key) < 0) {
295
- removedItems.push(key);
296
- }
297
- else {
298
- const cellTop = this._list.getCellViewScrollTop(value.cellInfo.diffElement);
299
- const outputIndex = cell.outputsViewModels.indexOf(key);
300
- const outputOffset = value.cellInfo.diffElement.getOutputOffsetInCell(diffSide, outputIndex);
301
- updateItems.push({
302
- cell,
303
- output: key,
304
- cellTop: cellTop,
305
- outputOffset: outputOffset,
306
- forceDisplay: false
307
- });
308
- }
309
- });
310
- activeWebview.removeInsets(removedItems);
311
- if (updateItems.length) {
312
- activeWebview.updateScrollTops(updateItems, []);
313
- }
314
- }
315
- }
316
- async setInput(input, options, context, token) {
317
- await super.setInput(input, options, context, token);
318
- const model = await input.resolve();
319
- if (this._model !== model) {
320
- this._detachModel();
321
- this._model = model;
322
- this._attachModel();
323
- }
324
- this._model = model;
325
- if (this._model === null) {
326
- return;
327
- }
328
- this._revealFirst = true;
329
- this._modifiedResourceDisposableStore.clear();
330
- this._layoutCancellationTokenSource = ( (new CancellationTokenSource()));
331
- this._modifiedResourceDisposableStore.add(Event.any(this._model.original.notebook.onDidChangeContent, this._model.modified.notebook.onDidChangeContent)(e => {
332
- if (this._model !== null) {
333
- this._layoutCancellationTokenSource?.dispose();
334
- this._layoutCancellationTokenSource = ( (new CancellationTokenSource()));
335
- this.updateLayout(this._layoutCancellationTokenSource.token);
336
- }
337
- }));
338
- await this._createOriginalWebview(generateUuid(), this._model.original.viewType, this._model.original.resource);
339
- if (this._originalWebview) {
340
- this._modifiedResourceDisposableStore.add(this._originalWebview);
341
- }
342
- await this._createModifiedWebview(generateUuid(), this._model.modified.viewType, this._model.modified.resource);
343
- if (this._modifiedWebview) {
344
- this._modifiedResourceDisposableStore.add(this._modifiedWebview);
345
- }
346
- await this.updateLayout(this._layoutCancellationTokenSource.token, options?.cellSelections ? cellRangesToIndexes(options.cellSelections) : undefined);
347
- }
348
- _detachModel() {
349
- this._localStore.clear();
350
- this._originalWebview?.dispose();
351
- this._originalWebview?.element.remove();
352
- this._originalWebview = null;
353
- this._modifiedWebview?.dispose();
354
- this._modifiedWebview?.element.remove();
355
- this._modifiedWebview = null;
356
- this._modifiedResourceDisposableStore.clear();
357
- this._list.clear();
358
- }
359
- _attachModel() {
360
- this._eventDispatcher = ( (new NotebookDiffEditorEventDispatcher()));
361
- const updateInsets = () => {
362
- scheduleAtNextAnimationFrame(this.window, () => {
363
- if (this._isDisposed) {
364
- return;
365
- }
366
- if (this._modifiedWebview) {
367
- this._updateOutputsOffsetsInWebview(this._list.scrollTop, this._list.scrollHeight, this._modifiedWebview, (diffElement) => {
368
- return diffElement.modified;
369
- }, DiffSide.Modified);
370
- }
371
- if (this._originalWebview) {
372
- this._updateOutputsOffsetsInWebview(this._list.scrollTop, this._list.scrollHeight, this._originalWebview, (diffElement) => {
373
- return diffElement.original;
374
- }, DiffSide.Original);
375
- }
376
- });
377
- };
378
- this._localStore.add(this._list.onDidChangeContentHeight(() => {
379
- updateInsets();
380
- }));
381
- this._localStore.add(this._eventDispatcher.onDidChangeCellLayout(() => {
382
- updateInsets();
383
- }));
384
- }
385
- async _createModifiedWebview(id, viewType, resource) {
386
- this._modifiedWebview?.dispose();
387
- this._modifiedWebview = this.instantiationService.createInstance(BackLayerWebView, this, id, viewType, resource, {
388
- ...this._notebookOptions.computeDiffWebviewOptions(),
389
- fontFamily: this._generateFontFamily()
390
- }, undefined);
391
- this._list.rowsContainer.insertAdjacentElement('afterbegin', this._modifiedWebview.element);
392
- this._modifiedWebview.createWebview(this.window);
393
- this._modifiedWebview.element.style.width = `calc(50% - 16px)`;
394
- this._modifiedWebview.element.style.left = `calc(50%)`;
395
- }
396
- _generateFontFamily() {
397
- return this.fontInfo.fontFamily ?? `"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace`;
398
- }
399
- async _createOriginalWebview(id, viewType, resource) {
400
- this._originalWebview?.dispose();
401
- this._originalWebview = this.instantiationService.createInstance(BackLayerWebView, this, id, viewType, resource, {
402
- ...this._notebookOptions.computeDiffWebviewOptions(),
403
- fontFamily: this._generateFontFamily()
404
- }, undefined);
405
- this._list.rowsContainer.insertAdjacentElement('afterbegin', this._originalWebview.element);
406
- this._originalWebview.createWebview(this.window);
407
- this._originalWebview.element.style.width = `calc(50% - 16px)`;
408
- this._originalWebview.element.style.left = `16px`;
409
- }
410
- setOptions(options) {
411
- const selections = options?.cellSelections ? cellRangesToIndexes(options.cellSelections) : undefined;
412
- if (selections) {
413
- this._list.setFocus(selections);
414
- }
415
- }
416
- async updateLayout(token, selections) {
417
- if (!this._model) {
418
- return;
419
- }
420
- const diffResult = await this.notebookEditorWorkerService.computeDiff(this._model.original.resource, this._model.modified.resource);
421
- if (token.isCancellationRequested) {
422
- return;
423
- }
424
- NotebookTextDiffEditor_1.prettyChanges(this._model, diffResult.cellsDiff);
425
- const { viewModels, firstChangeIndex } = NotebookTextDiffEditor_1.computeDiff(this.instantiationService, this.configurationService, this._model, this._eventDispatcher, diffResult, this.fontInfo);
426
- const isSame = this._isViewModelTheSame(viewModels);
427
- if (!isSame) {
428
- this._originalWebview?.removeInsets([...this._originalWebview?.insetMapping.keys()]);
429
- this._modifiedWebview?.removeInsets([...this._modifiedWebview?.insetMapping.keys()]);
430
- this._setViewModel(viewModels);
431
- }
432
- if (this._revealFirst && firstChangeIndex !== -1 && firstChangeIndex < this._list.length) {
433
- this._revealFirst = false;
434
- this._list.setFocus([firstChangeIndex]);
435
- this._list.reveal(firstChangeIndex, 0.3);
436
- }
437
- if (selections) {
438
- this._list.setFocus(selections);
439
- }
440
- }
441
- _isViewModelTheSame(viewModels) {
442
- let isSame = true;
443
- if (this._diffElementViewModels.length === viewModels.length) {
444
- for (let i = 0; i < viewModels.length; i++) {
445
- const a = this._diffElementViewModels[i];
446
- const b = viewModels[i];
447
- if (a.original?.textModel.getHashValue() !== b.original?.textModel.getHashValue()
448
- || a.modified?.textModel.getHashValue() !== b.modified?.textModel.getHashValue()) {
449
- isSame = false;
450
- break;
451
- }
452
- }
453
- }
454
- else {
455
- isSame = false;
456
- }
457
- return isSame;
458
- }
459
- _setViewModel(viewModels) {
460
- this._diffElementViewModels = viewModels;
461
- this._list.splice(0, this._list.length, this._diffElementViewModels);
462
- if (this.isOverviewRulerEnabled()) {
463
- this._overviewRuler.updateViewModels(this._diffElementViewModels, this._eventDispatcher);
464
- }
465
- }
466
- static prettyChanges(model, diffResult) {
467
- const changes = diffResult.changes;
468
- for (let i = 0; i < diffResult.changes.length - 1; i++) {
469
- const curr = changes[i];
470
- const next = changes[i + 1];
471
- const x = curr.originalStart;
472
- const y = curr.modifiedStart;
473
- if (curr.originalLength === 1
474
- && curr.modifiedLength === 0
475
- && next.originalStart === x + 2
476
- && next.originalLength === 0
477
- && next.modifiedStart === y + 1
478
- && next.modifiedLength === 1
479
- && model.original.notebook.cells[x].getHashValue() === model.modified.notebook.cells[y + 1].getHashValue()
480
- && model.original.notebook.cells[x + 1].getHashValue() === model.modified.notebook.cells[y].getHashValue()) {
481
- curr.originalStart = x;
482
- curr.originalLength = 0;
483
- curr.modifiedStart = y;
484
- curr.modifiedLength = 1;
485
- next.originalStart = x + 1;
486
- next.originalLength = 1;
487
- next.modifiedStart = y + 2;
488
- next.modifiedLength = 0;
489
- i++;
490
- }
491
- }
492
- }
493
- static computeDiff(instantiationService, configurationService, model, eventDispatcher, diffResult, fontInfo) {
494
- const cellChanges = diffResult.cellsDiff.changes;
495
- const diffElementViewModels = [];
496
- const originalModel = model.original.notebook;
497
- const modifiedModel = model.modified.notebook;
498
- let originalCellIndex = 0;
499
- let modifiedCellIndex = 0;
500
- let firstChangeIndex = -1;
501
- const initData = {
502
- metadataStatusHeight: configurationService.getValue('notebook.diff.ignoreMetadata') ? 0 : 25,
503
- outputStatusHeight: configurationService.getValue('notebook.diff.ignoreOutputs') || !!(modifiedModel.transientOptions.transientOutputs) ? 0 : 25,
504
- fontInfo
505
- };
506
- for (let i = 0; i < cellChanges.length; i++) {
507
- const change = cellChanges[i];
508
- for (let j = 0; j < change.originalStart - originalCellIndex; j++) {
509
- const originalCell = originalModel.cells[originalCellIndex + j];
510
- const modifiedCell = modifiedModel.cells[modifiedCellIndex + j];
511
- if (originalCell.getHashValue() === modifiedCell.getHashValue()) {
512
- diffElementViewModels.push(( (new SideBySideDiffElementViewModel(
513
- model.modified.notebook,
514
- model.original.notebook,
515
- instantiationService.createInstance(DiffNestedCellViewModel, originalCell),
516
- instantiationService.createInstance(DiffNestedCellViewModel, modifiedCell),
517
- 'unchanged',
518
- eventDispatcher,
519
- initData
520
- ))));
521
- }
522
- else {
523
- if (firstChangeIndex === -1) {
524
- firstChangeIndex = diffElementViewModels.length;
525
- }
526
- diffElementViewModels.push(( (new SideBySideDiffElementViewModel(
527
- model.modified.notebook,
528
- model.original.notebook,
529
- instantiationService.createInstance(DiffNestedCellViewModel, originalCell),
530
- instantiationService.createInstance(DiffNestedCellViewModel, modifiedCell),
531
- 'modified',
532
- eventDispatcher,
533
- initData
534
- ))));
535
- }
536
- }
537
- const modifiedLCS = NotebookTextDiffEditor_1.computeModifiedLCS(instantiationService, change, originalModel, modifiedModel, eventDispatcher, initData);
538
- if (modifiedLCS.length && firstChangeIndex === -1) {
539
- firstChangeIndex = diffElementViewModels.length;
540
- }
541
- diffElementViewModels.push(...modifiedLCS);
542
- originalCellIndex = change.originalStart + change.originalLength;
543
- modifiedCellIndex = change.modifiedStart + change.modifiedLength;
544
- }
545
- for (let i = originalCellIndex; i < originalModel.cells.length; i++) {
546
- diffElementViewModels.push(( (new SideBySideDiffElementViewModel(
547
- model.modified.notebook,
548
- model.original.notebook,
549
- instantiationService.createInstance(DiffNestedCellViewModel, originalModel.cells[i]),
550
- instantiationService.createInstance(DiffNestedCellViewModel, modifiedModel.cells[i - originalCellIndex + modifiedCellIndex]),
551
- 'unchanged',
552
- eventDispatcher,
553
- initData
554
- ))));
555
- }
556
- return {
557
- viewModels: diffElementViewModels,
558
- firstChangeIndex
559
- };
560
- }
561
- static computeModifiedLCS(instantiationService, change, originalModel, modifiedModel, eventDispatcher, initData) {
562
- const result = [];
563
- const modifiedLen = Math.min(change.originalLength, change.modifiedLength);
564
- for (let j = 0; j < modifiedLen; j++) {
565
- const isTheSame = originalModel.cells[change.originalStart + j].equal(modifiedModel.cells[change.modifiedStart + j]);
566
- result.push(( (new SideBySideDiffElementViewModel(
567
- modifiedModel,
568
- originalModel,
569
- instantiationService.createInstance(DiffNestedCellViewModel, originalModel.cells[change.originalStart + j]),
570
- instantiationService.createInstance(DiffNestedCellViewModel, modifiedModel.cells[change.modifiedStart + j]),
571
- isTheSame ? 'unchanged' : 'modified',
572
- eventDispatcher,
573
- initData
574
- ))));
575
- }
576
- for (let j = modifiedLen; j < change.originalLength; j++) {
577
- result.push(( (new SingleSideDiffElementViewModel(
578
- originalModel,
579
- modifiedModel,
580
- instantiationService.createInstance(DiffNestedCellViewModel, originalModel.cells[change.originalStart + j]),
581
- undefined,
582
- 'delete',
583
- eventDispatcher,
584
- initData
585
- ))));
586
- }
587
- for (let j = modifiedLen; j < change.modifiedLength; j++) {
588
- result.push(( (new SingleSideDiffElementViewModel(
589
- modifiedModel,
590
- originalModel,
591
- undefined,
592
- instantiationService.createInstance(DiffNestedCellViewModel, modifiedModel.cells[change.modifiedStart + j]),
593
- 'insert',
594
- eventDispatcher,
595
- initData
596
- ))));
597
- }
598
- return result;
599
- }
600
- scheduleOutputHeightAck(cellInfo, outputId, height) {
601
- const diffElement = cellInfo.diffElement;
602
- let diffSide = DiffSide.Original;
603
- if (diffElement instanceof SideBySideDiffElementViewModel) {
604
- const info = CellUri.parse(cellInfo.cellUri);
605
- if (!info) {
606
- return;
607
- }
608
- diffSide = ( (info.notebook.toString())) === this._model?.original.resource.toString() ? DiffSide.Original : DiffSide.Modified;
609
- }
610
- else {
611
- diffSide = diffElement.type === 'insert' ? DiffSide.Modified : DiffSide.Original;
612
- }
613
- const webview = diffSide === DiffSide.Modified ? this._modifiedWebview : this._originalWebview;
614
- scheduleAtNextAnimationFrame(this.window, () => {
615
- webview?.ackHeight([{ cellId: cellInfo.cellId, outputId, height }]);
616
- }, 10);
617
- }
618
- layoutNotebookCell(cell, height) {
619
- const relayout = (cell, height) => {
620
- this._list.updateElementHeight2(cell, height);
621
- };
622
- if (( (this.pendingLayouts.has(cell)))) {
623
- this.pendingLayouts.get(cell).dispose();
624
- }
625
- let r;
626
- const layoutDisposable = scheduleAtNextAnimationFrame(this.window, () => {
627
- this.pendingLayouts.delete(cell);
628
- relayout(cell, height);
629
- r();
630
- });
631
- this.pendingLayouts.set(cell, toDisposable(() => {
632
- layoutDisposable.dispose();
633
- r();
634
- }));
635
- return (
636
- (new Promise(resolve => { r = resolve; }))
637
- );
638
- }
639
- setScrollTop(scrollTop) {
640
- this._list.scrollTop = scrollTop;
641
- }
642
- triggerScroll(event) {
643
- this._list.triggerScrollFromMouseWheelEvent(event);
644
- }
645
- previousChange() {
646
- let currFocus = this._list.getFocus()[0];
647
- if (isNaN(currFocus) || currFocus < 0) {
648
- currFocus = 0;
649
- }
650
- let prevChangeIndex = currFocus - 1;
651
- while (prevChangeIndex >= 0) {
652
- const vm = this._diffElementViewModels[prevChangeIndex];
653
- if (vm.type !== 'unchanged') {
654
- break;
655
- }
656
- prevChangeIndex--;
657
- }
658
- if (prevChangeIndex >= 0) {
659
- this._list.setFocus([prevChangeIndex]);
660
- this._list.reveal(prevChangeIndex);
661
- }
662
- else {
663
- const index = findLastIdx(this._diffElementViewModels, vm => vm.type !== 'unchanged');
664
- if (index >= 0) {
665
- this._list.setFocus([index]);
666
- this._list.reveal(index);
667
- }
668
- }
669
- }
670
- nextChange() {
671
- let currFocus = this._list.getFocus()[0];
672
- if (isNaN(currFocus) || currFocus < 0) {
673
- currFocus = 0;
674
- }
675
- let nextChangeIndex = currFocus + 1;
676
- while (nextChangeIndex < this._diffElementViewModels.length) {
677
- const vm = this._diffElementViewModels[nextChangeIndex];
678
- if (vm.type !== 'unchanged') {
679
- break;
680
- }
681
- nextChangeIndex++;
682
- }
683
- if (nextChangeIndex < this._diffElementViewModels.length) {
684
- this._list.setFocus([nextChangeIndex]);
685
- this._list.reveal(nextChangeIndex);
686
- }
687
- else {
688
- const index = this._diffElementViewModels.findIndex(vm => vm.type !== 'unchanged');
689
- if (index >= 0) {
690
- this._list.setFocus([index]);
691
- this._list.reveal(index);
692
- }
693
- }
694
- }
695
- createOutput(cellDiffViewModel, cellViewModel, output, getOffset, diffSide) {
696
- this._insetModifyQueueByOutputId.queue(output.source.model.outputId + (diffSide === DiffSide.Modified ? '-right' : 'left'), async () => {
697
- const activeWebview = diffSide === DiffSide.Modified ? this._modifiedWebview : this._originalWebview;
698
- if (!activeWebview) {
699
- return;
700
- }
701
- if (!( (activeWebview.insetMapping.has(output.source)))) {
702
- const cellTop = this._list.getCellViewScrollTop(cellDiffViewModel);
703
- await activeWebview.createOutput({ diffElement: cellDiffViewModel, cellHandle: cellViewModel.handle, cellId: cellViewModel.id, cellUri: cellViewModel.uri }, output, cellTop, getOffset());
704
- }
705
- else {
706
- const cellTop = this._list.getCellViewScrollTop(cellDiffViewModel);
707
- const outputIndex = cellViewModel.outputsViewModels.indexOf(output.source);
708
- const outputOffset = cellDiffViewModel.getOutputOffsetInCell(diffSide, outputIndex);
709
- activeWebview.updateScrollTops([{
710
- cell: cellViewModel,
711
- output: output.source,
712
- cellTop,
713
- outputOffset,
714
- forceDisplay: true
715
- }], []);
716
- }
717
- });
718
- }
719
- updateMarkupCellHeight() {
720
- }
721
- getCellByInfo(cellInfo) {
722
- return cellInfo.diffElement.getCellByUri(cellInfo.cellUri);
723
- }
724
- getCellById(cellId) {
725
- throw ( (new Error('Not implemented')));
726
- }
727
- removeInset(cellDiffViewModel, cellViewModel, displayOutput, diffSide) {
728
- this._insetModifyQueueByOutputId.queue(displayOutput.model.outputId + (diffSide === DiffSide.Modified ? '-right' : 'left'), async () => {
729
- const activeWebview = diffSide === DiffSide.Modified ? this._modifiedWebview : this._originalWebview;
730
- if (!activeWebview) {
731
- return;
732
- }
733
- if (!( (activeWebview.insetMapping.has(displayOutput)))) {
734
- return;
735
- }
736
- activeWebview.removeInsets([displayOutput]);
737
- });
738
- }
739
- showInset(cellDiffViewModel, cellViewModel, displayOutput, diffSide) {
740
- this._insetModifyQueueByOutputId.queue(displayOutput.model.outputId + (diffSide === DiffSide.Modified ? '-right' : 'left'), async () => {
741
- const activeWebview = diffSide === DiffSide.Modified ? this._modifiedWebview : this._originalWebview;
742
- if (!activeWebview) {
743
- return;
744
- }
745
- if (!( (activeWebview.insetMapping.has(displayOutput)))) {
746
- return;
747
- }
748
- const cellTop = this._list.getCellViewScrollTop(cellDiffViewModel);
749
- const outputIndex = cellViewModel.outputsViewModels.indexOf(displayOutput);
750
- const outputOffset = cellDiffViewModel.getOutputOffsetInCell(diffSide, outputIndex);
751
- activeWebview.updateScrollTops([{
752
- cell: cellViewModel,
753
- output: displayOutput,
754
- cellTop,
755
- outputOffset,
756
- forceDisplay: true,
757
- }], []);
758
- });
759
- }
760
- hideInset(cellDiffViewModel, cellViewModel, output) {
761
- this._modifiedWebview?.hideInset(output);
762
- this._originalWebview?.hideInset(output);
763
- }
764
- getDomNode() {
765
- return this._rootElement;
766
- }
767
- getOverflowContainerDomNode() {
768
- return this._overflowContainer;
769
- }
770
- getControl() {
771
- return this;
772
- }
773
- clearInput() {
774
- super.clearInput();
775
- this._modifiedResourceDisposableStore.clear();
776
- this._list?.splice(0, this._list?.length || 0);
777
- this._model = null;
778
- this._diffElementViewModels.forEach(vm => vm.dispose());
779
- this._diffElementViewModels = [];
780
- }
781
- deltaCellOutputContainerClassNames(diffSide, cellId, added, removed) {
782
- if (diffSide === DiffSide.Original) {
783
- this._originalWebview?.deltaCellContainerClassNames(cellId, added, removed);
784
- }
785
- else {
786
- this._modifiedWebview?.deltaCellContainerClassNames(cellId, added, removed);
787
- }
788
- }
789
- getLayoutInfo() {
790
- if (!this._list) {
791
- throw ( (new Error('Editor is not initalized successfully')));
792
- }
793
- return {
794
- width: this._dimension.width,
795
- height: this._dimension.height,
796
- fontInfo: this.fontInfo,
797
- scrollHeight: this._list?.getScrollHeight() ?? 0,
798
- stickyHeight: 0,
799
- };
800
- }
801
- getCellOutputLayoutInfo(nestedCell) {
802
- if (!this._model) {
803
- throw ( (new Error('Editor is not attached to model yet')));
804
- }
805
- const documentModel = CellUri.parse(nestedCell.uri);
806
- if (!documentModel) {
807
- throw ( (new Error('Nested cell in the diff editor has wrong Uri')));
808
- }
809
- const belongToOriginalDocument = ( (this._model.original.notebook.uri.toString())) === ( (documentModel.notebook.toString()));
810
- const viewModel = this._diffElementViewModels.find(element => {
811
- const textModel = belongToOriginalDocument ? element.original : element.modified;
812
- if (!textModel) {
813
- return false;
814
- }
815
- if (( (textModel.uri.toString())) === ( (nestedCell.uri.toString()))) {
816
- return true;
817
- }
818
- return false;
819
- });
820
- if (!viewModel) {
821
- throw ( (new Error('Nested cell in the diff editor does not match any diff element')));
822
- }
823
- if (viewModel.type === 'unchanged') {
824
- return this.getLayoutInfo();
825
- }
826
- if (viewModel.type === 'insert' || viewModel.type === 'delete') {
827
- return {
828
- width: this._dimension.width / 2,
829
- height: this._dimension.height / 2,
830
- fontInfo: this.fontInfo
831
- };
832
- }
833
- if (viewModel.checkIfOutputsModified()) {
834
- return {
835
- width: this._dimension.width / 2,
836
- height: this._dimension.height / 2,
837
- fontInfo: this.fontInfo
838
- };
839
- }
840
- else {
841
- return this.getLayoutInfo();
842
- }
843
- }
844
- layout(dimension, _position) {
845
- this._rootElement.classList.toggle('mid-width', dimension.width < 1000 && dimension.width >= 600);
846
- this._rootElement.classList.toggle('narrow-width', dimension.width < 600);
847
- const overviewRulerEnabled = this.isOverviewRulerEnabled();
848
- this._dimension = dimension.with(dimension.width - (overviewRulerEnabled ? NotebookTextDiffEditor_1.ENTIRE_DIFF_OVERVIEW_WIDTH : 0));
849
- this._listViewContainer.style.height = `${dimension.height}px`;
850
- this._listViewContainer.style.width = `${this._dimension.width}px`;
851
- this._list?.layout(this._dimension.height, this._dimension.width);
852
- if (this._modifiedWebview) {
853
- this._modifiedWebview.element.style.width = `calc(50% - 16px)`;
854
- this._modifiedWebview.element.style.left = `calc(50%)`;
855
- }
856
- if (this._originalWebview) {
857
- this._originalWebview.element.style.width = `calc(50% - 16px)`;
858
- this._originalWebview.element.style.left = `16px`;
859
- }
860
- if (this._webviewTransparentCover) {
861
- this._webviewTransparentCover.style.height = `${this._dimension.height}px`;
862
- this._webviewTransparentCover.style.width = `${this._dimension.width}px`;
863
- }
864
- if (overviewRulerEnabled) {
865
- this._overviewRuler.layout();
866
- }
867
- this._eventDispatcher?.emit([( (new NotebookDiffLayoutChangedEvent({ width: true, fontInfo: true }, this.getLayoutInfo())))]);
868
- }
869
- dispose() {
870
- this._isDisposed = true;
871
- this._layoutCancellationTokenSource?.dispose();
872
- this._detachModel();
873
- super.dispose();
874
- }
875
- };
876
- NotebookTextDiffEditor = NotebookTextDiffEditor_1 = ( (__decorate([
877
- ( (__param(1, IInstantiationService))),
878
- ( (__param(2, IThemeService))),
879
- ( (__param(3, IContextKeyService))),
880
- ( (__param(4, INotebookEditorWorkerService))),
881
- ( (__param(5, IConfigurationService))),
882
- ( (__param(6, ITelemetryService))),
883
- ( (__param(7, IStorageService)))
884
- ], NotebookTextDiffEditor)));
885
- registerZIndex(ZIndex.Base, 10, 'notebook-diff-view-viewport-slider');
886
- registerThemingParticipant((theme, collector) => {
887
- const diffDiagonalFillColor = theme.getColor(diffDiagonalFill);
888
- collector.addRule(`
889
- .notebook-text-diff-editor .diagonal-fill {
890
- background-image: linear-gradient(
891
- -45deg,
892
- ${diffDiagonalFillColor} 12.5%,
893
- #0000 12.5%, #0000 50%,
894
- ${diffDiagonalFillColor} 50%, ${diffDiagonalFillColor} 62.5%,
895
- #0000 62.5%, #0000 100%
896
- );
897
- background-size: 8px 8px;
898
- }
899
- `);
900
- collector.addRule(`.notebook-text-diff-editor .cell-body { margin: ${DIFF_CELL_MARGIN}px; }`);
901
- });
902
-
903
- export { NotebookTextDiffEditor };