@codingame/monaco-vscode-view-common-service-override 11.1.2 → 12.0.0
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.d.ts +3 -1
- package/index.js +110 -1
- package/package.json +64 -10
- package/service-override/tools/editorAssets.d.ts +1 -0
- package/service-override/tools/editorAssets.js +5 -0
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.d.ts +21 -0
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.js +2 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.d.ts +2 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +1 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.d.ts +18 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +1 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.d.ts +7 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +116 -115
- package/vscode/src/vs/workbench/browser/actions/listCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +120 -125
- package/vscode/src/vs/workbench/browser/actions/navigationActions.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +81 -74
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +216 -250
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.d.ts +21 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +26 -25
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.d.ts +32 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +10 -8
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +58 -64
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +48 -38
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +19 -40
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +7 -5
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +6 -4
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +6 -4
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +16 -16
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +15 -10
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +27 -25
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +4 -2
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +6 -386
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +385 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.d.ts +105 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +50 -62
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +16 -15
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +15 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +15 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +3 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +37 -39
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +22 -21
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +3 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.d.ts +117 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +57 -53
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +27 -25
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +15 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +4 -3
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +28 -28
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -5
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +2 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +54 -56
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +48 -38
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +19 -30
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +3 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.d.ts +139 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +58 -56
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +4 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +2 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +28 -28
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +3 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +15 -13
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +10 -8
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.d.ts +6 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +3 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.d.ts +60 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +64 -63
- package/vscode/src/vs/workbench/services/history/browser/historyService.d.ts +184 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +154 -148
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +1 -1
- package/vscode/src/vs/workbench/services/progress/browser/progressService.d.ts +36 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +59 -54
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.d.ts +34 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +4 -3
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +71 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.d.ts +122 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +86 -90
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.d.ts +80 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +58 -64
- package/override/vs/workbench/browser/parts/editor/textEditor.js +0 -5
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -11
- package/tools/editorAssets.js +0 -4
- package/tools/url.js +0 -10
- package/viewCommon.js +0 -109
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Dimension } from "vscode/vscode/vs/base/browser/dom";
|
|
2
|
+
import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
|
|
3
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
4
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
5
|
+
import { IObservable } from "vscode/vscode/vs/base/common/observable";
|
|
6
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
7
|
+
import { ICodeEditor } from "vscode/vscode/vs/editor/browser/editorBrowser";
|
|
8
|
+
import { ICodeEditorService } from "vscode/vscode/vs/editor/browser/services/codeEditorService";
|
|
9
|
+
import { IEditorOptions as ICodeEditorOptions } from "vscode/vscode/vs/editor/common/config/editorOptions";
|
|
10
|
+
import { ICodeEditorViewState } from "vscode/vscode/vs/editor/common/editorCommon";
|
|
11
|
+
import { ITextResourceConfigurationService } from "vscode/vscode/vs/editor/common/services/textResourceConfiguration";
|
|
12
|
+
import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
|
|
13
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
14
|
+
import { IEditorOptions, ITextEditorOptions } from "vscode/vscode/vs/platform/editor/common/editor";
|
|
15
|
+
import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
|
|
16
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
17
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
18
|
+
import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
19
|
+
import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
|
|
20
|
+
import { AbstractTextEditor } from "@codingame/monaco-vscode-219d9a5f-b446-507b-a188-1178a0867c75-common/vscode/vs/workbench/browser/parts/editor/textEditor";
|
|
21
|
+
import { IEditorOpenContext } from "vscode/vscode/vs/workbench/common/editor";
|
|
22
|
+
import { EditorInput } from "vscode/vscode/vs/workbench/common/editor/editorInput";
|
|
23
|
+
import { IMergeEditorInputModel } from "@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel";
|
|
24
|
+
import { MergeEditorModel } from "@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel";
|
|
25
|
+
import { MergeEditorViewModel } from "./viewModel.js";
|
|
26
|
+
import { MergeEditorLayoutKind } from "@codingame/monaco-vscode-897bebad-39df-57cb-8a57-36a271d038be-common/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor";
|
|
27
|
+
import { IEditorGroup } from "vscode/vscode/vs/workbench/services/editor/common/editorGroupsService";
|
|
28
|
+
import { IEditorGroupsService } from "vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
29
|
+
import { IEditorResolverService } from "vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service";
|
|
30
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
31
|
+
export declare class MergeEditor extends AbstractTextEditor<IMergeEditorViewState> {
|
|
32
|
+
private readonly contextKeyService;
|
|
33
|
+
private readonly _configurationService;
|
|
34
|
+
private readonly _codeEditorService;
|
|
35
|
+
private readonly configurationService;
|
|
36
|
+
static readonly ID = "mergeEditor";
|
|
37
|
+
private readonly _sessionDisposables;
|
|
38
|
+
private readonly _viewModel;
|
|
39
|
+
get viewModel(): IObservable<MergeEditorViewModel | undefined>;
|
|
40
|
+
private rootHtmlElement;
|
|
41
|
+
private readonly _grid;
|
|
42
|
+
private readonly input1View;
|
|
43
|
+
private readonly baseView;
|
|
44
|
+
private readonly baseViewOptions;
|
|
45
|
+
private readonly input2View;
|
|
46
|
+
private readonly inputResultView;
|
|
47
|
+
private readonly _layoutMode;
|
|
48
|
+
private readonly _layoutModeObs;
|
|
49
|
+
private readonly _ctxIsMergeEditor;
|
|
50
|
+
private readonly _ctxUsesColumnLayout;
|
|
51
|
+
private readonly _ctxShowBase;
|
|
52
|
+
private readonly _ctxShowBaseAtTop;
|
|
53
|
+
private readonly _ctxResultUri;
|
|
54
|
+
private readonly _ctxBaseUri;
|
|
55
|
+
private readonly _ctxShowNonConflictingChanges;
|
|
56
|
+
private readonly _inputModel;
|
|
57
|
+
get inputModel(): IObservable<IMergeEditorInputModel | undefined>;
|
|
58
|
+
get model(): MergeEditorModel | undefined;
|
|
59
|
+
private get inputsWritable();
|
|
60
|
+
private readonly viewZoneComputer;
|
|
61
|
+
protected readonly codeLensesVisible: IObservable<boolean, unknown>;
|
|
62
|
+
private readonly scrollSynchronizer;
|
|
63
|
+
constructor(group: IEditorGroup, instantiation: IInstantiationService, contextKeyService: IContextKeyService, telemetryService: ITelemetryService, storageService: IStorageService, themeService: IThemeService, textResourceConfigurationService: ITextResourceConfigurationService, _configurationService: IConfigurationService, editorService: IEditorService, editorGroupService: IEditorGroupsService, fileService: IFileService, _codeEditorService: ICodeEditorService, configurationService: IConfigurationService);
|
|
64
|
+
dispose(): void;
|
|
65
|
+
private readonly _onDidChangeSizeConstraints;
|
|
66
|
+
readonly onDidChangeSizeConstraints: Event<void>;
|
|
67
|
+
get minimumWidth(): number;
|
|
68
|
+
getTitle(): string;
|
|
69
|
+
protected createEditorControl(parent: HTMLElement, initialOptions: ICodeEditorOptions): void;
|
|
70
|
+
protected updateEditorControlOptions(options: ICodeEditorOptions): void;
|
|
71
|
+
private applyOptions;
|
|
72
|
+
protected getMainControl(): ICodeEditor | undefined;
|
|
73
|
+
layout(dimension: Dimension): void;
|
|
74
|
+
setInput(input: EditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void>;
|
|
75
|
+
private setViewZones;
|
|
76
|
+
setOptions(options: ITextEditorOptions | undefined): void;
|
|
77
|
+
clearInput(): void;
|
|
78
|
+
focus(): void;
|
|
79
|
+
hasFocus(): boolean;
|
|
80
|
+
protected setEditorVisible(visible: boolean): void;
|
|
81
|
+
getControl(): ICodeEditor | undefined;
|
|
82
|
+
get scopedContextKeyService(): IContextKeyService | undefined;
|
|
83
|
+
toggleBase(): void;
|
|
84
|
+
toggleShowBaseTop(): void;
|
|
85
|
+
toggleShowBaseCenter(): void;
|
|
86
|
+
setLayoutKind(kind: MergeEditorLayoutKind): void;
|
|
87
|
+
setLayout(newLayout: IMergeEditorLayout): void;
|
|
88
|
+
private readonly baseViewDisposables;
|
|
89
|
+
private applyLayout;
|
|
90
|
+
private setGrid;
|
|
91
|
+
private _applyViewState;
|
|
92
|
+
protected computeEditorViewState(resource: URI): IMergeEditorViewState | undefined;
|
|
93
|
+
protected tracksEditorViewState(input: EditorInput): boolean;
|
|
94
|
+
private readonly showNonConflictingChangesStore;
|
|
95
|
+
private readonly showNonConflictingChanges;
|
|
96
|
+
toggleShowNonConflictingChanges(): void;
|
|
97
|
+
}
|
|
98
|
+
export interface IMergeEditorLayout {
|
|
99
|
+
readonly kind: MergeEditorLayoutKind;
|
|
100
|
+
readonly showBase: boolean;
|
|
101
|
+
readonly showBaseAtTop: boolean;
|
|
102
|
+
}
|
|
103
|
+
export declare class MergeEditorOpenHandlerContribution extends Disposable {
|
|
104
|
+
private readonly _editorService;
|
|
105
|
+
constructor(_editorService: IEditorService, codeEditorService: ICodeEditorService);
|
|
106
|
+
private openCodeEditorFromMergeEditor;
|
|
107
|
+
}
|
|
108
|
+
export declare class MergeEditorResolverContribution extends Disposable {
|
|
109
|
+
static readonly ID = "workbench.contrib.mergeEditorResolver";
|
|
110
|
+
constructor(editorResolverService: IEditorResolverService, instantiationService: IInstantiationService);
|
|
111
|
+
}
|
|
112
|
+
type IMergeEditorViewState = ICodeEditorViewState & {
|
|
113
|
+
readonly input1State?: ICodeEditorViewState;
|
|
114
|
+
readonly input2State?: ICodeEditorViewState;
|
|
115
|
+
readonly focusIndex: number;
|
|
116
|
+
};
|
|
117
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { reset } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { SerializableGrid } from '@codingame/monaco-vscode-
|
|
4
|
+
import { SerializableGrid } from '@codingame/monaco-vscode-6980eeab-47bb-5a48-8e15-32caf0785565-common/vscode/vs/base/browser/ui/grid/grid';
|
|
5
|
+
import 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
4
6
|
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
5
7
|
import { BugIndicatingError, onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
6
8
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -15,28 +17,30 @@ import { isEqual, basename } from 'vscode/vscode/vs/base/common/resources';
|
|
|
15
17
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
16
18
|
import './media/mergeEditor.css.js';
|
|
17
19
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
20
|
+
import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
|
|
18
21
|
import { ITextResourceConfigurationService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
|
|
19
22
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
20
23
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
21
24
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
22
25
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
23
26
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
27
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
24
28
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
25
29
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
26
30
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
27
|
-
import '
|
|
31
|
+
import { AbstractTextEditor } from '@codingame/monaco-vscode-219d9a5f-b446-507b-a188-1178a0867c75-common/vscode/vs/workbench/browser/parts/editor/textEditor';
|
|
28
32
|
import { DEFAULT_EDITOR_ASSOCIATION } from 'vscode/vscode/vs/workbench/common/editor';
|
|
29
|
-
import { applyTextEditorOptions } from 'vscode/vscode/vs/workbench/common/editor/editorOptions';
|
|
33
|
+
import { applyTextEditorOptions } from '@codingame/monaco-vscode-219d9a5f-b446-507b-a188-1178a0867c75-common/vscode/vs/workbench/common/editor/editorOptions';
|
|
30
34
|
import { readTransientState, writeTransientState } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleWordWrap';
|
|
31
|
-
import { MergeEditorInput } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput';
|
|
32
|
-
import { PersistentStore, deepMerge, thenIfNotDisposed } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/utils';
|
|
35
|
+
import { MergeEditorInput } from '@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput';
|
|
36
|
+
import { PersistentStore, deepMerge, thenIfNotDisposed } from '@codingame/monaco-vscode-464d4abe-0937-5367-af84-1b9279e14ea3-common/vscode/vs/workbench/contrib/mergeEditor/browser/utils';
|
|
33
37
|
import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
34
38
|
import { BaseCodeEditorView } from './editors/baseCodeEditorView.js';
|
|
35
39
|
import { ScrollSynchronizer } from './scrollSynchronizer.js';
|
|
36
40
|
import { MergeEditorViewModel } from './viewModel.js';
|
|
37
41
|
import { ViewZoneComputer } from './viewZones.js';
|
|
38
|
-
import { ctxIsMergeEditor, ctxMergeEditorLayout, ctxMergeEditorShowBase, ctxMergeEditorShowBaseAtTop, ctxMergeResultUri, ctxMergeBaseUri, ctxMergeEditorShowNonConflictingChanges } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor';
|
|
39
|
-
import { settingsSashBorder } from 'vscode/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry';
|
|
42
|
+
import { ctxIsMergeEditor, ctxMergeEditorLayout, ctxMergeEditorShowBase, ctxMergeEditorShowBaseAtTop, ctxMergeResultUri, ctxMergeBaseUri, ctxMergeEditorShowNonConflictingChanges } from '@codingame/monaco-vscode-897bebad-39df-57cb-8a57-36a271d038be-common/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor';
|
|
43
|
+
import { settingsSashBorder } from '@codingame/monaco-vscode-e72c94ca-257a-5b75-8b68-5a5fa3c18255-common/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry';
|
|
40
44
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
41
45
|
import { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
42
46
|
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
|
|
@@ -44,7 +48,7 @@ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/commo
|
|
|
44
48
|
import './colors.js';
|
|
45
49
|
import { InputCodeEditorView } from './editors/inputCodeEditorView.js';
|
|
46
50
|
import { ResultCodeEditorView } from './editors/resultCodeEditorView.js';
|
|
47
|
-
import {
|
|
51
|
+
import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
48
52
|
|
|
49
53
|
var MergeEditor_1, MergeEditorLayoutStore_1;
|
|
50
54
|
let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
@@ -68,9 +72,9 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
68
72
|
this._configurationService = _configurationService;
|
|
69
73
|
this._codeEditorService = _codeEditorService;
|
|
70
74
|
this.configurationService = configurationService;
|
|
71
|
-
this._sessionDisposables = (
|
|
75
|
+
this._sessionDisposables = ( new DisposableStore());
|
|
72
76
|
this._viewModel = observableValue(this, undefined);
|
|
73
|
-
this._grid = this._register((
|
|
77
|
+
this._grid = this._register(( new MutableDisposable()));
|
|
74
78
|
this.input1View = this._register(this.instantiationService.createInstance(InputCodeEditorView, 1, this._viewModel));
|
|
75
79
|
this.baseView = observableValue(this, undefined);
|
|
76
80
|
this.baseViewOptions = observableValue(this, undefined);
|
|
@@ -86,23 +90,23 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
86
90
|
this._ctxBaseUri = ctxMergeBaseUri.bindTo(this.contextKeyService);
|
|
87
91
|
this._ctxShowNonConflictingChanges = ctxMergeEditorShowNonConflictingChanges.bindTo(this.contextKeyService);
|
|
88
92
|
this._inputModel = observableValue(this, undefined);
|
|
89
|
-
this.viewZoneComputer = (
|
|
93
|
+
this.viewZoneComputer = ( new ViewZoneComputer(
|
|
90
94
|
this.input1View.editor,
|
|
91
95
|
this.input2View.editor,
|
|
92
96
|
this.inputResultView.editor
|
|
93
|
-
))
|
|
97
|
+
));
|
|
94
98
|
this.codeLensesVisible = observableConfigValue('mergeEditor.showCodeLenses', true, this.configurationService);
|
|
95
|
-
this.scrollSynchronizer = this._register((
|
|
99
|
+
this.scrollSynchronizer = this._register(( new ScrollSynchronizer(
|
|
96
100
|
this._viewModel,
|
|
97
101
|
this.input1View,
|
|
98
102
|
this.input2View,
|
|
99
103
|
this.baseView,
|
|
100
104
|
this.inputResultView,
|
|
101
105
|
this._layoutModeObs
|
|
102
|
-
)))
|
|
103
|
-
this._onDidChangeSizeConstraints = (
|
|
106
|
+
)));
|
|
107
|
+
this._onDidChangeSizeConstraints = ( new Emitter());
|
|
104
108
|
this.onDidChangeSizeConstraints = this._onDidChangeSizeConstraints.event;
|
|
105
|
-
this.baseViewDisposables = this._register((
|
|
109
|
+
this.baseViewDisposables = this._register(( new DisposableStore()));
|
|
106
110
|
this.showNonConflictingChangesStore = this.instantiationService.createInstance((PersistentStore), 'mergeEditor/showNonConflictingChanges');
|
|
107
111
|
this.showNonConflictingChanges = observableValue(this, this.showNonConflictingChangesStore.get() ?? false);
|
|
108
112
|
}
|
|
@@ -122,7 +126,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
122
126
|
if (this.input) {
|
|
123
127
|
return this.input.getName();
|
|
124
128
|
}
|
|
125
|
-
return
|
|
129
|
+
return localize(7261, "Text Merge Editor");
|
|
126
130
|
}
|
|
127
131
|
createEditorControl(parent, initialOptions) {
|
|
128
132
|
this.rootHtmlElement = parent;
|
|
@@ -153,7 +157,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
153
157
|
}
|
|
154
158
|
async setInput(input, options, context, token) {
|
|
155
159
|
if (!(input instanceof MergeEditorInput)) {
|
|
156
|
-
throw (
|
|
160
|
+
throw ( new BugIndicatingError('ONLY MergeEditorInput is supported'));
|
|
157
161
|
}
|
|
158
162
|
await super.setInput(input, options, context, token);
|
|
159
163
|
this._sessionDisposables.clear();
|
|
@@ -176,8 +180,8 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
176
180
|
this._inputModel.set(inputModel, tx);
|
|
177
181
|
});
|
|
178
182
|
this._sessionDisposables.add(viewModel);
|
|
179
|
-
this._ctxResultUri.set((
|
|
180
|
-
this._ctxBaseUri.set((
|
|
183
|
+
this._ctxResultUri.set(( inputModel.resultUri.toString()));
|
|
184
|
+
this._ctxBaseUri.set(( model.base.uri.toString()));
|
|
181
185
|
this._sessionDisposables.add(toDisposable(() => {
|
|
182
186
|
this._ctxBaseUri.reset();
|
|
183
187
|
this._ctxResultUri.reset();
|
|
@@ -236,7 +240,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
236
240
|
const that = this;
|
|
237
241
|
this._sessionDisposables.add(new (class {
|
|
238
242
|
constructor() {
|
|
239
|
-
this._disposable = (
|
|
243
|
+
this._disposable = ( new DisposableStore());
|
|
240
244
|
for (const model of this.baseInput1Input2()) {
|
|
241
245
|
this._disposable.add(model.onDidChangeContent(() => this._checkBaseInput1Input2AllEmpty()));
|
|
242
246
|
}
|
|
@@ -270,7 +274,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
270
274
|
shouldAlignBase,
|
|
271
275
|
shouldAlignResult,
|
|
272
276
|
});
|
|
273
|
-
const disposableStore = (
|
|
277
|
+
const disposableStore = ( new DisposableStore());
|
|
274
278
|
if (baseViewZoneAccessor) {
|
|
275
279
|
for (const v of viewZones.baseViewZones) {
|
|
276
280
|
v.create(baseViewZoneAccessor, baseViewZoneIds, disposableStore);
|
|
@@ -314,7 +318,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
314
318
|
setOptions(options) {
|
|
315
319
|
super.setOptions(options);
|
|
316
320
|
if (options) {
|
|
317
|
-
applyTextEditorOptions(options, this.inputResultView.editor,
|
|
321
|
+
applyTextEditorOptions(options, this.inputResultView.editor, ScrollType.Smooth);
|
|
318
322
|
}
|
|
319
323
|
}
|
|
320
324
|
clearInput() {
|
|
@@ -460,7 +464,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
460
464
|
height = this._grid.value.height;
|
|
461
465
|
}
|
|
462
466
|
this._grid.value = SerializableGrid.from({
|
|
463
|
-
orientation:
|
|
467
|
+
orientation: Orientation.VERTICAL,
|
|
464
468
|
size: 100,
|
|
465
469
|
groups: descriptor,
|
|
466
470
|
}, {
|
|
@@ -509,27 +513,27 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
509
513
|
this._ctxShowNonConflictingChanges.set(this.showNonConflictingChanges.get());
|
|
510
514
|
}
|
|
511
515
|
};
|
|
512
|
-
MergeEditor = MergeEditor_1 = (
|
|
513
|
-
(
|
|
514
|
-
(
|
|
515
|
-
(
|
|
516
|
-
(
|
|
517
|
-
(
|
|
518
|
-
(
|
|
519
|
-
(
|
|
520
|
-
(
|
|
521
|
-
(
|
|
522
|
-
(
|
|
523
|
-
(
|
|
524
|
-
(
|
|
525
|
-
], MergeEditor))
|
|
516
|
+
MergeEditor = MergeEditor_1 = ( __decorate([
|
|
517
|
+
( __param(1, IInstantiationService)),
|
|
518
|
+
( __param(2, IContextKeyService)),
|
|
519
|
+
( __param(3, ITelemetryService)),
|
|
520
|
+
( __param(4, IStorageService)),
|
|
521
|
+
( __param(5, IThemeService)),
|
|
522
|
+
( __param(6, ITextResourceConfigurationService)),
|
|
523
|
+
( __param(7, IConfigurationService)),
|
|
524
|
+
( __param(8, IEditorService)),
|
|
525
|
+
( __param(9, IEditorGroupsService)),
|
|
526
|
+
( __param(10, IFileService)),
|
|
527
|
+
( __param(11, ICodeEditorService)),
|
|
528
|
+
( __param(12, IConfigurationService))
|
|
529
|
+
], MergeEditor));
|
|
526
530
|
let MergeEditorLayoutStore = class MergeEditorLayoutStore {
|
|
527
531
|
static { MergeEditorLayoutStore_1 = this; }
|
|
528
532
|
static { this._key = 'mergeEditor/layout'; }
|
|
529
533
|
constructor(_storageService) {
|
|
530
534
|
this._storageService = _storageService;
|
|
531
535
|
this._value = { kind: 'mixed', showBase: false, showBaseAtTop: true };
|
|
532
|
-
const value = _storageService.get(MergeEditorLayoutStore_1._key,
|
|
536
|
+
const value = _storageService.get(MergeEditorLayoutStore_1._key, StorageScope.PROFILE, 'mixed');
|
|
533
537
|
if (value === 'mixed' || value === 'columns') {
|
|
534
538
|
this._value = { kind: value, showBase: false, showBaseAtTop: true };
|
|
535
539
|
}
|
|
@@ -548,13 +552,13 @@ let MergeEditorLayoutStore = class MergeEditorLayoutStore {
|
|
|
548
552
|
set value(value) {
|
|
549
553
|
if (this._value !== value) {
|
|
550
554
|
this._value = value;
|
|
551
|
-
this._storageService.store(MergeEditorLayoutStore_1._key, JSON.stringify(this._value),
|
|
555
|
+
this._storageService.store(MergeEditorLayoutStore_1._key, JSON.stringify(this._value), StorageScope.PROFILE, StorageTarget.USER);
|
|
552
556
|
}
|
|
553
557
|
}
|
|
554
558
|
};
|
|
555
|
-
MergeEditorLayoutStore = MergeEditorLayoutStore_1 = (
|
|
556
|
-
(
|
|
557
|
-
], MergeEditorLayoutStore))
|
|
559
|
+
MergeEditorLayoutStore = MergeEditorLayoutStore_1 = ( __decorate([
|
|
560
|
+
( __param(0, IStorageService))
|
|
561
|
+
], MergeEditorLayoutStore));
|
|
558
562
|
let MergeEditorOpenHandlerContribution = class MergeEditorOpenHandlerContribution extends Disposable {
|
|
559
563
|
constructor(_editorService, codeEditorService) {
|
|
560
564
|
super();
|
|
@@ -570,16 +574,16 @@ let MergeEditorOpenHandlerContribution = class MergeEditorOpenHandlerContributio
|
|
|
570
574
|
&& activePane.input instanceof MergeEditorInput
|
|
571
575
|
&& isEqual(input.resource, activePane.input.result)) {
|
|
572
576
|
const targetEditor = activePane.getControl();
|
|
573
|
-
applyTextEditorOptions(input.options, targetEditor,
|
|
577
|
+
applyTextEditorOptions(input.options, targetEditor, ScrollType.Smooth);
|
|
574
578
|
return targetEditor;
|
|
575
579
|
}
|
|
576
580
|
return null;
|
|
577
581
|
}
|
|
578
582
|
};
|
|
579
|
-
MergeEditorOpenHandlerContribution = (
|
|
580
|
-
(
|
|
581
|
-
(
|
|
582
|
-
], MergeEditorOpenHandlerContribution))
|
|
583
|
+
MergeEditorOpenHandlerContribution = ( __decorate([
|
|
584
|
+
( __param(0, IEditorService)),
|
|
585
|
+
( __param(1, ICodeEditorService))
|
|
586
|
+
], MergeEditorOpenHandlerContribution));
|
|
583
587
|
let MergeEditorResolverContribution = class MergeEditorResolverContribution extends Disposable {
|
|
584
588
|
static { this.ID = 'workbench.contrib.mergeEditorResolver'; }
|
|
585
589
|
constructor(editorResolverService, instantiationService) {
|
|
@@ -609,9 +613,9 @@ let MergeEditorResolverContribution = class MergeEditorResolverContribution exte
|
|
|
609
613
|
}));
|
|
610
614
|
}
|
|
611
615
|
};
|
|
612
|
-
MergeEditorResolverContribution = (
|
|
613
|
-
(
|
|
614
|
-
(
|
|
615
|
-
], MergeEditorResolverContribution))
|
|
616
|
+
MergeEditorResolverContribution = ( __decorate([
|
|
617
|
+
( __param(0, IEditorResolverService)),
|
|
618
|
+
( __param(1, IInstantiationService))
|
|
619
|
+
], MergeEditorResolverContribution));
|
|
616
620
|
|
|
617
621
|
export { MergeEditor, MergeEditorOpenHandlerContribution, MergeEditorResolverContribution };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IObservable } from "vscode/vscode/vs/base/common/observable";
|
|
3
|
+
import { BaseCodeEditorView } from "./editors/baseCodeEditorView.js";
|
|
4
|
+
import { IMergeEditorLayout } from "./mergeEditor.js";
|
|
5
|
+
import { MergeEditorViewModel } from "./viewModel.js";
|
|
6
|
+
import { InputCodeEditorView } from "./editors/inputCodeEditorView.js";
|
|
7
|
+
import { ResultCodeEditorView } from "./editors/resultCodeEditorView.js";
|
|
8
|
+
export declare class ScrollSynchronizer extends Disposable {
|
|
9
|
+
private readonly viewModel;
|
|
10
|
+
private readonly input1View;
|
|
11
|
+
private readonly input2View;
|
|
12
|
+
private readonly baseView;
|
|
13
|
+
private readonly inputResultView;
|
|
14
|
+
private readonly layout;
|
|
15
|
+
private get model();
|
|
16
|
+
private readonly reentrancyBarrier;
|
|
17
|
+
readonly updateScrolling: () => void;
|
|
18
|
+
private get shouldAlignResult();
|
|
19
|
+
private get shouldAlignBase();
|
|
20
|
+
constructor(viewModel: IObservable<MergeEditorViewModel | undefined>, input1View: InputCodeEditorView, input2View: InputCodeEditorView, baseView: IObservable<BaseCodeEditorView | undefined>, inputResultView: ResultCodeEditorView, layout: IObservable<IMergeEditorLayout>);
|
|
21
|
+
private synchronizeScrolling;
|
|
22
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
3
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
3
4
|
import 'vscode/vscode/vs/base/common/event';
|
|
@@ -5,8 +6,9 @@ import { autorunWithStore } from 'vscode/vscode/vs/base/common/observableInterna
|
|
|
5
6
|
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
6
7
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
7
8
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
|
|
10
|
+
import { DocumentLineRangeMap } from '@codingame/monaco-vscode-464d4abe-0937-5367-af84-1b9279e14ea3-common/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping';
|
|
11
|
+
import { ReentrancyBarrier } from '@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/base/common/controlFlow';
|
|
10
12
|
|
|
11
13
|
class ScrollSynchronizer extends Disposable {
|
|
12
14
|
get model() { return this.viewModel.get()?.model; }
|
|
@@ -25,9 +27,9 @@ class ScrollSynchronizer extends Disposable {
|
|
|
25
27
|
if (!this.model) {
|
|
26
28
|
return;
|
|
27
29
|
}
|
|
28
|
-
this.input2View.editor.setScrollTop(this.input1View.editor.getScrollTop(),
|
|
30
|
+
this.input2View.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate);
|
|
29
31
|
if (this.shouldAlignResult) {
|
|
30
|
-
this.inputResultView.editor.setScrollTop(this.input1View.editor.getScrollTop(),
|
|
32
|
+
this.inputResultView.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate);
|
|
31
33
|
}
|
|
32
34
|
else {
|
|
33
35
|
const mappingInput1Result = this.model.input1ResultMapping.get();
|
|
@@ -36,7 +38,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
36
38
|
const baseView = this.baseView.get();
|
|
37
39
|
if (baseView) {
|
|
38
40
|
if (this.shouldAlignBase) {
|
|
39
|
-
this.baseView.get()?.editor.setScrollTop(this.input1View.editor.getScrollTop(),
|
|
41
|
+
this.baseView.get()?.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate);
|
|
40
42
|
}
|
|
41
43
|
else {
|
|
42
44
|
const mapping = ( new DocumentLineRangeMap(this.model.baseInput1Diffs.get(), -1)).reverse();
|
|
@@ -49,9 +51,9 @@ class ScrollSynchronizer extends Disposable {
|
|
|
49
51
|
handleInput1OnScroll();
|
|
50
52
|
}
|
|
51
53
|
if (c.scrollLeftChanged) {
|
|
52
|
-
this.baseView.get()?.editor.setScrollLeft(c.scrollLeft,
|
|
53
|
-
this.input2View.editor.setScrollLeft(c.scrollLeft,
|
|
54
|
-
this.inputResultView.editor.setScrollLeft(c.scrollLeft,
|
|
54
|
+
this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
55
|
+
this.input2View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
56
|
+
this.inputResultView.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
55
57
|
}
|
|
56
58
|
})));
|
|
57
59
|
this._store.add(this.input2View.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
|
|
@@ -59,9 +61,9 @@ class ScrollSynchronizer extends Disposable {
|
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
if (c.scrollTopChanged) {
|
|
62
|
-
this.input1View.editor.setScrollTop(c.scrollTop,
|
|
64
|
+
this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
|
|
63
65
|
if (this.shouldAlignResult) {
|
|
64
|
-
this.inputResultView.editor.setScrollTop(this.input2View.editor.getScrollTop(),
|
|
66
|
+
this.inputResultView.editor.setScrollTop(this.input2View.editor.getScrollTop(), ScrollType.Immediate);
|
|
65
67
|
}
|
|
66
68
|
else {
|
|
67
69
|
const mappingInput2Result = this.model.input2ResultMapping.get();
|
|
@@ -70,7 +72,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
70
72
|
const baseView = this.baseView.get();
|
|
71
73
|
if (baseView && this.model) {
|
|
72
74
|
if (this.shouldAlignBase) {
|
|
73
|
-
this.baseView.get()?.editor.setScrollTop(c.scrollTop,
|
|
75
|
+
this.baseView.get()?.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
|
|
74
76
|
}
|
|
75
77
|
else {
|
|
76
78
|
const mapping = ( new DocumentLineRangeMap(this.model.baseInput2Diffs.get(), -1)).reverse();
|
|
@@ -79,16 +81,16 @@ class ScrollSynchronizer extends Disposable {
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
if (c.scrollLeftChanged) {
|
|
82
|
-
this.baseView.get()?.editor.setScrollLeft(c.scrollLeft,
|
|
83
|
-
this.input1View.editor.setScrollLeft(c.scrollLeft,
|
|
84
|
-
this.inputResultView.editor.setScrollLeft(c.scrollLeft,
|
|
84
|
+
this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
85
|
+
this.input1View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
86
|
+
this.inputResultView.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
85
87
|
}
|
|
86
88
|
})));
|
|
87
89
|
this._store.add(this.inputResultView.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
|
|
88
90
|
if (c.scrollTopChanged) {
|
|
89
91
|
if (this.shouldAlignResult) {
|
|
90
|
-
this.input1View.editor.setScrollTop(c.scrollTop,
|
|
91
|
-
this.input2View.editor.setScrollTop(c.scrollTop,
|
|
92
|
+
this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
|
|
93
|
+
this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
|
|
92
94
|
}
|
|
93
95
|
else {
|
|
94
96
|
const mapping1 = this.model?.resultInput1Mapping.get();
|
|
@@ -103,9 +105,9 @@ class ScrollSynchronizer extends Disposable {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
if (c.scrollLeftChanged) {
|
|
106
|
-
this.baseView.get()?.editor?.setScrollLeft(c.scrollLeft,
|
|
107
|
-
this.input1View.editor.setScrollLeft(c.scrollLeft,
|
|
108
|
-
this.input2View.editor.setScrollLeft(c.scrollLeft,
|
|
108
|
+
this.baseView.get()?.editor?.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
109
|
+
this.input1View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
110
|
+
this.input2View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
109
111
|
}
|
|
110
112
|
})));
|
|
111
113
|
this._store.add(autorunWithStore((reader, store) => {
|
|
@@ -117,8 +119,8 @@ class ScrollSynchronizer extends Disposable {
|
|
|
117
119
|
return;
|
|
118
120
|
}
|
|
119
121
|
if (this.shouldAlignBase) {
|
|
120
|
-
this.input1View.editor.setScrollTop(c.scrollTop,
|
|
121
|
-
this.input2View.editor.setScrollTop(c.scrollTop,
|
|
122
|
+
this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
|
|
123
|
+
this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
|
|
122
124
|
}
|
|
123
125
|
else {
|
|
124
126
|
const baseInput1Mapping = ( new DocumentLineRangeMap(this.model.baseInput1Diffs.get(), -1));
|
|
@@ -130,9 +132,9 @@ class ScrollSynchronizer extends Disposable {
|
|
|
130
132
|
this.synchronizeScrolling(baseView.editor, this.inputResultView.editor, baseMapping);
|
|
131
133
|
}
|
|
132
134
|
if (c.scrollLeftChanged) {
|
|
133
|
-
this.inputResultView.editor.setScrollLeft(c.scrollLeft,
|
|
134
|
-
this.input1View.editor.setScrollLeft(c.scrollLeft,
|
|
135
|
-
this.input2View.editor.setScrollLeft(c.scrollLeft,
|
|
135
|
+
this.inputResultView.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
136
|
+
this.input1View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
137
|
+
this.input2View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
|
|
136
138
|
}
|
|
137
139
|
})));
|
|
138
140
|
}
|
|
@@ -156,7 +158,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
156
158
|
const sourceEndPx = scrollingEditor.getTopForLineNumber(sourceRange.endLineNumberExclusive);
|
|
157
159
|
const factor = Math.min((scrollingEditor.getScrollTop() - sourceStartTopPx) / (sourceEndPx - sourceStartTopPx), 1);
|
|
158
160
|
const resultScrollPosition = resultStartTopPx + (resultEndPx - resultStartTopPx) * factor;
|
|
159
|
-
targetEditor.setScrollTop(resultScrollPosition,
|
|
161
|
+
targetEditor.setScrollTop(resultScrollPosition, ScrollType.Immediate);
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IObservable, ITransaction } from "vscode/vscode/vs/base/common/observable";
|
|
3
|
+
import { Range } from "vscode/vscode/vs/editor/common/core/range";
|
|
4
|
+
import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import { INotificationService } from "vscode/vscode/vs/platform/notification/common/notification.service";
|
|
6
|
+
import { MergeEditorModel } from "@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel";
|
|
7
|
+
import { InputNumber, ModifiedBaseRange, ModifiedBaseRangeState } from "@codingame/monaco-vscode-464d4abe-0937-5367-af84-1b9279e14ea3-common/vscode/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange";
|
|
8
|
+
import { BaseCodeEditorView } from "./editors/baseCodeEditorView.js";
|
|
9
|
+
import { CodeEditorView } from "./editors/codeEditorView.js";
|
|
10
|
+
import { InputCodeEditorView } from "./editors/inputCodeEditorView.js";
|
|
11
|
+
import { ResultCodeEditorView } from "./editors/resultCodeEditorView.js";
|
|
12
|
+
export declare class MergeEditorViewModel extends Disposable {
|
|
13
|
+
readonly model: MergeEditorModel;
|
|
14
|
+
readonly inputCodeEditorView1: InputCodeEditorView;
|
|
15
|
+
readonly inputCodeEditorView2: InputCodeEditorView;
|
|
16
|
+
readonly resultCodeEditorView: ResultCodeEditorView;
|
|
17
|
+
readonly baseCodeEditorView: IObservable<BaseCodeEditorView | undefined>;
|
|
18
|
+
readonly showNonConflictingChanges: IObservable<boolean>;
|
|
19
|
+
private readonly configurationService;
|
|
20
|
+
private readonly notificationService;
|
|
21
|
+
private readonly manuallySetActiveModifiedBaseRange;
|
|
22
|
+
private readonly attachedHistory;
|
|
23
|
+
constructor(model: MergeEditorModel, inputCodeEditorView1: InputCodeEditorView, inputCodeEditorView2: InputCodeEditorView, resultCodeEditorView: ResultCodeEditorView, baseCodeEditorView: IObservable<BaseCodeEditorView | undefined>, showNonConflictingChanges: IObservable<boolean>, configurationService: IConfigurationService, notificationService: INotificationService);
|
|
24
|
+
readonly shouldUseAppendInsteadOfAccept: IObservable<boolean, unknown>;
|
|
25
|
+
private counter;
|
|
26
|
+
private readonly lastFocusedEditor;
|
|
27
|
+
readonly baseShowDiffAgainst: IObservable<2 | 1 | undefined, unknown>;
|
|
28
|
+
readonly selectionInBase: IObservable<{
|
|
29
|
+
rangesInBase: Range[];
|
|
30
|
+
sourceEditor: CodeEditorView;
|
|
31
|
+
} | undefined, unknown>;
|
|
32
|
+
private getRangeOfModifiedBaseRange;
|
|
33
|
+
readonly activeModifiedBaseRange: IObservable<ModifiedBaseRange | undefined, unknown>;
|
|
34
|
+
setActiveModifiedBaseRange(range: ModifiedBaseRange | undefined, tx: ITransaction): void;
|
|
35
|
+
setState(baseRange: ModifiedBaseRange, state: ModifiedBaseRangeState, tx: ITransaction, inputNumber: InputNumber): void;
|
|
36
|
+
private goToConflict;
|
|
37
|
+
goToNextModifiedBaseRange(predicate: (m: ModifiedBaseRange) => boolean): void;
|
|
38
|
+
goToPreviousModifiedBaseRange(predicate: (m: ModifiedBaseRange) => boolean): void;
|
|
39
|
+
toggleActiveConflict(inputNumber: 1 | 2): void;
|
|
40
|
+
acceptAll(inputNumber: 1 | 2): void;
|
|
41
|
+
}
|