@codingame/monaco-vscode-notebook-service-override 25.1.2 → 26.0.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/index.js +2 -2
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +112 -94
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +95 -96
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +28 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +15 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +22 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +25 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +37 -44
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +211 -115
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +16 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +5 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +57 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +24 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +78 -76
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +14 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +43 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +65 -34
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +19 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +6 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +15 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +28 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +211 -170
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +158 -156
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +109 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +28 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +26 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +23 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +72 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +233 -186
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +22 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +239 -151
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +85 -86
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +25 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +13 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +8 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +218 -196
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +258 -255
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +106 -98
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +63 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +55 -64
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +21 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +149 -129
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +286 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +82 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +452 -363
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +44 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +9 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +203 -207
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +148 -104
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +19 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +9 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +34 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +29 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +70 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +31 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +78 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +37 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +214 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +38 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.js +24 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.js +2 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +26 -15
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +35 -15
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +468 -258
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +113 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +74 -58
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +7 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.js +72 -16
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +70 -51
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +195 -149
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +60 -81
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +7 -12
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +104 -66
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +115 -77
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +42 -26
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +19 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -198
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +0 -333
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -261
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as DOM from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
|
|
2
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
3
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
4
|
+
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
5
|
+
import { IEditorOpenContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
6
|
+
import { IEditorGroup } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService";
|
|
7
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
8
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
9
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
10
|
+
import { INotebookEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service";
|
|
11
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
12
|
+
import { EditorPane } from "@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorPane";
|
|
13
|
+
import { NotebookOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookOptions";
|
|
14
|
+
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
15
|
+
import { NotebookMultiDiffEditorInput } from "./notebookMultiDiffEditorInput.js";
|
|
16
|
+
import type { IMultiDiffEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl";
|
|
17
|
+
import type { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
18
|
+
import { type IDiffElementViewModelBase } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel";
|
|
19
|
+
export declare class NotebookMultiTextDiffEditor extends EditorPane {
|
|
20
|
+
private readonly instantiationService;
|
|
21
|
+
private readonly _parentContextKeyService;
|
|
22
|
+
private readonly notebookEditorWorkerService;
|
|
23
|
+
private readonly configurationService;
|
|
24
|
+
private readonly notebookService;
|
|
25
|
+
private _multiDiffEditorWidget?;
|
|
26
|
+
static readonly ID: string;
|
|
27
|
+
private _fontInfo;
|
|
28
|
+
protected _scopeContextKeyService: IContextKeyService;
|
|
29
|
+
private readonly modelSpecificResources;
|
|
30
|
+
private _model?;
|
|
31
|
+
private viewModel?;
|
|
32
|
+
private widgetViewModel?;
|
|
33
|
+
get textModel(): import("../../common/model/notebookTextModel.js").NotebookTextModel | undefined;
|
|
34
|
+
private _notebookOptions;
|
|
35
|
+
get notebookOptions(): NotebookOptions;
|
|
36
|
+
private readonly ctxAllCollapsed;
|
|
37
|
+
private readonly ctxHasUnchangedCells;
|
|
38
|
+
private readonly ctxHiddenUnchangedCells;
|
|
39
|
+
constructor(group: IEditorGroup, instantiationService: IInstantiationService, themeService: IThemeService, _parentContextKeyService: IContextKeyService, notebookEditorWorkerService: INotebookEditorWorkerService, configurationService: IConfigurationService, telemetryService: ITelemetryService, storageService: IStorageService, notebookService: INotebookService);
|
|
40
|
+
private get fontInfo();
|
|
41
|
+
layout(dimension: DOM.Dimension, position?: DOM.IDomPosition): void;
|
|
42
|
+
private createFontInfo;
|
|
43
|
+
protected createEditor(parent: HTMLElement): void;
|
|
44
|
+
setInput(input: NotebookMultiDiffEditorInput, options: IMultiDiffEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void>;
|
|
45
|
+
private _detachModel;
|
|
46
|
+
_generateFontFamily(): string;
|
|
47
|
+
setOptions(options: IMultiDiffEditorOptions | undefined): void;
|
|
48
|
+
getControl(): import("@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget").DiffEditorWidget | undefined;
|
|
49
|
+
focus(): void;
|
|
50
|
+
hasFocus(): boolean;
|
|
51
|
+
clearInput(): void;
|
|
52
|
+
expandAll(): void;
|
|
53
|
+
collapseAll(): void;
|
|
54
|
+
hideUnchanged(): void;
|
|
55
|
+
showUnchanged(): void;
|
|
56
|
+
getDiffElementViewModel(uri: URI): IDiffElementViewModelBase | undefined;
|
|
57
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
4
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
5
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
6
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
7
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
9
|
+
import { INotebookEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service';
|
|
10
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
|
+
import { createBareFontInfoFromRawSettings } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/fontInfoFromSettings';
|
|
12
|
+
import { PixelRatio } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/pixelRatio';
|
|
13
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
14
|
+
import { EditorPane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
15
|
+
import { NOTEBOOK_MULTI_DIFF_EDITOR_ID, CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
|
+
import { FontMeasurements } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/config/fontMeasurements';
|
|
17
|
+
import { NotebookOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookOptions';
|
|
18
|
+
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
19
|
+
import { NotebookMultiDiffEditorWidgetInput } from './notebookMultiDiffEditorInput.js';
|
|
20
|
+
import { MultiDiffEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget';
|
|
21
|
+
import { ResourceLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/labels';
|
|
22
|
+
import { INotebookDocumentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/notebook/common/notebookDocumentService.service';
|
|
23
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
24
|
+
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
25
|
+
import { getIconClassesForLanguageId } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/getIconClasses';
|
|
26
|
+
import { NotebookDiffViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel';
|
|
27
|
+
import { NotebookDiffEditorEventDispatcher } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/diff/eventDispatcher';
|
|
28
|
+
import { NOTEBOOK_DIFF_CELLS_COLLAPSED, NOTEBOOK_DIFF_HAS_UNCHANGED_CELLS, NOTEBOOK_DIFF_UNCHANGED_CELLS_HIDDEN } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser';
|
|
29
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
30
|
+
import { DiffEditorHeightCalculatorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator';
|
|
31
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
32
|
+
import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
|
|
33
|
+
|
|
34
|
+
var NotebookMultiTextDiffEditor_1;
|
|
35
|
+
let NotebookMultiTextDiffEditor = class NotebookMultiTextDiffEditor extends EditorPane {
|
|
36
|
+
static {
|
|
37
|
+
NotebookMultiTextDiffEditor_1 = this;
|
|
38
|
+
}
|
|
39
|
+
static {
|
|
40
|
+
this.ID = NOTEBOOK_MULTI_DIFF_EDITOR_ID;
|
|
41
|
+
}
|
|
42
|
+
get textModel() {
|
|
43
|
+
return this._model?.modified.notebook;
|
|
44
|
+
}
|
|
45
|
+
get notebookOptions() {
|
|
46
|
+
return this._notebookOptions;
|
|
47
|
+
}
|
|
48
|
+
constructor(
|
|
49
|
+
group,
|
|
50
|
+
instantiationService,
|
|
51
|
+
themeService,
|
|
52
|
+
_parentContextKeyService,
|
|
53
|
+
notebookEditorWorkerService,
|
|
54
|
+
configurationService,
|
|
55
|
+
telemetryService,
|
|
56
|
+
storageService,
|
|
57
|
+
notebookService
|
|
58
|
+
) {
|
|
59
|
+
super(
|
|
60
|
+
NotebookMultiTextDiffEditor_1.ID,
|
|
61
|
+
group,
|
|
62
|
+
telemetryService,
|
|
63
|
+
themeService,
|
|
64
|
+
storageService
|
|
65
|
+
);
|
|
66
|
+
this.instantiationService = instantiationService;
|
|
67
|
+
this._parentContextKeyService = _parentContextKeyService;
|
|
68
|
+
this.notebookEditorWorkerService = notebookEditorWorkerService;
|
|
69
|
+
this.configurationService = configurationService;
|
|
70
|
+
this.notebookService = notebookService;
|
|
71
|
+
this.modelSpecificResources = this._register(( new DisposableStore()));
|
|
72
|
+
this.ctxAllCollapsed = this._parentContextKeyService.createKey(NOTEBOOK_DIFF_CELLS_COLLAPSED.key, false);
|
|
73
|
+
this.ctxHasUnchangedCells = this._parentContextKeyService.createKey(NOTEBOOK_DIFF_HAS_UNCHANGED_CELLS.key, false);
|
|
74
|
+
this.ctxHiddenUnchangedCells = this._parentContextKeyService.createKey(NOTEBOOK_DIFF_UNCHANGED_CELLS_HIDDEN.key, true);
|
|
75
|
+
this._notebookOptions = instantiationService.createInstance(NotebookOptions, this.window, false, undefined);
|
|
76
|
+
this._register(this._notebookOptions);
|
|
77
|
+
}
|
|
78
|
+
get fontInfo() {
|
|
79
|
+
if (!this._fontInfo) {
|
|
80
|
+
this._fontInfo = this.createFontInfo();
|
|
81
|
+
}
|
|
82
|
+
return this._fontInfo;
|
|
83
|
+
}
|
|
84
|
+
layout(dimension, position) {
|
|
85
|
+
this._multiDiffEditorWidget.layout(dimension);
|
|
86
|
+
}
|
|
87
|
+
createFontInfo() {
|
|
88
|
+
const editorOptions = this.configurationService.getValue("editor");
|
|
89
|
+
return FontMeasurements.readFontInfo(
|
|
90
|
+
this.window,
|
|
91
|
+
createBareFontInfoFromRawSettings(editorOptions, PixelRatio.getInstance(this.window).value)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
createEditor(parent) {
|
|
95
|
+
this._multiDiffEditorWidget = this._register(this.instantiationService.createInstance(
|
|
96
|
+
MultiDiffEditorWidget,
|
|
97
|
+
parent,
|
|
98
|
+
this.instantiationService.createInstance(WorkbenchUIElementFactory)
|
|
99
|
+
));
|
|
100
|
+
this._register(this._multiDiffEditorWidget.onDidChangeActiveControl(() => {
|
|
101
|
+
this._onDidChangeControl.fire();
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
async setInput(input, options, context, token) {
|
|
105
|
+
super.setInput(input, options, context, token);
|
|
106
|
+
const model = await input.resolve();
|
|
107
|
+
if (this._model !== model) {
|
|
108
|
+
this._detachModel();
|
|
109
|
+
this._model = model;
|
|
110
|
+
}
|
|
111
|
+
const eventDispatcher = this.modelSpecificResources.add(( new NotebookDiffEditorEventDispatcher()));
|
|
112
|
+
const diffEditorHeightCalculator = this.instantiationService.createInstance(DiffEditorHeightCalculatorService, this.fontInfo.lineHeight);
|
|
113
|
+
this.viewModel = this.modelSpecificResources.add(( new NotebookDiffViewModel(
|
|
114
|
+
model,
|
|
115
|
+
this.notebookEditorWorkerService,
|
|
116
|
+
this.configurationService,
|
|
117
|
+
eventDispatcher,
|
|
118
|
+
this.notebookService,
|
|
119
|
+
diffEditorHeightCalculator,
|
|
120
|
+
undefined,
|
|
121
|
+
true
|
|
122
|
+
)));
|
|
123
|
+
await this.viewModel.computeDiff(this.modelSpecificResources.add(( new CancellationTokenSource())).token);
|
|
124
|
+
this.ctxHasUnchangedCells.set(this.viewModel.hasUnchangedCells);
|
|
125
|
+
this.ctxHasUnchangedCells.set(this.viewModel.hasUnchangedCells);
|
|
126
|
+
const widgetInput = this.modelSpecificResources.add(
|
|
127
|
+
NotebookMultiDiffEditorWidgetInput.createInput(this.viewModel, this.instantiationService)
|
|
128
|
+
);
|
|
129
|
+
this.widgetViewModel = this.modelSpecificResources.add(await widgetInput.getViewModel());
|
|
130
|
+
const itemsWeHaveSeen = ( new WeakSet());
|
|
131
|
+
this.modelSpecificResources.add(autorun(reader => {
|
|
132
|
+
if (!this.widgetViewModel || !this.viewModel) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const items = this.widgetViewModel.items.read(reader);
|
|
136
|
+
const diffItems = this.viewModel.value;
|
|
137
|
+
if (items.length !== diffItems.length) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
transaction(tx => {
|
|
141
|
+
items.forEach(item => {
|
|
142
|
+
if (( itemsWeHaveSeen.has(item))) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
itemsWeHaveSeen.add(item);
|
|
146
|
+
const diffItem = diffItems.find(
|
|
147
|
+
d => d.modifiedUri?.toString() === item.modifiedUri?.toString() && d.originalUri?.toString() === item.originalUri?.toString()
|
|
148
|
+
);
|
|
149
|
+
if (diffItem && diffItem.type === "unchanged") {
|
|
150
|
+
item.collapsed.set(true, tx);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}));
|
|
155
|
+
this._multiDiffEditorWidget.setViewModel(this.widgetViewModel);
|
|
156
|
+
}
|
|
157
|
+
_detachModel() {
|
|
158
|
+
this.viewModel = undefined;
|
|
159
|
+
this.modelSpecificResources.clear();
|
|
160
|
+
}
|
|
161
|
+
_generateFontFamily() {
|
|
162
|
+
return this.fontInfo.fontFamily ?? `"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace`;
|
|
163
|
+
}
|
|
164
|
+
setOptions(options) {
|
|
165
|
+
super.setOptions(options);
|
|
166
|
+
}
|
|
167
|
+
getControl() {
|
|
168
|
+
return this._multiDiffEditorWidget.getActiveControl();
|
|
169
|
+
}
|
|
170
|
+
focus() {
|
|
171
|
+
super.focus();
|
|
172
|
+
this._multiDiffEditorWidget?.getActiveControl()?.focus();
|
|
173
|
+
}
|
|
174
|
+
hasFocus() {
|
|
175
|
+
return this._multiDiffEditorWidget?.getActiveControl()?.hasTextFocus() || super.hasFocus();
|
|
176
|
+
}
|
|
177
|
+
clearInput() {
|
|
178
|
+
super.clearInput();
|
|
179
|
+
this._multiDiffEditorWidget.setViewModel(undefined);
|
|
180
|
+
this.modelSpecificResources.clear();
|
|
181
|
+
this.viewModel = undefined;
|
|
182
|
+
this.widgetViewModel = undefined;
|
|
183
|
+
}
|
|
184
|
+
expandAll() {
|
|
185
|
+
if (this.widgetViewModel) {
|
|
186
|
+
this.widgetViewModel.expandAll();
|
|
187
|
+
this.ctxAllCollapsed.set(false);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
collapseAll() {
|
|
191
|
+
if (this.widgetViewModel) {
|
|
192
|
+
this.widgetViewModel.collapseAll();
|
|
193
|
+
this.ctxAllCollapsed.set(true);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
hideUnchanged() {
|
|
197
|
+
if (this.viewModel) {
|
|
198
|
+
this.viewModel.includeUnchanged = false;
|
|
199
|
+
this.ctxHiddenUnchangedCells.set(true);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
showUnchanged() {
|
|
203
|
+
if (this.viewModel) {
|
|
204
|
+
this.viewModel.includeUnchanged = true;
|
|
205
|
+
this.ctxHiddenUnchangedCells.set(false);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
getDiffElementViewModel(uri) {
|
|
209
|
+
if (uri.scheme === Schemas.vscodeNotebookCellOutput || uri.scheme === Schemas.vscodeNotebookCellOutputDiff || uri.scheme === Schemas.vscodeNotebookCellMetadata || uri.scheme === Schemas.vscodeNotebookCellMetadataDiff) {
|
|
210
|
+
const data = CellUri.parseCellPropertyUri(uri, uri.scheme);
|
|
211
|
+
if (data) {
|
|
212
|
+
uri = CellUri.generate(data.notebook, data.handle);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (uri.scheme === Schemas.vscodeNotebookMetadata) {
|
|
216
|
+
return this.viewModel?.items.find(
|
|
217
|
+
item => item.type === "modifiedMetadata" || item.type === "unchangedMetadata"
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return this.viewModel?.items.find(c => {
|
|
221
|
+
switch (c.type) {
|
|
222
|
+
case "delete":
|
|
223
|
+
return c.original?.uri.toString() === ( uri.toString());
|
|
224
|
+
case "insert":
|
|
225
|
+
return c.modified?.uri.toString() === ( uri.toString());
|
|
226
|
+
case "modified":
|
|
227
|
+
case "unchanged":
|
|
228
|
+
return c.modified?.uri.toString() === ( uri.toString()) || c.original?.uri.toString() === ( uri.toString());
|
|
229
|
+
default:
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
NotebookMultiTextDiffEditor = NotebookMultiTextDiffEditor_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IThemeService)), ( __param(3, IContextKeyService)), ( __param(4, INotebookEditorWorkerService)), ( __param(5, IConfigurationService)), ( __param(6, ITelemetryService)), ( __param(7, IStorageService)), ( __param(8, INotebookService))], NotebookMultiTextDiffEditor));
|
|
236
|
+
let WorkbenchUIElementFactory = class WorkbenchUIElementFactory {
|
|
237
|
+
constructor(_instantiationService, notebookDocumentService, notebookService) {
|
|
238
|
+
this._instantiationService = _instantiationService;
|
|
239
|
+
this.notebookDocumentService = notebookDocumentService;
|
|
240
|
+
this.notebookService = notebookService;
|
|
241
|
+
}
|
|
242
|
+
createResourceLabel(element) {
|
|
243
|
+
const label = this._instantiationService.createInstance(ResourceLabel, element, {});
|
|
244
|
+
const that = this;
|
|
245
|
+
return {
|
|
246
|
+
setUri(uri, options = {}) {
|
|
247
|
+
if (!uri) {
|
|
248
|
+
label.element.clear();
|
|
249
|
+
} else {
|
|
250
|
+
let name = "";
|
|
251
|
+
let description = "";
|
|
252
|
+
let extraClasses = undefined;
|
|
253
|
+
if (uri.scheme === Schemas.vscodeNotebookCell) {
|
|
254
|
+
const notebookDocument = uri.scheme === Schemas.vscodeNotebookCell ? that.notebookDocumentService.getNotebook(uri) : undefined;
|
|
255
|
+
const cellIndex = Schemas.vscodeNotebookCell ? that.notebookDocumentService.getNotebook(uri)?.getCellIndex(uri) : undefined;
|
|
256
|
+
if (notebookDocument && cellIndex !== undefined) {
|
|
257
|
+
name = ( localize(9824, "Cell {0}", `${cellIndex + 1}`));
|
|
258
|
+
const nb = notebookDocument ? that.notebookService.getNotebookTextModel(notebookDocument?.uri) : undefined;
|
|
259
|
+
const cellLanguage = nb && cellIndex !== undefined ? nb.cells[cellIndex].language : undefined;
|
|
260
|
+
extraClasses = cellLanguage ? getIconClassesForLanguageId(cellLanguage) : undefined;
|
|
261
|
+
}
|
|
262
|
+
} else if (uri.scheme === Schemas.vscodeNotebookCellMetadata || uri.scheme === Schemas.vscodeNotebookCellMetadataDiff) {
|
|
263
|
+
description = ( localize(9825, "Metadata"));
|
|
264
|
+
} else if (uri.scheme === Schemas.vscodeNotebookCellOutput || uri.scheme === Schemas.vscodeNotebookCellOutputDiff) {
|
|
265
|
+
description = ( localize(9826, "Output"));
|
|
266
|
+
}
|
|
267
|
+
label.element.setResource({
|
|
268
|
+
name,
|
|
269
|
+
description
|
|
270
|
+
}, {
|
|
271
|
+
strikethrough: options.strikethrough,
|
|
272
|
+
forceLabel: true,
|
|
273
|
+
hideIcon: !extraClasses,
|
|
274
|
+
extraClasses
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
dispose() {
|
|
279
|
+
label.dispose();
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
WorkbenchUIElementFactory = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, INotebookDocumentService)), ( __param(2, INotebookService))], WorkbenchUIElementFactory));
|
|
285
|
+
|
|
286
|
+
export { NotebookMultiTextDiffEditor };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
3
|
+
import { ITextResourceConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service";
|
|
4
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { MultiDiffEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput";
|
|
6
|
+
import { IResolvedMultiDiffSource, type IMultiDiffSourceResolver } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService";
|
|
7
|
+
import { IMultiDiffSourceResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service";
|
|
8
|
+
import { NotebookDiffViewModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel";
|
|
9
|
+
import { NotebookDiffEditorInput } from "../../common/notebookDiffEditorInput.js";
|
|
10
|
+
import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
11
|
+
export declare const NotebookMultiDiffEditorScheme = "multi-cell-notebook-diff-editor";
|
|
12
|
+
export declare class NotebookMultiDiffEditorInput extends NotebookDiffEditorInput {
|
|
13
|
+
static readonly ID: string;
|
|
14
|
+
static create(instantiationService: IInstantiationService, resource: URI, name: string | undefined, description: string | undefined, originalResource: URI, viewType: string): NotebookMultiDiffEditorInput;
|
|
15
|
+
}
|
|
16
|
+
export declare class NotebookMultiDiffEditorWidgetInput extends MultiDiffEditorInput implements IMultiDiffSourceResolver {
|
|
17
|
+
private readonly notebookDiffViewModel;
|
|
18
|
+
static createInput(notebookDiffViewModel: NotebookDiffViewModel, instantiationService: IInstantiationService): NotebookMultiDiffEditorWidgetInput;
|
|
19
|
+
constructor(multiDiffSource: URI, notebookDiffViewModel: NotebookDiffViewModel, _textModelService: ITextModelService, _textResourceConfigurationService: ITextResourceConfigurationService, _instantiationService: IInstantiationService, _multiDiffSourceResolverService: IMultiDiffSourceResolverService, _textFileService: ITextFileService);
|
|
20
|
+
canHandleUri(uri: URI): boolean;
|
|
21
|
+
resolveDiffSource(_: URI): Promise<IResolvedMultiDiffSource>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
+
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
5
|
+
import { ITextResourceConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service';
|
|
6
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
+
import { MultiDiffEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput';
|
|
8
|
+
import { IMultiDiffSourceResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service';
|
|
9
|
+
import { NotebookDiffEditorInput } from '../../common/notebookDiffEditorInput.js';
|
|
10
|
+
import { NotebookEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
11
|
+
import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
12
|
+
|
|
13
|
+
var NotebookMultiDiffEditorWidgetInput_1;
|
|
14
|
+
const NotebookMultiDiffEditorScheme = "multi-cell-notebook-diff-editor";
|
|
15
|
+
class NotebookMultiDiffEditorInput extends NotebookDiffEditorInput {
|
|
16
|
+
static {
|
|
17
|
+
this.ID = "workbench.input.multiDiffNotebookInput";
|
|
18
|
+
}
|
|
19
|
+
static create(
|
|
20
|
+
instantiationService,
|
|
21
|
+
resource,
|
|
22
|
+
name,
|
|
23
|
+
description,
|
|
24
|
+
originalResource,
|
|
25
|
+
viewType
|
|
26
|
+
) {
|
|
27
|
+
const original = NotebookEditorInput.getOrCreate(instantiationService, originalResource, undefined, viewType);
|
|
28
|
+
const modified = NotebookEditorInput.getOrCreate(instantiationService, resource, undefined, viewType);
|
|
29
|
+
return instantiationService.createInstance(
|
|
30
|
+
NotebookMultiDiffEditorInput,
|
|
31
|
+
name,
|
|
32
|
+
description,
|
|
33
|
+
original,
|
|
34
|
+
modified,
|
|
35
|
+
viewType
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
let NotebookMultiDiffEditorWidgetInput = NotebookMultiDiffEditorWidgetInput_1 = class NotebookMultiDiffEditorWidgetInput extends MultiDiffEditorInput {
|
|
40
|
+
static createInput(notebookDiffViewModel, instantiationService) {
|
|
41
|
+
const multiDiffSource = ( URI.parse(`${NotebookMultiDiffEditorScheme}:${( ( new Date()).getMilliseconds().toString()) + ( Math.random().toString())}`));
|
|
42
|
+
return instantiationService.createInstance(
|
|
43
|
+
NotebookMultiDiffEditorWidgetInput_1,
|
|
44
|
+
multiDiffSource,
|
|
45
|
+
notebookDiffViewModel
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
constructor(
|
|
49
|
+
multiDiffSource,
|
|
50
|
+
notebookDiffViewModel,
|
|
51
|
+
_textModelService,
|
|
52
|
+
_textResourceConfigurationService,
|
|
53
|
+
_instantiationService,
|
|
54
|
+
_multiDiffSourceResolverService,
|
|
55
|
+
_textFileService
|
|
56
|
+
) {
|
|
57
|
+
super(
|
|
58
|
+
multiDiffSource,
|
|
59
|
+
undefined,
|
|
60
|
+
undefined,
|
|
61
|
+
true,
|
|
62
|
+
_textModelService,
|
|
63
|
+
_textResourceConfigurationService,
|
|
64
|
+
_instantiationService,
|
|
65
|
+
_multiDiffSourceResolverService,
|
|
66
|
+
_textFileService
|
|
67
|
+
);
|
|
68
|
+
this.notebookDiffViewModel = notebookDiffViewModel;
|
|
69
|
+
this._register(_multiDiffSourceResolverService.registerResolver(this));
|
|
70
|
+
}
|
|
71
|
+
canHandleUri(uri) {
|
|
72
|
+
return ( uri.toString()) === ( this.multiDiffSource.toString());
|
|
73
|
+
}
|
|
74
|
+
async resolveDiffSource(_) {
|
|
75
|
+
return {
|
|
76
|
+
resources: this.notebookDiffViewModel
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
NotebookMultiDiffEditorWidgetInput = NotebookMultiDiffEditorWidgetInput_1 = ( __decorate([( __param(2, ITextModelService)), ( __param(3, ITextResourceConfigurationService)), ( __param(4, IInstantiationService)), ( __param(5, IMultiDiffSourceResolverService)), ( __param(6, ITextFileService))], NotebookMultiDiffEditorWidgetInput));
|
|
81
|
+
|
|
82
|
+
export { NotebookMultiDiffEditorInput, NotebookMultiDiffEditorScheme, NotebookMultiDiffEditorWidgetInput };
|