@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,39 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
|
|
4
|
+
var NotebookDiffViewEventType;
|
|
5
|
+
( (function(NotebookDiffViewEventType) {
|
|
6
|
+
NotebookDiffViewEventType[NotebookDiffViewEventType["LayoutChanged"] = 1] = "LayoutChanged";
|
|
7
|
+
NotebookDiffViewEventType[NotebookDiffViewEventType["CellLayoutChanged"] = 2] = "CellLayoutChanged";
|
|
8
|
+
})(NotebookDiffViewEventType || (NotebookDiffViewEventType = {})));
|
|
9
|
+
class NotebookDiffLayoutChangedEvent {
|
|
10
|
+
constructor(source, value) {
|
|
11
|
+
this.source = source;
|
|
12
|
+
this.value = value;
|
|
13
|
+
this.type = NotebookDiffViewEventType.LayoutChanged;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class NotebookDiffEditorEventDispatcher extends Disposable {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this._onDidChangeLayout = this._register(( new Emitter()));
|
|
20
|
+
this.onDidChangeLayout = this._onDidChangeLayout.event;
|
|
21
|
+
this._onDidChangeCellLayout = this._register(( new Emitter()));
|
|
22
|
+
this.onDidChangeCellLayout = this._onDidChangeCellLayout.event;
|
|
23
|
+
}
|
|
24
|
+
emit(events) {
|
|
25
|
+
for (let i = 0, len = events.length; i < len; i++) {
|
|
26
|
+
const e = events[i];
|
|
27
|
+
switch (e.type) {
|
|
28
|
+
case NotebookDiffViewEventType.LayoutChanged:
|
|
29
|
+
this._onDidChangeLayout.fire(e);
|
|
30
|
+
break;
|
|
31
|
+
case NotebookDiffViewEventType.CellLayoutChanged:
|
|
32
|
+
this._onDidChangeCellLayout.fire(e);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { NotebookDiffEditorEventDispatcher, NotebookDiffLayoutChangedEvent, NotebookDiffViewEventType };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = ".notebook-text-diff-editor{position:relative}.notebook-text-diff-editor .cell-body{display:flex;flex-direction:row}.notebook-text-diff-editor .webview-cover{user-select:auto;-webkit-user-select:initial}.notebook-text-diff-editor .cell-body .border-container{position:absolute;width:calc(100% - 32px)}.notebook-text-diff-editor .cell-body .border-container .bottom-border,.notebook-text-diff-editor .cell-body .border-container .top-border{position:absolute;width:100%}.notebook-text-diff-editor .cell-body .border-container .left-border,.notebook-text-diff-editor .cell-body .border-container .right-border{position:absolute}.notebook-text-diff-editor .cell-body .border-container .right-border{left:100%}.notebook-text-diff-editor .cell-body.right{flex-direction:row-reverse}.notebook-text-diff-editor .cell-body .diagonal-fill{display:none;width:50%}.notebook-text-diff-editor .cell-body .cell-diff-editor-container{width:100%}.notebook-text-diff-editor>.notebook-diff-list-view>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row{cursor:default}.notebook-text-diff-editor .cell-body .cell-diff-editor-container .editor-container.diff,.notebook-text-diff-editor .cell-body .cell-diff-editor-container .metadata-editor-container.diff,.notebook-text-diff-editor .cell-body .cell-diff-editor-container .output-editor-container.diff{width:100%}.notebook-text-diff-editor .cell-body .cell-diff-editor-container .editor-container.diff .monaco-diff-editor .diffOverview,.notebook-text-diff-editor .cell-body .cell-diff-editor-container .metadata-editor-container .monaco-diff-editor .diffOverview,.notebook-text-diff-editor .cell-body .cell-diff-editor-container .output-editor-container.diff .monaco-diff-editor .diffOverview{display:none}.notebook-text-diff-editor .cell-body .cell-diff-editor-container .editor-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container .metadata-editor-container{box-sizing:border-box}.notebook-text-diff-editor .cell-body.left .cell-diff-editor-container,.notebook-text-diff-editor .cell-body.left .diagonal-fill,.notebook-text-diff-editor .cell-body.right .cell-diff-editor-container,.notebook-text-diff-editor .cell-body.right .diagonal-fill{display:inline-block;width:50%}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container{cursor:default;height:24px}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-folding-indicator .codicon,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-folding-indicator .codicon{cursor:pointer;padding:4px 0 0 10px;visibility:visible}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container{align-items:center;display:flex;flex-direction:row}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-toolbar,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-toolbar{margin-left:auto}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-status,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-status{font-size:12px}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-status span,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-status span{line-height:21px;margin:0 0 0 8px}.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-status span.property-description,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-status span.property-description{font-style:italic}.notebook-text-diff-editor{overflow:hidden}.monaco-workbench .notebook-text-diff-editor>.notebook-diff-list-view>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row{overflow:visible!important}.monaco-workbench .notebook-text-diff-editor>.notebook-diff-list-view>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row,.monaco-workbench .notebook-text-diff-editor>.notebook-diff-list-view>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row.focused,.monaco-workbench .notebook-text-diff-editor>.notebook-diff-list-view>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row:hover{background-color:transparent!important;outline:none!important}.notebook-text-diff-editor .cell-diff-editor-container .editor-input-toolbar-container{margin:1px 2px;position:absolute;right:16px;top:16px}.monaco-workbench .notebook-text-diff-editor .cell-body{height:0}.monaco-workbench .notebook-text-diff-editor .cell-body .output-view-container{cursor:auto;position:relative;user-select:text;-webkit-user-select:text;white-space:normal}.monaco-workbench .notebook-text-diff-editor .cell-body.left .output-view-container .output-inner-container,.monaco-workbench .notebook-text-diff-editor .cell-body.right .output-view-container .output-inner-container{box-sizing:border-box;overflow-x:hidden;padding:0 8px;width:100%}.monaco-workbench .notebook-text-diff-editor .cell-body.left .output-view-container .output-inner-container,.monaco-workbench .notebook-text-diff-editor .cell-body.right .output-view-container .output-inner-container{padding:0 8px 0 32px}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-view-container .output-inner-container{box-sizing:border-box;overflow:hidden;padding:4px 8px 4px 32px;width:100%}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container .output-view-container .output-view-container-left{left:0;position:absolute;top:0}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container .output-view-container .output-view-container-right{left:50%;position:absolute;top:0}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container .output-view-container .output-view-container-left,.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container .output-view-container .output-view-container-right{display:inline-block;width:50%}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container .output-view-container .output-view-container-left div.foreground,.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container .output-view-container .output-view-container-right div.foreground{width:100%}.monaco-workbench .notebook-text-diff-editor .output-view-container>div.foreground{box-sizing:border-box;min-height:24px;width:100%}.monaco-workbench .notebook-text-diff-editor .output-view-container .error_message{color:red}.monaco-workbench .notebook-text-diff-editor .output-view-container .error>div{white-space:normal}.monaco-workbench .notebook-text-diff-editor .output-view-container .error pre.traceback{box-sizing:border-box;margin:0;padding:8px 0}.monaco-workbench .notebook-text-diff-editor .output-view-container .error .traceback>span{display:block}.monaco-workbench .notebook-text-diff-editor .output-view-container .display img{max-width:100%}.monaco-workbench .notebook-text-diff-editor .output-view-container .multi-mimetype-output{cursor:pointer;height:16px;left:8px;padding:2px 4px 4px 2px;position:absolute;top:4px;width:16px}.monaco-workbench .notebook-text-diff-editor .output-view-container .output-empty-view span{opacity:.7}.monaco-workbench .notebook-text-diff-editor .output-view-container .output-empty-view{font-style:italic;height:24px;margin:auto;padding-left:12px}.monaco-workbench .notebook-text-diff-editor .output-view-container pre{margin:4px 0}.monaco-workbench .notebook-text-diff-edito .monaco-list:focus-within .monaco-list-row.focused .codicon,.monaco-workbench .notebook-text-diff-editor .monaco-list:focus-within .monaco-list-row.selected .codicon{color:inherit}.monaco-workbench .notebook-text-diff-editor .output-view-container .output-view-container-metadata{position:relative}.notebook-text-diff-editor .cell-body .codicon-diff-insert,.notebook-text-diff-editor .cell-body .codicon-diff-remove{left:4px!important;width:15px!important}.monaco-workbench .notebook-text-diff-editor>.monaco-list>.monaco-scrollable-element>.scrollbar.visible{cursor:default;z-index:var(--z-index-notebook-scrollbar)}.notebook-text-diff-editor .notebook-overview-ruler-container{position:absolute;right:0;top:0}.notebook-text-diff-editor .notebook-overview-ruler-container .diffViewport{z-index:var(--notebook-diff-view-viewport-slider)}.notebook-text-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.notebook-text-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.notebook-text-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.notebook-text-diff-editor .cell-body .border-container .bottom-border,.notebook-text-diff-editor .cell-body .border-container .top-border,.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container,.notebook-text-diff-editor .cell-diff-editor-container .output-header-container{border-top:1px solid var(--vscode-notebook-cellBorderColor)}.notebook-text-diff-editor .cell-body .border-container .left-border{border-left:1px solid var(--vscode-notebook-cellBorderColor)}.notebook-text-diff-editor .cell-body .border-container .right-border{border-right:1px solid var(--vscode-notebook-cellBorderColor)}.notebook-text-diff-editor .monaco-list-row.focused .cell-body .border-container .bottom-border,.notebook-text-diff-editor .monaco-list-row.focused .cell-body .border-container .top-border{border-top:1px solid var(--vscode-notebook-focusedEditorBorder)}.notebook-text-diff-editor .monaco-list-row.focused .cell-body .border-container .left-border{border-left:1px solid var(--vscode-notebook-focusedEditorBorder)}.notebook-text-diff-editor .monaco-list-row.focused .cell-body .border-container .right-border{border-right:1px solid var(--vscode-notebook-focusedEditorBorder)}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container.modified .output-view-container .output-view-container-right div.foreground,.monaco-workbench .notebook-text-diff-editor .cell-body.right .output-info-container .output-view-container div.foreground,.monaco-workbench .notebook-text-diff-editor .cell-body.right .output-info-container .output-view-container div.output-empty-view,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-editor-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-editor-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-editor-container .monaco-editor .monaco-editor-background,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .metadata-header-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-editor-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-editor-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-editor-container .monaco-editor .monaco-editor-background,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .output-header-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .source-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .source-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.inserted .source-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-workbench .notebook-text-diff-editor .cell-body.full .output-info-container.modified .output-view-container .output-view-container-left div.foreground,.monaco-workbench .notebook-text-diff-editor .cell-body.left .output-info-container .output-view-container div.foreground,.monaco-workbench .notebook-text-diff-editor .cell-body.left .output-info-container .output-view-container div.output-empty-view,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-editor-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-editor-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-editor-container .monaco-editor .monaco-editor-background,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .metadata-header-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-editor-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-editor-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-editor-container .monaco-editor .monaco-editor-background,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .output-header-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .source-container,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .source-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container.removed .source-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-diffEditor-removedTextBackground)}.notebook-text-diff-editor .cell-body .cell-diff-editor-container .source-container .monaco-editor .margin,.notebook-text-diff-editor .cell-body .cell-diff-editor-container .source-container .monaco-editor .monaco-editor-background{background:var(--vscode-notebook-cellEditorBackground,var(--vscode-editor-background))}";
|
|
4
|
+
n(css,{});
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { IBulkEditService, ResourceTextEdit } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
4
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
5
|
+
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
6
|
+
import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
7
|
+
import { SideBySideDiffElementViewModel } from './diffElementViewModel.js';
|
|
8
|
+
import { NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED, NOTEBOOK_DIFF_CELL_INPUT } from './notebookDiffEditorBrowser.js';
|
|
9
|
+
import { NotebookTextDiffEditor } from './notebookDiffEditor.js';
|
|
10
|
+
import { openAsTextIcon, revertIcon, renderOutputIcon, previousChangeIcon, nextChangeIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
11
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
12
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
13
|
+
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
14
|
+
import { DEFAULT_EDITOR_ASSOCIATION } from 'vscode/vscode/vs/workbench/common/editor';
|
|
15
|
+
import { NOTEBOOK_DIFF_EDITOR_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
|
+
|
|
17
|
+
registerAction2(class extends Action2 {
|
|
18
|
+
constructor() {
|
|
19
|
+
super({
|
|
20
|
+
id: 'notebook.diff.switchToText',
|
|
21
|
+
icon: openAsTextIcon,
|
|
22
|
+
title: { value: ( localizeWithPath(
|
|
23
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
24
|
+
'notebook.diff.switchToText',
|
|
25
|
+
"Open Text Diff Editor"
|
|
26
|
+
)), original: 'Open Text Diff Editor' },
|
|
27
|
+
precondition: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)),
|
|
28
|
+
menu: [{
|
|
29
|
+
id: MenuId.EditorTitle,
|
|
30
|
+
group: 'navigation',
|
|
31
|
+
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
32
|
+
}]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async run(accessor) {
|
|
36
|
+
const editorService = accessor.get(IEditorService);
|
|
37
|
+
const activeEditor = editorService.activeEditorPane;
|
|
38
|
+
if (activeEditor && activeEditor instanceof NotebookTextDiffEditor) {
|
|
39
|
+
const diffEditorInput = activeEditor.input;
|
|
40
|
+
await editorService.openEditor({
|
|
41
|
+
original: { resource: diffEditorInput.original.resource },
|
|
42
|
+
modified: { resource: diffEditorInput.resource },
|
|
43
|
+
label: diffEditorInput.getName(),
|
|
44
|
+
options: {
|
|
45
|
+
preserveFocus: false,
|
|
46
|
+
override: DEFAULT_EDITOR_ASSOCIATION.id
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
registerAction2(class extends Action2 {
|
|
53
|
+
constructor() {
|
|
54
|
+
super({
|
|
55
|
+
id: 'notebook.diff.cell.revertMetadata',
|
|
56
|
+
title: ( localizeWithPath(
|
|
57
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
58
|
+
'notebook.diff.cell.revertMetadata',
|
|
59
|
+
"Revert Metadata"
|
|
60
|
+
)),
|
|
61
|
+
icon: revertIcon,
|
|
62
|
+
f1: false,
|
|
63
|
+
menu: {
|
|
64
|
+
id: MenuId.NotebookDiffCellMetadataTitle,
|
|
65
|
+
when: NOTEBOOK_DIFF_CELL_PROPERTY
|
|
66
|
+
},
|
|
67
|
+
precondition: NOTEBOOK_DIFF_CELL_PROPERTY
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
run(accessor, context) {
|
|
71
|
+
if (!context) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const original = context.cell.original;
|
|
75
|
+
const modified = context.cell.modified;
|
|
76
|
+
if (!original || !modified) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
modified.textModel.metadata = original.metadata;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
registerAction2(class extends Action2 {
|
|
83
|
+
constructor() {
|
|
84
|
+
super({
|
|
85
|
+
id: 'notebook.diff.cell.switchOutputRenderingStyleToText',
|
|
86
|
+
title: ( localizeWithPath(
|
|
87
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
88
|
+
'notebook.diff.cell.switchOutputRenderingStyleToText',
|
|
89
|
+
"Switch Output Rendering"
|
|
90
|
+
)),
|
|
91
|
+
icon: renderOutputIcon,
|
|
92
|
+
f1: false,
|
|
93
|
+
menu: {
|
|
94
|
+
id: MenuId.NotebookDiffCellOutputsTitle,
|
|
95
|
+
when: NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
run(accessor, context) {
|
|
100
|
+
if (!context) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
context.cell.renderOutput = !context.cell.renderOutput;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
registerAction2(class extends Action2 {
|
|
107
|
+
constructor() {
|
|
108
|
+
super({
|
|
109
|
+
id: 'notebook.diff.cell.revertOutputs',
|
|
110
|
+
title: ( localizeWithPath(
|
|
111
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
112
|
+
'notebook.diff.cell.revertOutputs',
|
|
113
|
+
"Revert Outputs"
|
|
114
|
+
)),
|
|
115
|
+
icon: revertIcon,
|
|
116
|
+
f1: false,
|
|
117
|
+
menu: {
|
|
118
|
+
id: MenuId.NotebookDiffCellOutputsTitle,
|
|
119
|
+
when: NOTEBOOK_DIFF_CELL_PROPERTY
|
|
120
|
+
},
|
|
121
|
+
precondition: NOTEBOOK_DIFF_CELL_PROPERTY
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
run(accessor, context) {
|
|
125
|
+
if (!context) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!(context.cell instanceof SideBySideDiffElementViewModel)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const original = context.cell.original;
|
|
132
|
+
const modified = context.cell.modified;
|
|
133
|
+
const modifiedCellIndex = context.cell.mainDocumentTextModel.cells.indexOf(modified.textModel);
|
|
134
|
+
if (modifiedCellIndex === -1) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
context.cell.mainDocumentTextModel.applyEdits([{
|
|
138
|
+
editType: 2 , index: modifiedCellIndex, outputs: original.outputs
|
|
139
|
+
}], true, undefined, () => undefined, undefined, true);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
registerAction2(class extends Action2 {
|
|
143
|
+
constructor() {
|
|
144
|
+
super({
|
|
145
|
+
id: 'notebook.diff.cell.revertInput',
|
|
146
|
+
title: ( localizeWithPath(
|
|
147
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
148
|
+
'notebook.diff.cell.revertInput',
|
|
149
|
+
"Revert Input"
|
|
150
|
+
)),
|
|
151
|
+
icon: revertIcon,
|
|
152
|
+
f1: false,
|
|
153
|
+
menu: {
|
|
154
|
+
id: MenuId.NotebookDiffCellInputTitle,
|
|
155
|
+
when: NOTEBOOK_DIFF_CELL_INPUT
|
|
156
|
+
},
|
|
157
|
+
precondition: NOTEBOOK_DIFF_CELL_INPUT
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
run(accessor, context) {
|
|
161
|
+
if (!context) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const original = context.cell.original;
|
|
165
|
+
const modified = context.cell.modified;
|
|
166
|
+
if (!original || !modified) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const bulkEditService = accessor.get(IBulkEditService);
|
|
170
|
+
return bulkEditService.apply([
|
|
171
|
+
( new ResourceTextEdit(
|
|
172
|
+
modified.uri,
|
|
173
|
+
{ range: modified.textModel.getFullModelRange(), text: original.textModel.getValue() }
|
|
174
|
+
)),
|
|
175
|
+
], { quotableLabel: 'Revert Notebook Cell Content Change' });
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
class ToggleRenderAction extends Action2 {
|
|
179
|
+
constructor(id, title, precondition, toggled, order, toggleOutputs, toggleMetadata) {
|
|
180
|
+
super({
|
|
181
|
+
id: id,
|
|
182
|
+
title,
|
|
183
|
+
precondition: precondition,
|
|
184
|
+
menu: [{
|
|
185
|
+
id: MenuId.EditorTitle,
|
|
186
|
+
group: 'notebook',
|
|
187
|
+
when: precondition,
|
|
188
|
+
order: order,
|
|
189
|
+
}],
|
|
190
|
+
toggled: toggled
|
|
191
|
+
});
|
|
192
|
+
this.toggleOutputs = toggleOutputs;
|
|
193
|
+
this.toggleMetadata = toggleMetadata;
|
|
194
|
+
}
|
|
195
|
+
async run(accessor) {
|
|
196
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
197
|
+
if (this.toggleOutputs !== undefined) {
|
|
198
|
+
const oldValue = configurationService.getValue('notebook.diff.ignoreOutputs');
|
|
199
|
+
configurationService.updateValue('notebook.diff.ignoreOutputs', !oldValue);
|
|
200
|
+
}
|
|
201
|
+
if (this.toggleMetadata !== undefined) {
|
|
202
|
+
const oldValue = configurationService.getValue('notebook.diff.ignoreMetadata');
|
|
203
|
+
configurationService.updateValue('notebook.diff.ignoreMetadata', !oldValue);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
registerAction2(class extends ToggleRenderAction {
|
|
208
|
+
constructor() {
|
|
209
|
+
super('notebook.diff.showOutputs', { value: ( localizeWithPath(
|
|
210
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
211
|
+
'notebook.diff.showOutputs',
|
|
212
|
+
"Show Outputs Differences"
|
|
213
|
+
)), original: 'Show Outputs Differences' }, ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)), ( ContextKeyExpr.notEquals('config.notebook.diff.ignoreOutputs', true)), 2, true, undefined);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
registerAction2(class extends ToggleRenderAction {
|
|
217
|
+
constructor() {
|
|
218
|
+
super('notebook.diff.showMetadata', { value: ( localizeWithPath(
|
|
219
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
220
|
+
'notebook.diff.showMetadata',
|
|
221
|
+
"Show Metadata Differences"
|
|
222
|
+
)), original: 'Show Metadata Differences' }, ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID)), ( ContextKeyExpr.notEquals('config.notebook.diff.ignoreMetadata', true)), 1, undefined, true);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
registerAction2(class extends Action2 {
|
|
226
|
+
constructor() {
|
|
227
|
+
super({
|
|
228
|
+
id: 'notebook.diff.action.previous',
|
|
229
|
+
title: ( localizeWithPath(
|
|
230
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
231
|
+
'notebook.diff.action.previous.title',
|
|
232
|
+
"Show Previous Change"
|
|
233
|
+
)),
|
|
234
|
+
icon: previousChangeIcon,
|
|
235
|
+
f1: false,
|
|
236
|
+
keybinding: {
|
|
237
|
+
primary: 1024 | 512 | 61 ,
|
|
238
|
+
weight: 200 ,
|
|
239
|
+
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
240
|
+
},
|
|
241
|
+
menu: {
|
|
242
|
+
id: MenuId.EditorTitle,
|
|
243
|
+
group: 'navigation',
|
|
244
|
+
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
run(accessor) {
|
|
249
|
+
const editorService = accessor.get(IEditorService);
|
|
250
|
+
if (editorService.activeEditorPane?.getId() !== NOTEBOOK_DIFF_EDITOR_ID) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const editor = editorService.activeEditorPane.getControl();
|
|
254
|
+
editor?.previousChange();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
registerAction2(class extends Action2 {
|
|
258
|
+
constructor() {
|
|
259
|
+
super({
|
|
260
|
+
id: 'notebook.diff.action.next',
|
|
261
|
+
title: ( localizeWithPath(
|
|
262
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
263
|
+
'notebook.diff.action.next.title',
|
|
264
|
+
"Show Next Change"
|
|
265
|
+
)),
|
|
266
|
+
icon: nextChangeIcon,
|
|
267
|
+
f1: false,
|
|
268
|
+
keybinding: {
|
|
269
|
+
primary: 512 | 61 ,
|
|
270
|
+
weight: 200 ,
|
|
271
|
+
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
272
|
+
},
|
|
273
|
+
menu: {
|
|
274
|
+
id: MenuId.EditorTitle,
|
|
275
|
+
group: 'navigation',
|
|
276
|
+
when: ( ActiveEditorContext.isEqualTo(NotebookTextDiffEditor.ID))
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
run(accessor) {
|
|
281
|
+
const editorService = accessor.get(IEditorService);
|
|
282
|
+
if (editorService.activeEditorPane?.getId() !== NOTEBOOK_DIFF_EDITOR_ID) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const editor = editorService.activeEditorPane.getControl();
|
|
286
|
+
editor?.nextChange();
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
( Registry.as(Extensions.Configuration)).registerConfiguration({
|
|
290
|
+
id: 'notebook',
|
|
291
|
+
order: 100,
|
|
292
|
+
type: 'object',
|
|
293
|
+
'properties': {
|
|
294
|
+
'notebook.diff.ignoreMetadata': {
|
|
295
|
+
type: 'boolean',
|
|
296
|
+
default: false,
|
|
297
|
+
markdownDescription: ( localizeWithPath(
|
|
298
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
299
|
+
'notebook.diff.ignoreMetadata',
|
|
300
|
+
"Hide Metadata Differences"
|
|
301
|
+
))
|
|
302
|
+
},
|
|
303
|
+
'notebook.diff.ignoreOutputs': {
|
|
304
|
+
type: 'boolean',
|
|
305
|
+
default: false,
|
|
306
|
+
markdownDescription: ( localizeWithPath(
|
|
307
|
+
'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions',
|
|
308
|
+
'notebook.diff.ignoreOutputs',
|
|
309
|
+
"Hide Outputs Differences"
|
|
310
|
+
))
|
|
311
|
+
},
|
|
312
|
+
}
|
|
313
|
+
});
|