@codingame/monaco-vscode-notebook-service-override 1.85.1
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.
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/notebook.d.ts +5 -0
- package/notebook.js +44 -0
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +32 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +387 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +668 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +109 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +319 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +485 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +106 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +165 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +238 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +168 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +209 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +87 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +82 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +93 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +383 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +46 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +135 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +383 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +117 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +511 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +168 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +94 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +702 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +268 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +45 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1297 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +284 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +563 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +313 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +872 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +393 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +175 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +1121 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +159 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +339 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +182 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +106 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +509 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +133 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +342 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +111 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +666 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +200 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +80 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +1001 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +202 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +80 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +98 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +217 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +89 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +372 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +706 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +407 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +144 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +129 -0
- package/worker.js +1 -0
- package/workers/notebook.worker.js +9 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
2
|
+
|
|
3
|
+
var DiffSide;
|
|
4
|
+
( (function(DiffSide) {
|
|
5
|
+
DiffSide[DiffSide["Original"] = 0] = "Original";
|
|
6
|
+
DiffSide[DiffSide["Modified"] = 1] = "Modified";
|
|
7
|
+
})(DiffSide || (DiffSide = {})));
|
|
8
|
+
const DIFF_CELL_MARGIN = 16;
|
|
9
|
+
const NOTEBOOK_DIFF_CELL_INPUT = ( new RawContextKey('notebookDiffCellInputChanged', false));
|
|
10
|
+
const NOTEBOOK_DIFF_CELL_PROPERTY = ( new RawContextKey('notebookDiffCellPropertyChanged', false));
|
|
11
|
+
const NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED = ( new RawContextKey('notebookDiffCellPropertyExpanded', false));
|
|
12
|
+
|
|
13
|
+
export { DIFF_CELL_MARGIN, DiffSide, NOTEBOOK_DIFF_CELL_INPUT, NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED };
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './notebookDiff.css.js';
|
|
3
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
4
|
+
import { MouseController, isMonacoEditor } from 'monaco-editor/esm/vs/base/browser/ui/list/listWidget.js';
|
|
5
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
7
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
8
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
9
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
10
|
+
import { WorkbenchList, IListService } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
11
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
12
|
+
import { DIFF_CELL_MARGIN } from './notebookDiffEditorBrowser.js';
|
|
13
|
+
import { InsertElement, DeletedElement, getOptimizedNestedCodeEditorWidgetOptions, ModifiedElement } from './diffComponents.js';
|
|
14
|
+
import { CodeEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js';
|
|
15
|
+
import { DiffEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js';
|
|
16
|
+
import { MenuItemAction, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
17
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
18
|
+
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
19
|
+
import { CodiconActionViewItem } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView';
|
|
20
|
+
import { BareFontInfo } from 'monaco-editor/esm/vs/editor/common/config/fontInfo.js';
|
|
21
|
+
import { PixelRatio } from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
22
|
+
import { WorkbenchToolBar } from 'monaco-editor/esm/vs/platform/actions/browser/toolbar.js';
|
|
23
|
+
import { fixedEditorOptions, fixedDiffEditorOptions } from './diffCellEditorOptions.js';
|
|
24
|
+
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
25
|
+
|
|
26
|
+
var CellDiffSingleSideRenderer_1, CellDiffSideBySideRenderer_1;
|
|
27
|
+
let NotebookCellTextDiffListDelegate = class NotebookCellTextDiffListDelegate {
|
|
28
|
+
constructor(configurationService) {
|
|
29
|
+
this.configurationService = configurationService;
|
|
30
|
+
const editorOptions = this.configurationService.getValue('editor');
|
|
31
|
+
this.lineHeight = BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.value).lineHeight;
|
|
32
|
+
}
|
|
33
|
+
getHeight(element) {
|
|
34
|
+
return element.getHeight(this.lineHeight);
|
|
35
|
+
}
|
|
36
|
+
hasDynamicHeight(element) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
getTemplateId(element) {
|
|
40
|
+
switch (element.type) {
|
|
41
|
+
case 'delete':
|
|
42
|
+
case 'insert':
|
|
43
|
+
return CellDiffSingleSideRenderer.TEMPLATE_ID;
|
|
44
|
+
case 'modified':
|
|
45
|
+
case 'unchanged':
|
|
46
|
+
return CellDiffSideBySideRenderer.TEMPLATE_ID;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
NotebookCellTextDiffListDelegate = ( __decorate([
|
|
51
|
+
( __param(0, IConfigurationService))
|
|
52
|
+
], NotebookCellTextDiffListDelegate));
|
|
53
|
+
let CellDiffSingleSideRenderer = class CellDiffSingleSideRenderer {
|
|
54
|
+
static { CellDiffSingleSideRenderer_1 = this; }
|
|
55
|
+
static { this.TEMPLATE_ID = 'cell_diff_single'; }
|
|
56
|
+
constructor(notebookEditor, instantiationService) {
|
|
57
|
+
this.notebookEditor = notebookEditor;
|
|
58
|
+
this.instantiationService = instantiationService;
|
|
59
|
+
}
|
|
60
|
+
get templateId() {
|
|
61
|
+
return CellDiffSingleSideRenderer_1.TEMPLATE_ID;
|
|
62
|
+
}
|
|
63
|
+
renderTemplate(container) {
|
|
64
|
+
const body = dom.$('.cell-body');
|
|
65
|
+
dom.append(container, body);
|
|
66
|
+
const diffEditorContainer = dom.$('.cell-diff-editor-container');
|
|
67
|
+
dom.append(body, diffEditorContainer);
|
|
68
|
+
const diagonalFill = dom.append(body, dom.$('.diagonal-fill'));
|
|
69
|
+
const sourceContainer = dom.append(diffEditorContainer, dom.$('.source-container'));
|
|
70
|
+
const editor = this._buildSourceEditor(sourceContainer);
|
|
71
|
+
const metadataHeaderContainer = dom.append(diffEditorContainer, dom.$('.metadata-header-container'));
|
|
72
|
+
const metadataInfoContainer = dom.append(diffEditorContainer, dom.$('.metadata-info-container'));
|
|
73
|
+
const outputHeaderContainer = dom.append(diffEditorContainer, dom.$('.output-header-container'));
|
|
74
|
+
const outputInfoContainer = dom.append(diffEditorContainer, dom.$('.output-info-container'));
|
|
75
|
+
const borderContainer = dom.append(body, dom.$('.border-container'));
|
|
76
|
+
const leftBorder = dom.append(borderContainer, dom.$('.left-border'));
|
|
77
|
+
const rightBorder = dom.append(borderContainer, dom.$('.right-border'));
|
|
78
|
+
const topBorder = dom.append(borderContainer, dom.$('.top-border'));
|
|
79
|
+
const bottomBorder = dom.append(borderContainer, dom.$('.bottom-border'));
|
|
80
|
+
return {
|
|
81
|
+
body,
|
|
82
|
+
container,
|
|
83
|
+
diffEditorContainer,
|
|
84
|
+
diagonalFill,
|
|
85
|
+
sourceEditor: editor,
|
|
86
|
+
metadataHeaderContainer,
|
|
87
|
+
metadataInfoContainer,
|
|
88
|
+
outputHeaderContainer,
|
|
89
|
+
outputInfoContainer,
|
|
90
|
+
leftBorder,
|
|
91
|
+
rightBorder,
|
|
92
|
+
topBorder,
|
|
93
|
+
bottomBorder,
|
|
94
|
+
elementDisposables: ( new DisposableStore())
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
_buildSourceEditor(sourceContainer) {
|
|
98
|
+
const editorContainer = dom.append(sourceContainer, dom.$('.editor-container'));
|
|
99
|
+
const editor = this.instantiationService.createInstance(CodeEditorWidget, editorContainer, {
|
|
100
|
+
...fixedEditorOptions,
|
|
101
|
+
dimension: {
|
|
102
|
+
width: (this.notebookEditor.getLayoutInfo().width - 2 * DIFF_CELL_MARGIN) / 2 - 18,
|
|
103
|
+
height: 0
|
|
104
|
+
},
|
|
105
|
+
automaticLayout: false,
|
|
106
|
+
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode()
|
|
107
|
+
}, {});
|
|
108
|
+
return editor;
|
|
109
|
+
}
|
|
110
|
+
renderElement(element, index, templateData, height) {
|
|
111
|
+
templateData.body.classList.remove('left', 'right', 'full');
|
|
112
|
+
switch (element.type) {
|
|
113
|
+
case 'delete':
|
|
114
|
+
templateData.elementDisposables.add(this.instantiationService.createInstance(DeletedElement, this.notebookEditor, element, templateData));
|
|
115
|
+
return;
|
|
116
|
+
case 'insert':
|
|
117
|
+
templateData.elementDisposables.add(this.instantiationService.createInstance(InsertElement, this.notebookEditor, element, templateData));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
disposeTemplate(templateData) {
|
|
122
|
+
templateData.container.innerText = '';
|
|
123
|
+
templateData.sourceEditor.dispose();
|
|
124
|
+
templateData.elementDisposables.dispose();
|
|
125
|
+
}
|
|
126
|
+
disposeElement(element, index, templateData) {
|
|
127
|
+
templateData.elementDisposables.clear();
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
CellDiffSingleSideRenderer = CellDiffSingleSideRenderer_1 = ( __decorate([
|
|
131
|
+
( __param(1, IInstantiationService))
|
|
132
|
+
], CellDiffSingleSideRenderer));
|
|
133
|
+
let CellDiffSideBySideRenderer = class CellDiffSideBySideRenderer {
|
|
134
|
+
static { CellDiffSideBySideRenderer_1 = this; }
|
|
135
|
+
static { this.TEMPLATE_ID = 'cell_diff_side_by_side'; }
|
|
136
|
+
constructor(notebookEditor, instantiationService, contextMenuService, keybindingService, menuService, contextKeyService, notificationService, themeService, accessibilityService) {
|
|
137
|
+
this.notebookEditor = notebookEditor;
|
|
138
|
+
this.instantiationService = instantiationService;
|
|
139
|
+
this.contextMenuService = contextMenuService;
|
|
140
|
+
this.keybindingService = keybindingService;
|
|
141
|
+
this.menuService = menuService;
|
|
142
|
+
this.contextKeyService = contextKeyService;
|
|
143
|
+
this.notificationService = notificationService;
|
|
144
|
+
this.themeService = themeService;
|
|
145
|
+
this.accessibilityService = accessibilityService;
|
|
146
|
+
}
|
|
147
|
+
get templateId() {
|
|
148
|
+
return CellDiffSideBySideRenderer_1.TEMPLATE_ID;
|
|
149
|
+
}
|
|
150
|
+
renderTemplate(container) {
|
|
151
|
+
const body = dom.$('.cell-body');
|
|
152
|
+
dom.append(container, body);
|
|
153
|
+
const diffEditorContainer = dom.$('.cell-diff-editor-container');
|
|
154
|
+
dom.append(body, diffEditorContainer);
|
|
155
|
+
const sourceContainer = dom.append(diffEditorContainer, dom.$('.source-container'));
|
|
156
|
+
const { editor, editorContainer } = this._buildSourceEditor(sourceContainer);
|
|
157
|
+
const inputToolbarContainer = dom.append(sourceContainer, dom.$('.editor-input-toolbar-container'));
|
|
158
|
+
const cellToolbarContainer = dom.append(inputToolbarContainer, dom.$('div.property-toolbar'));
|
|
159
|
+
const toolbar = this.instantiationService.createInstance(WorkbenchToolBar, cellToolbarContainer, {
|
|
160
|
+
actionViewItemProvider: action => {
|
|
161
|
+
if (action instanceof MenuItemAction) {
|
|
162
|
+
const item = ( new CodiconActionViewItem(
|
|
163
|
+
action,
|
|
164
|
+
undefined,
|
|
165
|
+
this.keybindingService,
|
|
166
|
+
this.notificationService,
|
|
167
|
+
this.contextKeyService,
|
|
168
|
+
this.themeService,
|
|
169
|
+
this.contextMenuService,
|
|
170
|
+
this.accessibilityService
|
|
171
|
+
));
|
|
172
|
+
return item;
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const metadataHeaderContainer = dom.append(diffEditorContainer, dom.$('.metadata-header-container'));
|
|
178
|
+
const metadataInfoContainer = dom.append(diffEditorContainer, dom.$('.metadata-info-container'));
|
|
179
|
+
const outputHeaderContainer = dom.append(diffEditorContainer, dom.$('.output-header-container'));
|
|
180
|
+
const outputInfoContainer = dom.append(diffEditorContainer, dom.$('.output-info-container'));
|
|
181
|
+
const borderContainer = dom.append(body, dom.$('.border-container'));
|
|
182
|
+
const leftBorder = dom.append(borderContainer, dom.$('.left-border'));
|
|
183
|
+
const rightBorder = dom.append(borderContainer, dom.$('.right-border'));
|
|
184
|
+
const topBorder = dom.append(borderContainer, dom.$('.top-border'));
|
|
185
|
+
const bottomBorder = dom.append(borderContainer, dom.$('.bottom-border'));
|
|
186
|
+
return {
|
|
187
|
+
body,
|
|
188
|
+
container,
|
|
189
|
+
diffEditorContainer,
|
|
190
|
+
sourceEditor: editor,
|
|
191
|
+
editorContainer,
|
|
192
|
+
inputToolbarContainer,
|
|
193
|
+
toolbar,
|
|
194
|
+
metadataHeaderContainer,
|
|
195
|
+
metadataInfoContainer,
|
|
196
|
+
outputHeaderContainer,
|
|
197
|
+
outputInfoContainer,
|
|
198
|
+
leftBorder,
|
|
199
|
+
rightBorder,
|
|
200
|
+
topBorder,
|
|
201
|
+
bottomBorder,
|
|
202
|
+
elementDisposables: ( new DisposableStore())
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
_buildSourceEditor(sourceContainer) {
|
|
206
|
+
const editorContainer = dom.append(sourceContainer, dom.$('.editor-container'));
|
|
207
|
+
const editor = this.instantiationService.createInstance(DiffEditorWidget, editorContainer, {
|
|
208
|
+
...fixedDiffEditorOptions,
|
|
209
|
+
padding: {
|
|
210
|
+
top: 24,
|
|
211
|
+
bottom: 12
|
|
212
|
+
},
|
|
213
|
+
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
|
|
214
|
+
originalEditable: false,
|
|
215
|
+
ignoreTrimWhitespace: false,
|
|
216
|
+
automaticLayout: false,
|
|
217
|
+
dimension: {
|
|
218
|
+
height: 0,
|
|
219
|
+
width: 0
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
originalEditor: getOptimizedNestedCodeEditorWidgetOptions(),
|
|
223
|
+
modifiedEditor: getOptimizedNestedCodeEditorWidgetOptions()
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
editor,
|
|
227
|
+
editorContainer
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
renderElement(element, index, templateData, height) {
|
|
231
|
+
templateData.body.classList.remove('left', 'right', 'full');
|
|
232
|
+
switch (element.type) {
|
|
233
|
+
case 'unchanged':
|
|
234
|
+
templateData.elementDisposables.add(this.instantiationService.createInstance(ModifiedElement, this.notebookEditor, element, templateData));
|
|
235
|
+
return;
|
|
236
|
+
case 'modified':
|
|
237
|
+
templateData.elementDisposables.add(this.instantiationService.createInstance(ModifiedElement, this.notebookEditor, element, templateData));
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
disposeTemplate(templateData) {
|
|
242
|
+
templateData.container.innerText = '';
|
|
243
|
+
templateData.sourceEditor.dispose();
|
|
244
|
+
templateData.toolbar?.dispose();
|
|
245
|
+
templateData.elementDisposables.dispose();
|
|
246
|
+
}
|
|
247
|
+
disposeElement(element, index, templateData) {
|
|
248
|
+
if (templateData.toolbar) {
|
|
249
|
+
templateData.toolbar.context = undefined;
|
|
250
|
+
}
|
|
251
|
+
templateData.elementDisposables.clear();
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
CellDiffSideBySideRenderer = CellDiffSideBySideRenderer_1 = ( __decorate([
|
|
255
|
+
( __param(1, IInstantiationService)),
|
|
256
|
+
( __param(2, IContextMenuService)),
|
|
257
|
+
( __param(3, IKeybindingService)),
|
|
258
|
+
( __param(4, IMenuService)),
|
|
259
|
+
( __param(5, IContextKeyService)),
|
|
260
|
+
( __param(6, INotificationService)),
|
|
261
|
+
( __param(7, IThemeService)),
|
|
262
|
+
( __param(8, IAccessibilityService))
|
|
263
|
+
], CellDiffSideBySideRenderer));
|
|
264
|
+
class NotebookMouseController extends MouseController {
|
|
265
|
+
onViewPointer(e) {
|
|
266
|
+
if (isMonacoEditor(e.browserEvent.target)) {
|
|
267
|
+
const focus = typeof e.index === 'undefined' ? [] : [e.index];
|
|
268
|
+
this.list.setFocus(focus, e.browserEvent);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
super.onViewPointer(e);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
let NotebookTextDiffList = class NotebookTextDiffList extends WorkbenchList {
|
|
276
|
+
get rowsContainer() {
|
|
277
|
+
return this.view.containerDomNode;
|
|
278
|
+
}
|
|
279
|
+
constructor(listUser, container, delegate, renderers, contextKeyService, options, listService, configurationService, instantiationService) {
|
|
280
|
+
super(listUser, container, delegate, renderers, options, contextKeyService, listService, configurationService, instantiationService);
|
|
281
|
+
}
|
|
282
|
+
createMouseController(options) {
|
|
283
|
+
return ( new NotebookMouseController(this));
|
|
284
|
+
}
|
|
285
|
+
getCellViewScrollTop(element) {
|
|
286
|
+
const index = this.indexOf(element);
|
|
287
|
+
return this.view.elementTop(index);
|
|
288
|
+
}
|
|
289
|
+
getScrollHeight() {
|
|
290
|
+
return this.view.scrollHeight;
|
|
291
|
+
}
|
|
292
|
+
triggerScrollFromMouseWheelEvent(browserEvent) {
|
|
293
|
+
this.view.delegateScrollFromMouseWheelEvent(browserEvent);
|
|
294
|
+
}
|
|
295
|
+
delegateVerticalScrollbarPointerDown(browserEvent) {
|
|
296
|
+
this.view.delegateVerticalScrollbarPointerDown(browserEvent);
|
|
297
|
+
}
|
|
298
|
+
clear() {
|
|
299
|
+
super.splice(0, this.length);
|
|
300
|
+
}
|
|
301
|
+
updateElementHeight2(element, size) {
|
|
302
|
+
const viewIndex = this.indexOf(element);
|
|
303
|
+
const focused = this.getFocus();
|
|
304
|
+
this.view.updateElementHeight(viewIndex, size, focused.length ? focused[0] : null);
|
|
305
|
+
}
|
|
306
|
+
style(styles) {
|
|
307
|
+
const selectorSuffix = this.view.domId;
|
|
308
|
+
if (!this.styleElement) {
|
|
309
|
+
this.styleElement = dom.createStyleSheet(this.view.domNode);
|
|
310
|
+
}
|
|
311
|
+
const suffix = selectorSuffix && `.${selectorSuffix}`;
|
|
312
|
+
const content = [];
|
|
313
|
+
if (styles.listBackground) {
|
|
314
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows { background: ${styles.listBackground}; }`);
|
|
315
|
+
}
|
|
316
|
+
if (styles.listFocusBackground) {
|
|
317
|
+
content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`);
|
|
318
|
+
content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`);
|
|
319
|
+
}
|
|
320
|
+
if (styles.listFocusForeground) {
|
|
321
|
+
content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`);
|
|
322
|
+
}
|
|
323
|
+
if (styles.listActiveSelectionBackground) {
|
|
324
|
+
content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`);
|
|
325
|
+
content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`);
|
|
326
|
+
}
|
|
327
|
+
if (styles.listActiveSelectionForeground) {
|
|
328
|
+
content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`);
|
|
329
|
+
}
|
|
330
|
+
if (styles.listFocusAndSelectionBackground) {
|
|
331
|
+
content.push(`
|
|
332
|
+
.monaco-drag-image,
|
|
333
|
+
.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; }
|
|
334
|
+
`);
|
|
335
|
+
}
|
|
336
|
+
if (styles.listFocusAndSelectionForeground) {
|
|
337
|
+
content.push(`
|
|
338
|
+
.monaco-drag-image,
|
|
339
|
+
.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; }
|
|
340
|
+
`);
|
|
341
|
+
}
|
|
342
|
+
if (styles.listInactiveFocusBackground) {
|
|
343
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`);
|
|
344
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`);
|
|
345
|
+
}
|
|
346
|
+
if (styles.listInactiveSelectionBackground) {
|
|
347
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`);
|
|
348
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`);
|
|
349
|
+
}
|
|
350
|
+
if (styles.listInactiveSelectionForeground) {
|
|
351
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`);
|
|
352
|
+
}
|
|
353
|
+
if (styles.listHoverBackground) {
|
|
354
|
+
content.push(`.monaco-list${suffix}:not(.drop-target) > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`);
|
|
355
|
+
}
|
|
356
|
+
if (styles.listHoverForeground) {
|
|
357
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`);
|
|
358
|
+
}
|
|
359
|
+
if (styles.listSelectionOutline) {
|
|
360
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`);
|
|
361
|
+
}
|
|
362
|
+
if (styles.listFocusOutline) {
|
|
363
|
+
content.push(`
|
|
364
|
+
.monaco-drag-image,
|
|
365
|
+
.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }
|
|
366
|
+
`);
|
|
367
|
+
}
|
|
368
|
+
if (styles.listInactiveFocusOutline) {
|
|
369
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`);
|
|
370
|
+
}
|
|
371
|
+
if (styles.listHoverOutline) {
|
|
372
|
+
content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`);
|
|
373
|
+
}
|
|
374
|
+
if (styles.listDropBackground) {
|
|
375
|
+
content.push(`
|
|
376
|
+
.monaco-list${suffix}.drop-target,
|
|
377
|
+
.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows.drop-target,
|
|
378
|
+
.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; }
|
|
379
|
+
`);
|
|
380
|
+
}
|
|
381
|
+
const newStyles = content.join('\n');
|
|
382
|
+
if (newStyles !== this.styleElement.textContent) {
|
|
383
|
+
this.styleElement.textContent = newStyles;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
NotebookTextDiffList = ( __decorate([
|
|
388
|
+
( __param(6, IListService)),
|
|
389
|
+
( __param(7, IConfigurationService)),
|
|
390
|
+
( __param(8, IInstantiationService))
|
|
391
|
+
], NotebookTextDiffList));
|
|
392
|
+
|
|
393
|
+
export { CellDiffSideBySideRenderer, CellDiffSingleSideRenderer, NotebookCellTextDiffListDelegate, NotebookMouseController, NotebookTextDiffList };
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as browser from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
3
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
4
|
+
import { createFastDomNode } from 'monaco-editor/esm/vs/base/browser/fastDomNode.js';
|
|
5
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
6
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
7
|
+
import { diffOverviewRulerInserted, diffInserted, defaultInsertColor, diffOverviewRulerRemoved, diffRemoved, defaultRemoveColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
8
|
+
import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
9
|
+
|
|
10
|
+
const MINIMUM_SLIDER_SIZE = 20;
|
|
11
|
+
let NotebookDiffOverviewRuler = class NotebookDiffOverviewRuler extends Themable {
|
|
12
|
+
constructor(notebookEditor, width, container, themeService) {
|
|
13
|
+
super(themeService);
|
|
14
|
+
this.notebookEditor = notebookEditor;
|
|
15
|
+
this.width = width;
|
|
16
|
+
this._diffElementViewModels = [];
|
|
17
|
+
this._lanes = 2;
|
|
18
|
+
this._insertColor = null;
|
|
19
|
+
this._removeColor = null;
|
|
20
|
+
this._insertColorHex = null;
|
|
21
|
+
this._removeColorHex = null;
|
|
22
|
+
this._disposables = this._register(( new DisposableStore()));
|
|
23
|
+
this._renderAnimationFrame = null;
|
|
24
|
+
this._domNode = createFastDomNode(document.createElement('canvas'));
|
|
25
|
+
this._domNode.setPosition('relative');
|
|
26
|
+
this._domNode.setLayerHinting(true);
|
|
27
|
+
this._domNode.setContain('strict');
|
|
28
|
+
container.appendChild(this._domNode.domNode);
|
|
29
|
+
this._overviewViewportDomElement = createFastDomNode(document.createElement('div'));
|
|
30
|
+
this._overviewViewportDomElement.setClassName('diffViewport');
|
|
31
|
+
this._overviewViewportDomElement.setPosition('absolute');
|
|
32
|
+
this._overviewViewportDomElement.setWidth(width);
|
|
33
|
+
container.appendChild(this._overviewViewportDomElement.domNode);
|
|
34
|
+
this._register(browser.PixelRatio.onDidChange(() => {
|
|
35
|
+
this._scheduleRender();
|
|
36
|
+
}));
|
|
37
|
+
this._register(this.themeService.onDidColorThemeChange(e => {
|
|
38
|
+
const colorChanged = this.applyColors(e);
|
|
39
|
+
if (colorChanged) {
|
|
40
|
+
this._scheduleRender();
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
this.applyColors(this.themeService.getColorTheme());
|
|
44
|
+
this._register(this.notebookEditor.onDidScroll(() => {
|
|
45
|
+
this._renderOverviewViewport();
|
|
46
|
+
}));
|
|
47
|
+
this._register(dom.addStandardDisposableListener(container, dom.EventType.POINTER_DOWN, (e) => {
|
|
48
|
+
this.notebookEditor.delegateVerticalScrollbarPointerDown(e);
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
applyColors(theme) {
|
|
52
|
+
const newInsertColor = theme.getColor(diffOverviewRulerInserted) || ( (theme.getColor(diffInserted) || defaultInsertColor).transparent(2));
|
|
53
|
+
const newRemoveColor = theme.getColor(diffOverviewRulerRemoved) || ( (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2));
|
|
54
|
+
const hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor);
|
|
55
|
+
this._insertColor = newInsertColor;
|
|
56
|
+
this._removeColor = newRemoveColor;
|
|
57
|
+
if (this._insertColor) {
|
|
58
|
+
this._insertColorHex = Color.Format.CSS.formatHexA(this._insertColor);
|
|
59
|
+
}
|
|
60
|
+
if (this._removeColor) {
|
|
61
|
+
this._removeColorHex = Color.Format.CSS.formatHexA(this._removeColor);
|
|
62
|
+
}
|
|
63
|
+
return hasChanges;
|
|
64
|
+
}
|
|
65
|
+
layout() {
|
|
66
|
+
this._layoutNow();
|
|
67
|
+
}
|
|
68
|
+
updateViewModels(elements, eventDispatcher) {
|
|
69
|
+
this._disposables.clear();
|
|
70
|
+
this._diffElementViewModels = elements;
|
|
71
|
+
if (eventDispatcher) {
|
|
72
|
+
this._disposables.add(eventDispatcher.onDidChangeLayout(() => {
|
|
73
|
+
this._scheduleRender();
|
|
74
|
+
}));
|
|
75
|
+
this._disposables.add(eventDispatcher.onDidChangeCellLayout(() => {
|
|
76
|
+
this._scheduleRender();
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
this._scheduleRender();
|
|
80
|
+
}
|
|
81
|
+
_scheduleRender() {
|
|
82
|
+
if (this._renderAnimationFrame === null) {
|
|
83
|
+
this._renderAnimationFrame = dom.runAtThisOrScheduleAtNextAnimationFrame(dom.getWindow(this._domNode.domNode), this._onRenderScheduled.bind(this), 16);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_onRenderScheduled() {
|
|
87
|
+
this._renderAnimationFrame = null;
|
|
88
|
+
this._layoutNow();
|
|
89
|
+
}
|
|
90
|
+
_layoutNow() {
|
|
91
|
+
const layoutInfo = this.notebookEditor.getLayoutInfo();
|
|
92
|
+
const height = layoutInfo.height;
|
|
93
|
+
const contentHeight = ( this._diffElementViewModels.map(view => view.layoutInfo.totalHeight)).reduce((a, b) => a + b, 0);
|
|
94
|
+
const ratio = browser.PixelRatio.value;
|
|
95
|
+
this._domNode.setWidth(this.width);
|
|
96
|
+
this._domNode.setHeight(height);
|
|
97
|
+
this._domNode.domNode.width = this.width * ratio;
|
|
98
|
+
this._domNode.domNode.height = height * ratio;
|
|
99
|
+
const ctx = this._domNode.domNode.getContext('2d');
|
|
100
|
+
ctx.clearRect(0, 0, this.width * ratio, height * ratio);
|
|
101
|
+
this._renderCanvas(ctx, this.width * ratio, height * ratio, contentHeight * ratio, ratio);
|
|
102
|
+
this._renderOverviewViewport();
|
|
103
|
+
}
|
|
104
|
+
_renderOverviewViewport() {
|
|
105
|
+
const layout = this._computeOverviewViewport();
|
|
106
|
+
if (!layout) {
|
|
107
|
+
this._overviewViewportDomElement.setTop(0);
|
|
108
|
+
this._overviewViewportDomElement.setHeight(0);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this._overviewViewportDomElement.setTop(layout.top);
|
|
112
|
+
this._overviewViewportDomElement.setHeight(layout.height);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_computeOverviewViewport() {
|
|
116
|
+
const layoutInfo = this.notebookEditor.getLayoutInfo();
|
|
117
|
+
if (!layoutInfo) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const scrollTop = this.notebookEditor.getScrollTop();
|
|
121
|
+
const scrollHeight = this.notebookEditor.getScrollHeight();
|
|
122
|
+
const computedAvailableSize = Math.max(0, layoutInfo.height);
|
|
123
|
+
const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0);
|
|
124
|
+
const visibleSize = layoutInfo.height;
|
|
125
|
+
const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollHeight)));
|
|
126
|
+
const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollHeight - visibleSize);
|
|
127
|
+
const computedSliderPosition = Math.round(scrollTop * computedSliderRatio);
|
|
128
|
+
return {
|
|
129
|
+
height: computedSliderSize,
|
|
130
|
+
top: computedSliderPosition
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
_renderCanvas(ctx, width, height, scrollHeight, ratio) {
|
|
134
|
+
if (!this._insertColorHex || !this._removeColorHex) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const laneWidth = width / this._lanes;
|
|
138
|
+
let currentFrom = 0;
|
|
139
|
+
for (let i = 0; i < this._diffElementViewModels.length; i++) {
|
|
140
|
+
const element = this._diffElementViewModels[i];
|
|
141
|
+
const cellHeight = Math.round((element.layoutInfo.totalHeight / scrollHeight) * ratio * height);
|
|
142
|
+
switch (element.type) {
|
|
143
|
+
case 'insert':
|
|
144
|
+
ctx.fillStyle = this._insertColorHex;
|
|
145
|
+
ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
|
|
146
|
+
break;
|
|
147
|
+
case 'delete':
|
|
148
|
+
ctx.fillStyle = this._removeColorHex;
|
|
149
|
+
ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
|
|
150
|
+
break;
|
|
151
|
+
case 'unchanged':
|
|
152
|
+
break;
|
|
153
|
+
case 'modified':
|
|
154
|
+
ctx.fillStyle = this._removeColorHex;
|
|
155
|
+
ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
|
|
156
|
+
ctx.fillStyle = this._insertColorHex;
|
|
157
|
+
ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
currentFrom += cellHeight;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
dispose() {
|
|
164
|
+
if (this._renderAnimationFrame !== null) {
|
|
165
|
+
this._renderAnimationFrame.dispose();
|
|
166
|
+
this._renderAnimationFrame = null;
|
|
167
|
+
}
|
|
168
|
+
super.dispose();
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
NotebookDiffOverviewRuler = ( __decorate([
|
|
172
|
+
( __param(3, IThemeService))
|
|
173
|
+
], NotebookDiffOverviewRuler));
|
|
174
|
+
|
|
175
|
+
export { NotebookDiffOverviewRuler };
|