monaco-editor-core 0.55.0-dev-20251014 → 0.55.0-dev-20251016
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +9 -0
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +9 -0
- package/esm/nls.messages.pt-br.js +9 -0
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +9 -0
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +10 -0
- package/esm/vs/base/browser/canIUse.js +0 -1
- package/esm/vs/base/browser/canIUse.js.map +1 -1
- package/esm/vs/base/browser/domSanitize.js +31 -23
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +188 -385
- package/esm/vs/base/browser/markdownRenderer.js +6 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js +6 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +1 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/objects.js +0 -1
- package/esm/vs/base/common/objects.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js +2 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js +4 -2
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js +5 -0
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +104 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +25 -24
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +7 -3
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/style.css +11 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +54 -54
- package/esm/vs/editor/common/config/editorOptions.js +406 -406
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +10 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +46 -46
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +10 -10
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +13 -14
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +19 -19
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +15 -10
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +47 -37
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +56 -10
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +2 -2
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +0 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +15 -15
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +3 -3
- package/version.txt +1 -1
|
@@ -16,7 +16,7 @@ registerAction2(ToggleUseInlineViewWhenSpaceIsLimited);
|
|
|
16
16
|
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
17
17
|
command: {
|
|
18
18
|
id: new ToggleUseInlineViewWhenSpaceIsLimited().desc.id,
|
|
19
|
-
title: localize(
|
|
19
|
+
title: localize(117, "Use Inline View When Space Is Limited"),
|
|
20
20
|
toggled: ContextKeyExpr.has('config.diffEditor.useInlineViewWhenSpaceIsLimited'),
|
|
21
21
|
precondition: ContextKeyExpr.has('isInDiffEditor'),
|
|
22
22
|
},
|
|
@@ -27,7 +27,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
|
27
27
|
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
28
28
|
command: {
|
|
29
29
|
id: new ToggleShowMovedCodeBlocks().desc.id,
|
|
30
|
-
title: localize(
|
|
30
|
+
title: localize(118, "Show Moved Code Blocks"),
|
|
31
31
|
icon: Codicon.move,
|
|
32
32
|
toggled: ContextKeyEqualsExpr.create('config.diffEditor.experimental.showMoves', true),
|
|
33
33
|
precondition: ContextKeyExpr.has('isInDiffEditor'),
|
|
@@ -44,7 +44,7 @@ for (const ctx of [
|
|
|
44
44
|
MenuRegistry.appendMenuItem(MenuId.DiffEditorHunkToolbar, {
|
|
45
45
|
command: {
|
|
46
46
|
id: new RevertHunkOrSelection().desc.id,
|
|
47
|
-
title: localize(
|
|
47
|
+
title: localize(119, "Revert Block"),
|
|
48
48
|
icon: ctx.icon,
|
|
49
49
|
},
|
|
50
50
|
when: ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable, ctx.key),
|
|
@@ -54,7 +54,7 @@ for (const ctx of [
|
|
|
54
54
|
MenuRegistry.appendMenuItem(MenuId.DiffEditorSelectionToolbar, {
|
|
55
55
|
command: {
|
|
56
56
|
id: new RevertHunkOrSelection().desc.id,
|
|
57
|
-
title: localize(
|
|
57
|
+
title: localize(120, "Revert Selection"),
|
|
58
58
|
icon: ctx.icon,
|
|
59
59
|
},
|
|
60
60
|
when: ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable, ctx.key),
|
|
@@ -69,7 +69,7 @@ registerAction2(ShowAllUnchangedRegions);
|
|
|
69
69
|
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
70
70
|
command: {
|
|
71
71
|
id: AccessibleDiffViewerNext.id,
|
|
72
|
-
title: localize(
|
|
72
|
+
title: localize(121, "Open Accessible Diff Viewer"),
|
|
73
73
|
precondition: ContextKeyExpr.has('isInDiffEditor'),
|
|
74
74
|
},
|
|
75
75
|
order: 10,
|
|
@@ -50,11 +50,12 @@ import './style.css';
|
|
|
50
50
|
import { ObservableElementSizeObserver, RefCounted, applyStyle, applyViewZones, translatePosition } from './utils.js';
|
|
51
51
|
let DiffEditorWidget = class DiffEditorWidget extends DelegatingEditor {
|
|
52
52
|
get onDidContentSizeChange() { return this._editors.onDidContentSizeChange; }
|
|
53
|
-
constructor(_domElement, options, codeEditorWidgetOptions, _parentContextKeyService, _parentInstantiationService,
|
|
53
|
+
constructor(_domElement, options, codeEditorWidgetOptions, _parentContextKeyService, _parentInstantiationService, _codeEditorService, _accessibilitySignalService, _editorProgressService) {
|
|
54
54
|
super();
|
|
55
55
|
this._domElement = _domElement;
|
|
56
56
|
this._parentContextKeyService = _parentContextKeyService;
|
|
57
57
|
this._parentInstantiationService = _parentInstantiationService;
|
|
58
|
+
this._codeEditorService = _codeEditorService;
|
|
58
59
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
59
60
|
this._editorProgressService = _editorProgressService;
|
|
60
61
|
this.elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [
|
|
@@ -124,7 +125,7 @@ let DiffEditorWidget = class DiffEditorWidget extends DelegatingEditor {
|
|
|
124
125
|
});
|
|
125
126
|
this._diffValue = this._diffModel.map((m, r) => m?.diff.read(r));
|
|
126
127
|
this.onDidUpdateDiff = Event.fromObservableLight(this._diffValue);
|
|
127
|
-
|
|
128
|
+
this._codeEditorService.willCreateDiffEditor();
|
|
128
129
|
this._contextKeyService.createKey('isInDiffEditor', true);
|
|
129
130
|
this._domElement.appendChild(this.elements.root);
|
|
130
131
|
this._register(toDisposable(() => this.elements.root.remove()));
|
|
@@ -193,7 +194,10 @@ let DiffEditorWidget = class DiffEditorWidget extends DelegatingEditor {
|
|
|
193
194
|
this._register(applyStyle(this.elements.modified, { visibility }));
|
|
194
195
|
this._register(applyStyle(this.elements.original, { visibility }));
|
|
195
196
|
this._createDiffEditorContributions();
|
|
196
|
-
|
|
197
|
+
this._codeEditorService.addDiffEditor(this);
|
|
198
|
+
this._register(toDisposable(() => {
|
|
199
|
+
this._codeEditorService.removeDiffEditor(this);
|
|
200
|
+
}));
|
|
197
201
|
this._gutter = derivedDisposable(this, reader => {
|
|
198
202
|
return this._options.shouldRenderGutterMenu.read(reader)
|
|
199
203
|
? this._instantiationService.createInstance(readHotReloadableExport(DiffEditorGutter, reader), this.elements.root, this._diffModel, this._editors, this._options, this._sashLayout, this._boundarySashes)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/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,CAAC,eAAe;gBACxD,mBAAmB,EAAE,CAAC,CAAC,aAAa,CAAC,WAAW;gBAChD,qBAAqB,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa;gBACpD,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,SAAS;gBAC5C,uBAAuB,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe;gBACxD,mBAAmB,EAAE,CAAC,CAAC,aAAa,CAAC,WAAW;gBAChD,qBAAqB,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa;gBACpD,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,SAAS;aAC5C,CAAC,CAAC;SACH,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","file":"diffEditorWidget.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getWindow, h } from '../../../../base/browser/dom.js';\nimport { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js';\nimport { findLast } from '../../../../base/common/arraysFind.js';\nimport { BugIndicatingError, onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js';\nimport { toDisposable } from '../../../../base/common/lifecycle.js';\nimport { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedDisposable, disposableObservableValue, observableFromEvent, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../base/common/observable.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { bindContextKey } from '../../../../platform/observable/common/platformObservableUtils.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { ILineChange } from '../../../common/diff/legacyLinesDiffComputer.js';\nimport { LineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { IIdentifiedSingleEditOperation } from '../../../common/model.js';\nimport { IEditorConstructionOptions } from '../../config/editorConfiguration.js';\nimport { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from '../../editorBrowser.js';\nimport { EditorExtensionsRegistry, IDiffEditorContributionDescription } from '../../editorExtensions.js';\nimport { ICodeEditorService } from '../../services/codeEditorService.js';\nimport { StableEditorScrollState } from '../../stableEditorScroll.js';\nimport { CodeEditorWidget, ICodeEditorWidgetOptions } from '../codeEditor/codeEditorWidget.js';\nimport { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from './components/accessibleDiffViewer.js';\nimport { DiffEditorDecorations } from './components/diffEditorDecorations.js';\nimport { DiffEditorEditors } from './components/diffEditorEditors.js';\nimport { DiffEditorSash, SashLayout } from './components/diffEditorSash.js';\nimport { DiffEditorViewZones } from './components/diffEditorViewZones/diffEditorViewZones.js';\nimport { DelegatingEditor } from './delegatingEditorImpl.js';\nimport { DiffEditorOptions } from './diffEditorOptions.js';\nimport { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel.js';\nimport { DiffEditorGutter } from './features/gutterFeature.js';\nimport { HideUnchangedRegionsFeature } from './features/hideUnchangedRegionsFeature.js';\nimport { MovedBlocksLinesFeature } from './features/movedBlocksLinesFeature.js';\nimport { OverviewRulerFeature } from './features/overviewRulerFeature.js';\nimport { RevertButtonsFeature } from './features/revertButtonsFeature.js';\nimport './style.css';\nimport { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyViewZones, translatePosition } from './utils.js';\n\nexport interface IDiffCodeEditorWidgetOptions {\n\toriginalEditor?: ICodeEditorWidgetOptions;\n\tmodifiedEditor?: ICodeEditorWidgetOptions;\n}\n\nexport class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {\n\n\tprivate readonly elements;\n\tprivate readonly _diffModelSrc;\n\tprivate readonly _diffModel;\n\tpublic readonly onDidChangeModel;\n\n\tpublic get onDidContentSizeChange() { return this._editors.onDidContentSizeChange; }\n\n\tprivate readonly _contextKeyService;\n\tprivate readonly _instantiationService;\n\tprivate readonly _rootSizeObserver: ObservableElementSizeObserver;\n\n\n\tprivate readonly _sashLayout: SashLayout;\n\tprivate readonly _sash: IObservable<DiffEditorSash | undefined>;\n\tprivate readonly _boundarySashes;\n\n\tprivate _accessibleDiffViewerShouldBeVisible;\n\tprivate _accessibleDiffViewerVisible;\n\tprivate readonly _accessibleDiffViewer: IObservable<AccessibleDiffViewer>;\n\tprivate readonly _options: DiffEditorOptions;\n\tprivate readonly _editors: DiffEditorEditors;\n\n\tprivate readonly _overviewRulerPart: IObservable<OverviewRulerFeature | undefined>;\n\tprivate readonly _movedBlocksLinesPart;\n\n\tprivate readonly _gutter: IObservable<DiffEditorGutter | undefined>;\n\n\tconstructor(\n\t\tprivate readonly _domElement: HTMLElement,\n\t\toptions: Readonly<IDiffEditorConstructionOptions>,\n\t\tcodeEditorWidgetOptions: IDiffCodeEditorWidgetOptions,\n\t\t@IContextKeyService private readonly _parentContextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,\n\t\t@IEditorProgressService private readonly _editorProgressService: IEditorProgressService,\n\t) {\n\t\tsuper();\n\t\tthis.elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [\n\t\t\th('div.editor.original@original', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),\n\t\t]);\n\t\tthis._diffModelSrc = this._register(disposableObservableValue<RefCounted<DiffEditorViewModel> | undefined>(this, undefined));\n\t\tthis._diffModel = derived<DiffEditorViewModel | undefined>(this, reader => this._diffModelSrc.read(reader)?.object);\n\t\tthis.onDidChangeModel = Event.fromObservableLight(this._diffModel);\n\t\tthis._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement));\n\t\tthis._instantiationService = this._register(this._parentInstantiationService.createChild(\n\t\t\tnew ServiceCollection([IContextKeyService, this._contextKeyService])\n\t\t));\n\t\tthis._boundarySashes = observableValue<IBoundarySashes | undefined>(this, undefined);\n\t\tthis._accessibleDiffViewerShouldBeVisible = observableValue(this, false);\n\t\tthis._accessibleDiffViewerVisible = derived(this, reader =>\n\t\t\tthis._options.onlyShowAccessibleDiffViewer.read(reader)\n\t\t\t\t? true\n\t\t\t\t: this._accessibleDiffViewerShouldBeVisible.read(reader)\n\t\t);\n\t\tthis._movedBlocksLinesPart = observableValue<MovedBlocksLinesFeature | undefined>(this, undefined);\n\t\tthis._layoutInfo = derived(this, reader => {\n\t\t\tconst fullWidth = this._rootSizeObserver.width.read(reader);\n\t\t\tconst fullHeight = this._rootSizeObserver.height.read(reader);\n\n\t\t\tif (this._rootSizeObserver.automaticLayout) {\n\t\t\t\tthis.elements.root.style.height = '100%';\n\t\t\t} else {\n\t\t\t\tthis.elements.root.style.height = fullHeight + 'px';\n\t\t\t}\n\n\t\t\tconst sash = this._sash.read(reader);\n\n\t\t\tconst gutter = this._gutter.read(reader);\n\t\t\tconst gutterWidth = gutter?.width.read(reader) ?? 0;\n\n\t\t\tconst overviewRulerPartWidth = this._overviewRulerPart.read(reader)?.width ?? 0;\n\n\t\t\tlet originalLeft: number, originalWidth: number, modifiedLeft: number, modifiedWidth: number, gutterLeft: number;\n\n\t\t\tconst sideBySide = !!sash;\n\t\t\tif (sideBySide) {\n\t\t\t\tconst sashLeft = sash.sashLeft.read(reader);\n\t\t\t\tconst movedBlocksLinesWidth = this._movedBlocksLinesPart.read(reader)?.width.read(reader) ?? 0;\n\n\t\t\t\toriginalLeft = 0;\n\t\t\t\toriginalWidth = sashLeft - gutterWidth - movedBlocksLinesWidth;\n\n\t\t\t\tgutterLeft = sashLeft - gutterWidth;\n\n\t\t\t\tmodifiedLeft = sashLeft;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t} else {\n\t\t\t\tgutterLeft = 0;\n\n\t\t\t\tconst shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader);\n\t\t\t\toriginalLeft = gutterWidth;\n\t\t\t\tif (shouldHideOriginalLineNumbers) {\n\t\t\t\t\toriginalWidth = 0;\n\t\t\t\t} else {\n\t\t\t\t\toriginalWidth = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(reader));\n\t\t\t\t}\n\n\t\t\t\tmodifiedLeft = gutterWidth + originalWidth;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t}\n\n\t\t\tthis.elements.original.style.left = originalLeft + 'px';\n\t\t\tthis.elements.original.style.width = originalWidth + 'px';\n\t\t\tthis._editors.original.layout({ width: originalWidth, height: fullHeight }, true);\n\n\t\t\tgutter?.layout(gutterLeft);\n\n\t\t\tthis.elements.modified.style.left = modifiedLeft + 'px';\n\t\t\tthis.elements.modified.style.width = modifiedWidth + 'px';\n\t\t\tthis._editors.modified.layout({ width: modifiedWidth, height: fullHeight }, true);\n\n\t\t\treturn {\n\t\t\t\tmodifiedEditor: this._editors.modified.getLayoutInfo(),\n\t\t\t\toriginalEditor: this._editors.original.getLayoutInfo(),\n\t\t\t};\n\t\t});\n\t\tthis._diffValue = this._diffModel.map((m, r) => m?.diff.read(r));\n\t\tthis.onDidUpdateDiff = Event.fromObservableLight(this._diffValue);\n\t\tcodeEditorService.willCreateDiffEditor();\n\n\t\tthis._contextKeyService.createKey('isInDiffEditor', true);\n\n\t\tthis._domElement.appendChild(this.elements.root);\n\t\tthis._register(toDisposable(() => this.elements.root.remove()));\n\n\t\tthis._rootSizeObserver = this._register(new ObservableElementSizeObserver(this.elements.root, options.dimension));\n\t\tthis._rootSizeObserver.setAutomaticLayout(options.automaticLayout ?? false);\n\n\t\tthis._options = this._instantiationService.createInstance(DiffEditorOptions, options);\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setWidth(this._rootSizeObserver.width.read(reader));\n\t\t}));\n\n\t\tthis._contextKeyService.createKey(EditorContextKeys.isEmbeddedDiffEditor.key, false);\n\t\tthis._register(bindContextKey(EditorContextKeys.isEmbeddedDiffEditor, this._contextKeyService,\n\t\t\treader => this._options.isInEmbeddedEditor.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.comparingMovedCode, this._contextKeyService,\n\t\t\treader => !!this._diffModel.read(reader)?.movedTextToCompare.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService,\n\t\t\treader => this._options.couldShowInlineViewBecauseOfSize.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorInlineMode, this._contextKeyService,\n\t\t\treader => !this._options.renderSideBySide.read(reader)\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.hasChanges, this._contextKeyService,\n\t\t\treader => (this._diffModel.read(reader)?.diff.read(reader)?.mappings.length ?? 0) > 0\n\t\t));\n\n\t\tthis._editors = this._register(this._instantiationService.createInstance(\n\t\t\tDiffEditorEditors,\n\t\t\tthis.elements.original,\n\t\t\tthis.elements.modified,\n\t\t\tthis._options,\n\t\t\tcodeEditorWidgetOptions,\n\t\t\t(i, c, o, o2) => this._createInnerEditor(i, c, o, o2),\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalWritable, this._contextKeyService,\n\t\t\treader => this._options.originalEditable.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedWritable, this._contextKeyService,\n\t\t\treader => !this._options.readOnly.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.original.uri.toString() ?? ''\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.modified.uri.toString() ?? ''\n\t\t));\n\n\t\tthis._overviewRulerPart = derivedDisposable(this, reader =>\n\t\t\t!this._options.renderOverviewRuler.read(reader)\n\t\t\t\t? undefined\n\t\t\t\t: this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(OverviewRulerFeature, reader),\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst dimensions = {\n\t\t\theight: this._rootSizeObserver.height,\n\t\t\twidth: this._rootSizeObserver.width.map((w, reader) => w - (this._overviewRulerPart.read(reader)?.width ?? 0)),\n\t\t};\n\n\t\tthis._sashLayout = new SashLayout(this._options, dimensions);\n\n\t\tthis._sash = derivedDisposable(this, reader => {\n\t\t\tconst showSash = this._options.renderSideBySide.read(reader);\n\t\t\tthis.elements.root.classList.toggle('side-by-side', showSash);\n\t\t\treturn !showSash ? undefined : new DiffEditorSash(\n\t\t\t\tthis.elements.root,\n\t\t\t\tdimensions,\n\t\t\t\tthis._options.enableSplitViewResizing,\n\t\t\t\tthis._boundarySashes,\n\t\t\t\tthis._sashLayout.sashLeft,\n\t\t\t\t() => this._sashLayout.resetSash(),\n\t\t\t);\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst unchangedRangesFeature = derivedDisposable(this, reader => /** @description UnchangedRangesFeature */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(HideUnchangedRegionsFeature, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tderivedDisposable(this, reader => /** @description DiffEditorDecorations */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorDecorations, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options, this,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst origViewZoneIdsToIgnore = new Set<string>();\n\t\tconst modViewZoneIdsToIgnore = new Set<string>();\n\t\tlet isUpdatingViewZones = false;\n\t\tconst viewZoneManager = derivedDisposable(this, reader => /** @description ViewZoneManager */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorViewZones, reader),\n\t\t\t\tgetWindow(this._domElement),\n\t\t\t\tthis._editors,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._options,\n\t\t\t\tthis,\n\t\t\t\t() => isUpdatingViewZones || unchangedRangesFeature.read(undefined).isUpdatingHiddenAreas,\n\t\t\t\torigViewZoneIdsToIgnore,\n\t\t\t\tmodViewZoneIdsToIgnore\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst originalViewZones = derived(this, (reader) => { /** @description originalViewZones */\n\t\t\tconst orig = viewZoneManager.read(reader).viewZones.read(reader).orig;\n\t\t\tconst orig2 = unchangedRangesFeature.read(reader).viewZones.read(reader).origViewZones;\n\t\t\treturn orig.concat(orig2);\n\t\t});\n\t\tconst modifiedViewZones = derived(this, (reader) => { /** @description modifiedViewZones */\n\t\t\tconst mod = viewZoneManager.read(reader).viewZones.read(reader).mod;\n\t\t\tconst mod2 = unchangedRangesFeature.read(reader).viewZones.read(reader).modViewZones;\n\t\t\treturn mod.concat(mod2);\n\t\t});\n\t\tthis._register(applyViewZones(this._editors.original, originalViewZones, isUpdatingOrigViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingOrigViewZones;\n\t\t}, origViewZoneIdsToIgnore));\n\t\tlet scrollState: StableEditorScrollState | undefined;\n\t\tthis._register(applyViewZones(this._editors.modified, modifiedViewZones, isUpdatingModViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingModViewZones;\n\t\t\tif (isUpdatingViewZones) {\n\t\t\t\tscrollState = StableEditorScrollState.capture(this._editors.modified);\n\t\t\t} else {\n\t\t\t\tscrollState?.restore(this._editors.modified);\n\t\t\t\tscrollState = undefined;\n\t\t\t}\n\t\t}, modViewZoneIdsToIgnore));\n\n\t\tthis._accessibleDiffViewer = derivedDisposable(this, reader =>\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(AccessibleDiffViewer, reader),\n\t\t\t\tthis.elements.accessibleDiffViewer,\n\t\t\t\tthis._accessibleDiffViewerVisible,\n\t\t\t\t(visible, tx) => this._accessibleDiffViewerShouldBeVisible.set(visible, tx),\n\t\t\t\tthis._options.onlyShowAccessibleDiffViewer.map(v => !v),\n\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\tthis._diffModel.map((m, r) => m?.diff.read(r)?.mappings.map(m => m.lineRangeMapping)),\n\t\t\t\tnew AccessibleDiffViewerModelFromEditors(this._editors),\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst visibility = this._accessibleDiffViewerVisible.map<CSSStyle['visibility']>(v => v ? 'hidden' : 'visible');\n\t\tthis._register(applyStyle(this.elements.modified, { visibility }));\n\t\tthis._register(applyStyle(this.elements.original, { visibility }));\n\n\t\tthis._createDiffEditorContributions();\n\n\t\tcodeEditorService.addDiffEditor(this);\n\n\t\tthis._gutter = derivedDisposable(this, reader => {\n\t\t\treturn this._options.shouldRenderGutterMenu.read(reader)\n\t\t\t\t? this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(DiffEditorGutter, reader),\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis._options,\n\t\t\t\t\tthis._sashLayout,\n\t\t\t\t\tthis._boundarySashes,\n\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t});\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._layoutInfo));\n\n\t\tderivedDisposable(this, reader => /** @description MovedBlocksLinesPart */\n\t\t\tnew (readHotReloadableExport(MovedBlocksLinesFeature, reader))(\n\t\t\t\tthis.elements.root,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._layoutInfo.map(i => i.originalEditor),\n\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\tthis._editors,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store, value => {\n\t\t\t// This is to break the layout info <-> moved blocks lines part dependency cycle.\n\t\t\tthis._movedBlocksLinesPart.set(value, undefined);\n\t\t});\n\n\t\tthis._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, true)));\n\t\tthis._register(Event.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, false)));\n\n\t\tconst isInitializingDiff = this._diffModel.map(this, (m, reader) => {\n\t\t\t/** @isInitializingDiff isDiffUpToDate */\n\t\t\tif (!m) { return undefined; }\n\t\t\treturn m.diff.read(reader) === undefined && !m.isDiffUpToDate.read(reader);\n\t\t});\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\t/** @description DiffEditorWidgetHelper.ShowProgress */\n\t\t\tif (isInitializingDiff.read(reader) === true) {\n\t\t\t\tconst r = this._editorProgressService.show(true, 1000);\n\t\t\t\tstore.add(toDisposable(() => r.done()));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tstore.add(new (readHotReloadableExport(RevertButtonsFeature, reader))(this._editors, this._diffModel, this._options, this));\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst model = this._diffModel.read(reader);\n\t\t\tif (!model) { return; }\n\t\t\tfor (const m of [model.model.original, model.model.modified]) {\n\t\t\t\tstore.add(m.onWillDispose(e => {\n\t\t\t\t\tonUnexpectedError(new BugIndicatingError('TextModel got disposed before DiffEditorWidget model got reset'));\n\t\t\t\t\tthis.setModel(null);\n\t\t\t\t}));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setModel(this._diffModel.read(reader));\n\t\t}));\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: Readonly<IEditorConstructionOptions>, editorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\tconst editor = instantiationService.createInstance(CodeEditorWidget, container, options, editorWidgetOptions);\n\t\treturn editor;\n\t}\n\n\tprivate readonly _layoutInfo;\n\n\tprivate _createDiffEditorContributions() {\n\t\tconst contributions: IDiffEditorContributionDescription[] = EditorExtensionsRegistry.getDiffEditorContributions();\n\t\tfor (const desc of contributions) {\n\t\t\ttry {\n\t\t\t\tthis._register(this._instantiationService.createInstance(desc.ctor, this));\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override get _targetEditor(): CodeEditorWidget { return this._editors.modified; }\n\n\toverride getEditorType(): string { return EditorType.IDiffEditor; }\n\n\toverride layout(dimension?: IDimension | undefined): void {\n\t\tthis._rootSizeObserver.observe(dimension);\n\t}\n\n\toverride hasTextFocus(): boolean { return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus(); }\n\n\tpublic override saveViewState(): IDiffEditorViewState {\n\t\tconst originalViewState = this._editors.original.saveViewState();\n\t\tconst modifiedViewState = this._editors.modified.saveViewState();\n\t\treturn {\n\t\t\toriginal: originalViewState,\n\t\t\tmodified: modifiedViewState,\n\t\t\tmodelState: this._diffModel.get()?.serializeState(),\n\t\t};\n\t}\n\n\tpublic override restoreViewState(s: IDiffEditorViewState): void {\n\t\tif (s && s.original && s.modified) {\n\t\t\tconst diffEditorState = s as IDiffEditorViewState;\n\t\t\tthis._editors.original.restoreViewState(diffEditorState.original);\n\t\t\tthis._editors.modified.restoreViewState(diffEditorState.modified);\n\t\t\tif (diffEditorState.modelState) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\tthis._diffModel.get()?.restoreSerializedState(diffEditorState.modelState as any);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleInitialized(): void {\n\t\tthis._editors.original.handleInitialized();\n\t\tthis._editors.modified.handleInitialized();\n\t}\n\n\tpublic createViewModel(model: IDiffEditorModel): IDiffEditorViewModel {\n\t\treturn this._instantiationService.createInstance(DiffEditorViewModel, model, this._options);\n\t}\n\n\toverride getModel(): IDiffEditorModel | null { return this._diffModel.get()?.model ?? null; }\n\n\toverride setModel(model: IDiffEditorModel | null | IDiffEditorViewModel): void {\n\t\tconst vm = !model ? null\n\t\t\t: ('model' in model) ? RefCounted.create(model).createNewRef(this)\n\t\t\t\t: RefCounted.create(this.createViewModel(model), this);\n\t\tthis.setDiffModel(vm);\n\t}\n\n\tsetDiffModel(viewModel: RefCounted<IDiffEditorViewModel> | null, tx?: ITransaction): void {\n\t\tconst currentModel = this._diffModel.get();\n\n\t\tif (!viewModel && currentModel) {\n\t\t\t// Transitioning from a model to no-model\n\t\t\tthis._accessibleDiffViewer.get().close();\n\t\t}\n\n\t\tif (this._diffModel.get() !== viewModel?.object) {\n\t\t\tsubtransaction(tx, tx => {\n\t\t\t\tconst vm = viewModel?.object;\n\t\t\t\t/** @description DiffEditorWidget.setModel */\n\t\t\t\tobservableFromEvent.batchEventsGlobally(tx, () => {\n\t\t\t\t\tthis._editors.original.setModel(vm ? vm.model.original : null);\n\t\t\t\t\tthis._editors.modified.setModel(vm ? vm.model.modified : null);\n\t\t\t\t});\n\t\t\t\tconst prevValueRef = this._diffModelSrc.get()?.createNewRef(this);\n\t\t\t\tthis._diffModelSrc.set(viewModel?.createNewRef(this) as RefCounted<DiffEditorViewModel> | undefined, tx);\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// async, so that this runs after the transaction finished.\n\t\t\t\t\t// TODO: use the transaction to schedule disposal\n\t\t\t\t\tprevValueRef?.dispose();\n\t\t\t\t}, 0);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @param changedOptions Only has values for top-level options that have actually changed.\n\t */\n\toverride updateOptions(changedOptions: IDiffEditorOptions): void {\n\t\tthis._options.updateOptions(changedOptions);\n\t}\n\tgetContainerDomNode(): HTMLElement { return this._domElement; }\n\tgetOriginalEditor(): ICodeEditor { return this._editors.original; }\n\tgetModifiedEditor(): ICodeEditor { return this._editors.modified; }\n\n\tprivate readonly _diffValue;\n\treadonly onDidUpdateDiff: Event<void>;\n\n\t/**\n\t * @deprecated Use `this.getDiffComputationResult().changes2` instead.\n\t */\n\tgetLineChanges(): ILineChange[] | null {\n\t\tconst diffState = this._diffModel.get()?.diff.get();\n\t\tif (!diffState) { return null; }\n\t\treturn toLineChanges(diffState);\n\t}\n\n\trevert(diff: LineRangeMapping): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tthis._editors.modified.executeEdits('diffEditor', [\n\t\t\t{\n\t\t\t\trange: diff.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(diff.original.toExclusiveRange())\n\t\t\t}\n\t\t]);\n\t}\n\n\trevertRangeMappings(diffs: RangeMapping[]): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst changes: IIdentifiedSingleEditOperation[] = diffs.map<IIdentifiedSingleEditOperation>(c => ({\n\t\t\trange: c.modifiedRange,\n\t\t\ttext: model.model.original.getValueInRange(c.originalRange)\n\t\t}));\n\n\t\tthis._editors.modified.executeEdits('diffEditor', changes);\n\t}\n\n\trevertFocusedRangeMappings() {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) { return; }\n\n\t\tconst modifiedEditor = this._editors.modified;\n\t\tif (!modifiedEditor.hasTextFocus()) { return; }\n\n\t\tconst curLineNumber = modifiedEditor.getPosition()!.lineNumber;\n\t\tconst selection = modifiedEditor.getSelection();\n\t\tconst selectedRange = LineRange.fromRange(selection || new Range(curLineNumber, 0, curLineNumber, 0));\n\t\tconst diffsToRevert = diffs.filter(d => {\n\t\t\treturn d.lineRangeMapping.modified.intersect(selectedRange);\n\t\t});\n\n\t\tmodifiedEditor.executeEdits('diffEditor', diffsToRevert.map(d => (\n\t\t\t{\n\t\t\t\trange: d.lineRangeMapping.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange())\n\t\t\t}\n\t\t)));\n\t}\n\n\n\tprivate _goTo(diff: DiffMapping): void {\n\t\tthis._editors.modified.setPosition(new Position(diff.lineRangeMapping.modified.startLineNumber, 1));\n\t\tthis._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modified.toExclusiveRange());\n\t}\n\n\tgoToDiff(target: 'previous' | 'next'): void {\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst curLineNumber = this._editors.modified.getPosition()!.lineNumber;\n\t\tlet diff: DiffMapping | undefined;\n\t\tif (target === 'next') {\n\t\t\tconst modifiedLineCount = this._editors.modified.getModel()!.getLineCount();\n\t\t\tif (modifiedLineCount === curLineNumber) {\n\t\t\t\tdiff = diffs[0];\n\t\t\t} else {\n\t\t\t\tdiff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];\n\t\t\t}\n\t\t} else {\n\t\t\tdiff = findLast(diffs, d => d.lineRangeMapping.modified.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1];\n\t\t}\n\t\tthis._goTo(diff);\n\n\t\tif (diff.lineRangeMapping.modified.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff.lineRangeMapping.original.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.goToDiff' });\n\t\t}\n\t}\n\n\trevealFirstDiff(): void {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) {\n\t\t\treturn;\n\t\t}\n\t\t// wait for the diff computation to finish\n\t\tthis.waitForDiff().then(() => {\n\t\t\tconst diffs = diffModel.diff.get()?.mappings;\n\t\t\tif (!diffs || diffs.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._goTo(diffs[0]);\n\t\t});\n\t}\n\n\taccessibleDiffViewerNext(): void { this._accessibleDiffViewer.get().next(); }\n\n\taccessibleDiffViewerPrev(): void { this._accessibleDiffViewer.get().prev(); }\n\n\tasync waitForDiff(): Promise<void> {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) { return; }\n\t\tawait diffModel.waitForDiff();\n\t}\n\n\tmapToOtherSide(): { destination: CodeEditorWidget; destinationSelection: Range | undefined } {\n\t\tconst isModifiedFocus = this._editors.modified.hasWidgetFocus();\n\t\tconst source = isModifiedFocus ? this._editors.modified : this._editors.original;\n\t\tconst destination = isModifiedFocus ? this._editors.original : this._editors.modified;\n\n\t\tlet destinationSelection: Range | undefined;\n\n\t\tconst sourceSelection = source.getSelection();\n\t\tif (sourceSelection) {\n\t\t\tconst mappings = this._diffModel.get()?.diff.get()?.mappings.map(m => isModifiedFocus ? m.lineRangeMapping.flip() : m.lineRangeMapping);\n\t\t\tif (mappings) {\n\t\t\t\tconst newRange1 = translatePosition(sourceSelection.getStartPosition(), mappings);\n\t\t\t\tconst newRange2 = translatePosition(sourceSelection.getEndPosition(), mappings);\n\t\t\t\tdestinationSelection = Range.plusRange(newRange1, newRange2);\n\t\t\t}\n\t\t}\n\t\treturn { destination, destinationSelection };\n\t}\n\n\tswitchSide(): void {\n\t\tconst { destination, destinationSelection } = this.mapToOtherSide();\n\t\tdestination.focus();\n\t\tif (destinationSelection) {\n\t\t\tdestination.setSelection(destinationSelection);\n\t\t}\n\t}\n\n\texitCompareMove(): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model) { return; }\n\t\tmodel.movedTextToCompare.set(undefined, undefined);\n\t}\n\n\tcollapseAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.collapseAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tshowAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.showAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _handleCursorPositionChange(e: ICursorPositionChangedEvent | undefined, isModifiedEditor: boolean): void {\n\t\tif (e?.reason === CursorChangeReason.Explicit) {\n\t\t\tconst diff = this._diffModel.get()?.diff.get()?.mappings.find(m => isModifiedEditor ? m.lineRangeMapping.modified.contains(e.position.lineNumber) : m.lineRangeMapping.original.contains(e.position.lineNumber));\n\t\t\tif (diff?.lineRangeMapping.modified.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff?.lineRangeMapping.original.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function toLineChanges(state: DiffState): ILineChange[] {\n\treturn state.mappings.map(x => {\n\t\tconst m = x.lineRangeMapping;\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet innerChanges = m.innerChanges;\n\n\t\tif (m.original.isEmpty) {\n\t\t\t// Insertion\n\t\t\toriginalStartLineNumber = m.original.startLineNumber - 1;\n\t\t\toriginalEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\toriginalStartLineNumber = m.original.startLineNumber;\n\t\t\toriginalEndLineNumber = m.original.endLineNumberExclusive - 1;\n\t\t}\n\n\t\tif (m.modified.isEmpty) {\n\t\t\t// Deletion\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber - 1;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber;\n\t\t\tmodifiedEndLineNumber = m.modified.endLineNumberExclusive - 1;\n\t\t}\n\n\t\treturn {\n\t\t\toriginalStartLineNumber,\n\t\t\toriginalEndLineNumber,\n\t\t\tmodifiedStartLineNumber,\n\t\t\tmodifiedEndLineNumber,\n\t\t\tcharChanges: innerChanges?.map(m => ({\n\t\t\t\toriginalStartLineNumber: m.originalRange.startLineNumber,\n\t\t\t\toriginalStartColumn: m.originalRange.startColumn,\n\t\t\t\toriginalEndLineNumber: m.originalRange.endLineNumber,\n\t\t\t\toriginalEndColumn: m.originalRange.endColumn,\n\t\t\t\tmodifiedStartLineNumber: m.modifiedRange.startLineNumber,\n\t\t\t\tmodifiedStartColumn: m.modifiedRange.startColumn,\n\t\t\t\tmodifiedEndLineNumber: m.modifiedRange.endLineNumber,\n\t\t\t\tmodifiedEndColumn: m.modifiedRange.endColumn,\n\t\t\t}))\n\t\t};\n\t});\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getWindow, h } from '../../../../base/browser/dom.js';\nimport { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js';\nimport { findLast } from '../../../../base/common/arraysFind.js';\nimport { BugIndicatingError, onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js';\nimport { toDisposable } from '../../../../base/common/lifecycle.js';\nimport { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedDisposable, disposableObservableValue, observableFromEvent, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../base/common/observable.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { bindContextKey } from '../../../../platform/observable/common/platformObservableUtils.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { ILineChange } from '../../../common/diff/legacyLinesDiffComputer.js';\nimport { LineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { IIdentifiedSingleEditOperation } from '../../../common/model.js';\nimport { IEditorConstructionOptions } from '../../config/editorConfiguration.js';\nimport { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from '../../editorBrowser.js';\nimport { EditorExtensionsRegistry, IDiffEditorContributionDescription } from '../../editorExtensions.js';\nimport { ICodeEditorService } from '../../services/codeEditorService.js';\nimport { StableEditorScrollState } from '../../stableEditorScroll.js';\nimport { CodeEditorWidget, ICodeEditorWidgetOptions } from '../codeEditor/codeEditorWidget.js';\nimport { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from './components/accessibleDiffViewer.js';\nimport { DiffEditorDecorations } from './components/diffEditorDecorations.js';\nimport { DiffEditorEditors } from './components/diffEditorEditors.js';\nimport { DiffEditorSash, SashLayout } from './components/diffEditorSash.js';\nimport { DiffEditorViewZones } from './components/diffEditorViewZones/diffEditorViewZones.js';\nimport { DelegatingEditor } from './delegatingEditorImpl.js';\nimport { DiffEditorOptions } from './diffEditorOptions.js';\nimport { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel.js';\nimport { DiffEditorGutter } from './features/gutterFeature.js';\nimport { HideUnchangedRegionsFeature } from './features/hideUnchangedRegionsFeature.js';\nimport { MovedBlocksLinesFeature } from './features/movedBlocksLinesFeature.js';\nimport { OverviewRulerFeature } from './features/overviewRulerFeature.js';\nimport { RevertButtonsFeature } from './features/revertButtonsFeature.js';\nimport './style.css';\nimport { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyViewZones, translatePosition } from './utils.js';\n\nexport interface IDiffCodeEditorWidgetOptions {\n\toriginalEditor?: ICodeEditorWidgetOptions;\n\tmodifiedEditor?: ICodeEditorWidgetOptions;\n}\n\nexport class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {\n\n\tprivate readonly elements;\n\tprivate readonly _diffModelSrc;\n\tprivate readonly _diffModel;\n\tpublic readonly onDidChangeModel;\n\n\tpublic get onDidContentSizeChange() { return this._editors.onDidContentSizeChange; }\n\n\tprivate readonly _contextKeyService;\n\tprivate readonly _instantiationService;\n\tprivate readonly _rootSizeObserver: ObservableElementSizeObserver;\n\n\n\tprivate readonly _sashLayout: SashLayout;\n\tprivate readonly _sash: IObservable<DiffEditorSash | undefined>;\n\tprivate readonly _boundarySashes;\n\n\tprivate _accessibleDiffViewerShouldBeVisible;\n\tprivate _accessibleDiffViewerVisible;\n\tprivate readonly _accessibleDiffViewer: IObservable<AccessibleDiffViewer>;\n\tprivate readonly _options: DiffEditorOptions;\n\tprivate readonly _editors: DiffEditorEditors;\n\n\tprivate readonly _overviewRulerPart: IObservable<OverviewRulerFeature | undefined>;\n\tprivate readonly _movedBlocksLinesPart;\n\n\tprivate readonly _gutter: IObservable<DiffEditorGutter | undefined>;\n\n\tconstructor(\n\t\tprivate readonly _domElement: HTMLElement,\n\t\toptions: Readonly<IDiffEditorConstructionOptions>,\n\t\tcodeEditorWidgetOptions: IDiffCodeEditorWidgetOptions,\n\t\t@IContextKeyService private readonly _parentContextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,\n\t\t@ICodeEditorService codeEditorService: ICodeEditorService,\n\t\t@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,\n\t\t@IEditorProgressService private readonly _editorProgressService: IEditorProgressService,\n\t) {\n\t\tsuper();\n\t\tthis.elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [\n\t\t\th('div.editor.original@original', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),\n\t\t]);\n\t\tthis._diffModelSrc = this._register(disposableObservableValue<RefCounted<DiffEditorViewModel> | undefined>(this, undefined));\n\t\tthis._diffModel = derived<DiffEditorViewModel | undefined>(this, reader => this._diffModelSrc.read(reader)?.object);\n\t\tthis.onDidChangeModel = Event.fromObservableLight(this._diffModel);\n\t\tthis._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement));\n\t\tthis._instantiationService = this._register(this._parentInstantiationService.createChild(\n\t\t\tnew ServiceCollection([IContextKeyService, this._contextKeyService])\n\t\t));\n\t\tthis._boundarySashes = observableValue<IBoundarySashes | undefined>(this, undefined);\n\t\tthis._accessibleDiffViewerShouldBeVisible = observableValue(this, false);\n\t\tthis._accessibleDiffViewerVisible = derived(this, reader =>\n\t\t\tthis._options.onlyShowAccessibleDiffViewer.read(reader)\n\t\t\t\t? true\n\t\t\t\t: this._accessibleDiffViewerShouldBeVisible.read(reader)\n\t\t);\n\t\tthis._movedBlocksLinesPart = observableValue<MovedBlocksLinesFeature | undefined>(this, undefined);\n\t\tthis._layoutInfo = derived(this, reader => {\n\t\t\tconst fullWidth = this._rootSizeObserver.width.read(reader);\n\t\t\tconst fullHeight = this._rootSizeObserver.height.read(reader);\n\n\t\t\tif (this._rootSizeObserver.automaticLayout) {\n\t\t\t\tthis.elements.root.style.height = '100%';\n\t\t\t} else {\n\t\t\t\tthis.elements.root.style.height = fullHeight + 'px';\n\t\t\t}\n\n\t\t\tconst sash = this._sash.read(reader);\n\n\t\t\tconst gutter = this._gutter.read(reader);\n\t\t\tconst gutterWidth = gutter?.width.read(reader) ?? 0;\n\n\t\t\tconst overviewRulerPartWidth = this._overviewRulerPart.read(reader)?.width ?? 0;\n\n\t\t\tlet originalLeft: number, originalWidth: number, modifiedLeft: number, modifiedWidth: number, gutterLeft: number;\n\n\t\t\tconst sideBySide = !!sash;\n\t\t\tif (sideBySide) {\n\t\t\t\tconst sashLeft = sash.sashLeft.read(reader);\n\t\t\t\tconst movedBlocksLinesWidth = this._movedBlocksLinesPart.read(reader)?.width.read(reader) ?? 0;\n\n\t\t\t\toriginalLeft = 0;\n\t\t\t\toriginalWidth = sashLeft - gutterWidth - movedBlocksLinesWidth;\n\n\t\t\t\tgutterLeft = sashLeft - gutterWidth;\n\n\t\t\t\tmodifiedLeft = sashLeft;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t} else {\n\t\t\t\tgutterLeft = 0;\n\n\t\t\t\tconst shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader);\n\t\t\t\toriginalLeft = gutterWidth;\n\t\t\t\tif (shouldHideOriginalLineNumbers) {\n\t\t\t\t\toriginalWidth = 0;\n\t\t\t\t} else {\n\t\t\t\t\toriginalWidth = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(reader));\n\t\t\t\t}\n\n\t\t\t\tmodifiedLeft = gutterWidth + originalWidth;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t}\n\n\t\t\tthis.elements.original.style.left = originalLeft + 'px';\n\t\t\tthis.elements.original.style.width = originalWidth + 'px';\n\t\t\tthis._editors.original.layout({ width: originalWidth, height: fullHeight }, true);\n\n\t\t\tgutter?.layout(gutterLeft);\n\n\t\t\tthis.elements.modified.style.left = modifiedLeft + 'px';\n\t\t\tthis.elements.modified.style.width = modifiedWidth + 'px';\n\t\t\tthis._editors.modified.layout({ width: modifiedWidth, height: fullHeight }, true);\n\n\t\t\treturn {\n\t\t\t\tmodifiedEditor: this._editors.modified.getLayoutInfo(),\n\t\t\t\toriginalEditor: this._editors.original.getLayoutInfo(),\n\t\t\t};\n\t\t});\n\t\tthis._diffValue = this._diffModel.map((m, r) => m?.diff.read(r));\n\t\tthis.onDidUpdateDiff = Event.fromObservableLight(this._diffValue);\n\t\tcodeEditorService.willCreateDiffEditor();\n\n\t\tthis._contextKeyService.createKey('isInDiffEditor', true);\n\n\t\tthis._domElement.appendChild(this.elements.root);\n\t\tthis._register(toDisposable(() => this.elements.root.remove()));\n\n\t\tthis._rootSizeObserver = this._register(new ObservableElementSizeObserver(this.elements.root, options.dimension));\n\t\tthis._rootSizeObserver.setAutomaticLayout(options.automaticLayout ?? false);\n\n\t\tthis._options = this._instantiationService.createInstance(DiffEditorOptions, options);\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setWidth(this._rootSizeObserver.width.read(reader));\n\t\t}));\n\n\t\tthis._contextKeyService.createKey(EditorContextKeys.isEmbeddedDiffEditor.key, false);\n\t\tthis._register(bindContextKey(EditorContextKeys.isEmbeddedDiffEditor, this._contextKeyService,\n\t\t\treader => this._options.isInEmbeddedEditor.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.comparingMovedCode, this._contextKeyService,\n\t\t\treader => !!this._diffModel.read(reader)?.movedTextToCompare.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService,\n\t\t\treader => this._options.couldShowInlineViewBecauseOfSize.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorInlineMode, this._contextKeyService,\n\t\t\treader => !this._options.renderSideBySide.read(reader)\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.hasChanges, this._contextKeyService,\n\t\t\treader => (this._diffModel.read(reader)?.diff.read(reader)?.mappings.length ?? 0) > 0\n\t\t));\n\n\t\tthis._editors = this._register(this._instantiationService.createInstance(\n\t\t\tDiffEditorEditors,\n\t\t\tthis.elements.original,\n\t\t\tthis.elements.modified,\n\t\t\tthis._options,\n\t\t\tcodeEditorWidgetOptions,\n\t\t\t(i, c, o, o2) => this._createInnerEditor(i, c, o, o2),\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalWritable, this._contextKeyService,\n\t\t\treader => this._options.originalEditable.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedWritable, this._contextKeyService,\n\t\t\treader => !this._options.readOnly.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.original.uri.toString() ?? ''\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.modified.uri.toString() ?? ''\n\t\t));\n\n\t\tthis._overviewRulerPart = derivedDisposable(this, reader =>\n\t\t\t!this._options.renderOverviewRuler.read(reader)\n\t\t\t\t? undefined\n\t\t\t\t: this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(OverviewRulerFeature, reader),\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst dimensions = {\n\t\t\theight: this._rootSizeObserver.height,\n\t\t\twidth: this._rootSizeObserver.width.map((w, reader) => w - (this._overviewRulerPart.read(reader)?.width ?? 0)),\n\t\t};\n\n\t\tthis._sashLayout = new SashLayout(this._options, dimensions);\n\n\t\tthis._sash = derivedDisposable(this, reader => {\n\t\t\tconst showSash = this._options.renderSideBySide.read(reader);\n\t\t\tthis.elements.root.classList.toggle('side-by-side', showSash);\n\t\t\treturn !showSash ? undefined : new DiffEditorSash(\n\t\t\t\tthis.elements.root,\n\t\t\t\tdimensions,\n\t\t\t\tthis._options.enableSplitViewResizing,\n\t\t\t\tthis._boundarySashes,\n\t\t\t\tthis._sashLayout.sashLeft,\n\t\t\t\t() => this._sashLayout.resetSash(),\n\t\t\t);\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst unchangedRangesFeature = derivedDisposable(this, reader => /** @description UnchangedRangesFeature */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(HideUnchangedRegionsFeature, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tderivedDisposable(this, reader => /** @description DiffEditorDecorations */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorDecorations, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options, this,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst origViewZoneIdsToIgnore = new Set<string>();\n\t\tconst modViewZoneIdsToIgnore = new Set<string>();\n\t\tlet isUpdatingViewZones = false;\n\t\tconst viewZoneManager = derivedDisposable(this, reader => /** @description ViewZoneManager */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorViewZones, reader),\n\t\t\t\tgetWindow(this._domElement),\n\t\t\t\tthis._editors,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._options,\n\t\t\t\tthis,\n\t\t\t\t() => isUpdatingViewZones || unchangedRangesFeature.read(undefined).isUpdatingHiddenAreas,\n\t\t\t\torigViewZoneIdsToIgnore,\n\t\t\t\tmodViewZoneIdsToIgnore\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst originalViewZones = derived(this, (reader) => { /** @description originalViewZones */\n\t\t\tconst orig = viewZoneManager.read(reader).viewZones.read(reader).orig;\n\t\t\tconst orig2 = unchangedRangesFeature.read(reader).viewZones.read(reader).origViewZones;\n\t\t\treturn orig.concat(orig2);\n\t\t});\n\t\tconst modifiedViewZones = derived(this, (reader) => { /** @description modifiedViewZones */\n\t\t\tconst mod = viewZoneManager.read(reader).viewZones.read(reader).mod;\n\t\t\tconst mod2 = unchangedRangesFeature.read(reader).viewZones.read(reader).modViewZones;\n\t\t\treturn mod.concat(mod2);\n\t\t});\n\t\tthis._register(applyViewZones(this._editors.original, originalViewZones, isUpdatingOrigViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingOrigViewZones;\n\t\t}, origViewZoneIdsToIgnore));\n\t\tlet scrollState: StableEditorScrollState | undefined;\n\t\tthis._register(applyViewZones(this._editors.modified, modifiedViewZones, isUpdatingModViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingModViewZones;\n\t\t\tif (isUpdatingViewZones) {\n\t\t\t\tscrollState = StableEditorScrollState.capture(this._editors.modified);\n\t\t\t} else {\n\t\t\t\tscrollState?.restore(this._editors.modified);\n\t\t\t\tscrollState = undefined;\n\t\t\t}\n\t\t}, modViewZoneIdsToIgnore));\n\n\t\tthis._accessibleDiffViewer = derivedDisposable(this, reader =>\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(AccessibleDiffViewer, reader),\n\t\t\t\tthis.elements.accessibleDiffViewer,\n\t\t\t\tthis._accessibleDiffViewerVisible,\n\t\t\t\t(visible, tx) => this._accessibleDiffViewerShouldBeVisible.set(visible, tx),\n\t\t\t\tthis._options.onlyShowAccessibleDiffViewer.map(v => !v),\n\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\tthis._diffModel.map((m, r) => m?.diff.read(r)?.mappings.map(m => m.lineRangeMapping)),\n\t\t\t\tnew AccessibleDiffViewerModelFromEditors(this._editors),\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst visibility = this._accessibleDiffViewerVisible.map<CSSStyle['visibility']>(v => v ? 'hidden' : 'visible');\n\t\tthis._register(applyStyle(this.elements.modified, { visibility }));\n\t\tthis._register(applyStyle(this.elements.original, { visibility }));\n\n\t\tthis._createDiffEditorContributions();\n\n\t\tcodeEditorService.addDiffEditor(this);\n\n\t\tthis._gutter = derivedDisposable(this, reader => {\n\t\t\treturn this._options.shouldRenderGutterMenu.read(reader)\n\t\t\t\t? this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(DiffEditorGutter, reader),\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis._options,\n\t\t\t\t\tthis._sashLayout,\n\t\t\t\t\tthis._boundarySashes,\n\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t});\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._layoutInfo));\n\n\t\tderivedDisposable(this, reader => /** @description MovedBlocksLinesPart */\n\t\t\tnew (readHotReloadableExport(MovedBlocksLinesFeature, reader))(\n\t\t\t\tthis.elements.root,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._layoutInfo.map(i => i.originalEditor),\n\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\tthis._editors,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store, value => {\n\t\t\t// This is to break the layout info <-> moved blocks lines part dependency cycle.\n\t\t\tthis._movedBlocksLinesPart.set(value, undefined);\n\t\t});\n\n\t\tthis._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, true)));\n\t\tthis._register(Event.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, false)));\n\n\t\tconst isInitializingDiff = this._diffModel.map(this, (m, reader) => {\n\t\t\t/** @isInitializingDiff isDiffUpToDate */\n\t\t\tif (!m) { return undefined; }\n\t\t\treturn m.diff.read(reader) === undefined && !m.isDiffUpToDate.read(reader);\n\t\t});\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\t/** @description DiffEditorWidgetHelper.ShowProgress */\n\t\t\tif (isInitializingDiff.read(reader) === true) {\n\t\t\t\tconst r = this._editorProgressService.show(true, 1000);\n\t\t\t\tstore.add(toDisposable(() => r.done()));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tstore.add(new (readHotReloadableExport(RevertButtonsFeature, reader))(this._editors, this._diffModel, this._options, this));\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst model = this._diffModel.read(reader);\n\t\t\tif (!model) { return; }\n\t\t\tfor (const m of [model.model.original, model.model.modified]) {\n\t\t\t\tstore.add(m.onWillDispose(e => {\n\t\t\t\t\tonUnexpectedError(new BugIndicatingError('TextModel got disposed before DiffEditorWidget model got reset'));\n\t\t\t\t\tthis.setModel(null);\n\t\t\t\t}));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setModel(this._diffModel.read(reader));\n\t\t}));\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: Readonly<IEditorConstructionOptions>, editorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\tconst editor = instantiationService.createInstance(CodeEditorWidget, container, options, editorWidgetOptions);\n\t\treturn editor;\n\t}\n\n\tprivate readonly _layoutInfo;\n\n\tprivate _createDiffEditorContributions() {\n\t\tconst contributions: IDiffEditorContributionDescription[] = EditorExtensionsRegistry.getDiffEditorContributions();\n\t\tfor (const desc of contributions) {\n\t\t\ttry {\n\t\t\t\tthis._register(this._instantiationService.createInstance(desc.ctor, this));\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override get _targetEditor(): CodeEditorWidget { return this._editors.modified; }\n\n\toverride getEditorType(): string { return EditorType.IDiffEditor; }\n\n\toverride layout(dimension?: IDimension | undefined): void {\n\t\tthis._rootSizeObserver.observe(dimension);\n\t}\n\n\toverride hasTextFocus(): boolean { return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus(); }\n\n\tpublic override saveViewState(): IDiffEditorViewState {\n\t\tconst originalViewState = this._editors.original.saveViewState();\n\t\tconst modifiedViewState = this._editors.modified.saveViewState();\n\t\treturn {\n\t\t\toriginal: originalViewState,\n\t\t\tmodified: modifiedViewState,\n\t\t\tmodelState: this._diffModel.get()?.serializeState(),\n\t\t};\n\t}\n\n\tpublic override restoreViewState(s: IDiffEditorViewState): void {\n\t\tif (s && s.original && s.modified) {\n\t\t\tconst diffEditorState = s as IDiffEditorViewState;\n\t\t\tthis._editors.original.restoreViewState(diffEditorState.original);\n\t\t\tthis._editors.modified.restoreViewState(diffEditorState.modified);\n\t\t\tif (diffEditorState.modelState) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\tthis._diffModel.get()?.restoreSerializedState(diffEditorState.modelState as any);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleInitialized(): void {\n\t\tthis._editors.original.handleInitialized();\n\t\tthis._editors.modified.handleInitialized();\n\t}\n\n\tpublic createViewModel(model: IDiffEditorModel): IDiffEditorViewModel {\n\t\treturn this._instantiationService.createInstance(DiffEditorViewModel, model, this._options);\n\t}\n\n\toverride getModel(): IDiffEditorModel | null { return this._diffModel.get()?.model ?? null; }\n\n\toverride setModel(model: IDiffEditorModel | null | IDiffEditorViewModel): void {\n\t\tconst vm = !model ? null\n\t\t\t: ('model' in model) ? RefCounted.create(model).createNewRef(this)\n\t\t\t\t: RefCounted.create(this.createViewModel(model), this);\n\t\tthis.setDiffModel(vm);\n\t}\n\n\tsetDiffModel(viewModel: RefCounted<IDiffEditorViewModel> | null, tx?: ITransaction): void {\n\t\tconst currentModel = this._diffModel.get();\n\n\t\tif (!viewModel && currentModel) {\n\t\t\t// Transitioning from a model to no-model\n\t\t\tthis._accessibleDiffViewer.get().close();\n\t\t}\n\n\t\tif (this._diffModel.get() !== viewModel?.object) {\n\t\t\tsubtransaction(tx, tx => {\n\t\t\t\tconst vm = viewModel?.object;\n\t\t\t\t/** @description DiffEditorWidget.setModel */\n\t\t\t\tobservableFromEvent.batchEventsGlobally(tx, () => {\n\t\t\t\t\tthis._editors.original.setModel(vm ? vm.model.original : null);\n\t\t\t\t\tthis._editors.modified.setModel(vm ? vm.model.modified : null);\n\t\t\t\t});\n\t\t\t\tconst prevValueRef = this._diffModelSrc.get()?.createNewRef(this);\n\t\t\t\tthis._diffModelSrc.set(viewModel?.createNewRef(this) as RefCounted<DiffEditorViewModel> | undefined, tx);\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// async, so that this runs after the transaction finished.\n\t\t\t\t\t// TODO: use the transaction to schedule disposal\n\t\t\t\t\tprevValueRef?.dispose();\n\t\t\t\t}, 0);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @param changedOptions Only has values for top-level options that have actually changed.\n\t */\n\toverride updateOptions(changedOptions: IDiffEditorOptions): void {\n\t\tthis._options.updateOptions(changedOptions);\n\t}\n\tgetContainerDomNode(): HTMLElement { return this._domElement; }\n\tgetOriginalEditor(): ICodeEditor { return this._editors.original; }\n\tgetModifiedEditor(): ICodeEditor { return this._editors.modified; }\n\n\tprivate readonly _diffValue;\n\treadonly onDidUpdateDiff: Event<void>;\n\n\t/**\n\t * @deprecated Use `this.getDiffComputationResult().changes2` instead.\n\t */\n\tgetLineChanges(): ILineChange[] | null {\n\t\tconst diffState = this._diffModel.get()?.diff.get();\n\t\tif (!diffState) { return null; }\n\t\treturn toLineChanges(diffState);\n\t}\n\n\trevert(diff: LineRangeMapping): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tthis._editors.modified.executeEdits('diffEditor', [\n\t\t\t{\n\t\t\t\trange: diff.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(diff.original.toExclusiveRange())\n\t\t\t}\n\t\t]);\n\t}\n\n\trevertRangeMappings(diffs: RangeMapping[]): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst changes: IIdentifiedSingleEditOperation[] = diffs.map<IIdentifiedSingleEditOperation>(c => ({\n\t\t\trange: c.modifiedRange,\n\t\t\ttext: model.model.original.getValueInRange(c.originalRange)\n\t\t}));\n\n\t\tthis._editors.modified.executeEdits('diffEditor', changes);\n\t}\n\n\trevertFocusedRangeMappings() {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) { return; }\n\n\t\tconst modifiedEditor = this._editors.modified;\n\t\tif (!modifiedEditor.hasTextFocus()) { return; }\n\n\t\tconst curLineNumber = modifiedEditor.getPosition()!.lineNumber;\n\t\tconst selection = modifiedEditor.getSelection();\n\t\tconst selectedRange = LineRange.fromRange(selection || new Range(curLineNumber, 0, curLineNumber, 0));\n\t\tconst diffsToRevert = diffs.filter(d => {\n\t\t\treturn d.lineRangeMapping.modified.intersect(selectedRange);\n\t\t});\n\n\t\tmodifiedEditor.executeEdits('diffEditor', diffsToRevert.map(d => (\n\t\t\t{\n\t\t\t\trange: d.lineRangeMapping.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange())\n\t\t\t}\n\t\t)));\n\t}\n\n\n\tprivate _goTo(diff: DiffMapping): void {\n\t\tthis._editors.modified.setPosition(new Position(diff.lineRangeMapping.modified.startLineNumber, 1));\n\t\tthis._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modified.toExclusiveRange());\n\t}\n\n\tgoToDiff(target: 'previous' | 'next'): void {\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst curLineNumber = this._editors.modified.getPosition()!.lineNumber;\n\t\tlet diff: DiffMapping | undefined;\n\t\tif (target === 'next') {\n\t\t\tconst modifiedLineCount = this._editors.modified.getModel()!.getLineCount();\n\t\t\tif (modifiedLineCount === curLineNumber) {\n\t\t\t\tdiff = diffs[0];\n\t\t\t} else {\n\t\t\t\tdiff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];\n\t\t\t}\n\t\t} else {\n\t\t\tdiff = findLast(diffs, d => d.lineRangeMapping.modified.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1];\n\t\t}\n\t\tthis._goTo(diff);\n\n\t\tif (diff.lineRangeMapping.modified.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff.lineRangeMapping.original.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.goToDiff' });\n\t\t}\n\t}\n\n\trevealFirstDiff(): void {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) {\n\t\t\treturn;\n\t\t}\n\t\t// wait for the diff computation to finish\n\t\tthis.waitForDiff().then(() => {\n\t\t\tconst diffs = diffModel.diff.get()?.mappings;\n\t\t\tif (!diffs || diffs.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._goTo(diffs[0]);\n\t\t});\n\t}\n\n\taccessibleDiffViewerNext(): void { this._accessibleDiffViewer.get().next(); }\n\n\taccessibleDiffViewerPrev(): void { this._accessibleDiffViewer.get().prev(); }\n\n\tasync waitForDiff(): Promise<void> {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) { return; }\n\t\tawait diffModel.waitForDiff();\n\t}\n\n\tmapToOtherSide(): { destination: CodeEditorWidget; destinationSelection: Range | undefined } {\n\t\tconst isModifiedFocus = this._editors.modified.hasWidgetFocus();\n\t\tconst source = isModifiedFocus ? this._editors.modified : this._editors.original;\n\t\tconst destination = isModifiedFocus ? this._editors.original : this._editors.modified;\n\n\t\tlet destinationSelection: Range | undefined;\n\n\t\tconst sourceSelection = source.getSelection();\n\t\tif (sourceSelection) {\n\t\t\tconst mappings = this._diffModel.get()?.diff.get()?.mappings.map(m => isModifiedFocus ? m.lineRangeMapping.flip() : m.lineRangeMapping);\n\t\t\tif (mappings) {\n\t\t\t\tconst newRange1 = translatePosition(sourceSelection.getStartPosition(), mappings);\n\t\t\t\tconst newRange2 = translatePosition(sourceSelection.getEndPosition(), mappings);\n\t\t\t\tdestinationSelection = Range.plusRange(newRange1, newRange2);\n\t\t\t}\n\t\t}\n\t\treturn { destination, destinationSelection };\n\t}\n\n\tswitchSide(): void {\n\t\tconst { destination, destinationSelection } = this.mapToOtherSide();\n\t\tdestination.focus();\n\t\tif (destinationSelection) {\n\t\t\tdestination.setSelection(destinationSelection);\n\t\t}\n\t}\n\n\texitCompareMove(): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model) { return; }\n\t\tmodel.movedTextToCompare.set(undefined, undefined);\n\t}\n\n\tcollapseAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.collapseAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tshowAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.showAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _handleCursorPositionChange(e: ICursorPositionChangedEvent | undefined, isModifiedEditor: boolean): void {\n\t\tif (e?.reason === CursorChangeReason.Explicit) {\n\t\t\tconst diff = this._diffModel.get()?.diff.get()?.mappings.find(m => isModifiedEditor ? m.lineRangeMapping.modified.contains(e.position.lineNumber) : m.lineRangeMapping.original.contains(e.position.lineNumber));\n\t\t\tif (diff?.lineRangeMapping.modified.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff?.lineRangeMapping.original.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function toLineChanges(state: DiffState): ILineChange[] {\n\treturn state.mappings.map(x => {\n\t\tconst m = x.lineRangeMapping;\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet innerChanges = m.innerChanges;\n\n\t\tif (m.original.isEmpty) {\n\t\t\t// Insertion\n\t\t\toriginalStartLineNumber = m.original.startLineNumber - 1;\n\t\t\toriginalEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\toriginalStartLineNumber = m.original.startLineNumber;\n\t\t\toriginalEndLineNumber = m.original.endLineNumberExclusive - 1;\n\t\t}\n\n\t\tif (m.modified.isEmpty) {\n\t\t\t// Deletion\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber - 1;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber;\n\t\t\tmodifiedEndLineNumber = m.modified.endLineNumberExclusive - 1;\n\t\t}\n\n\t\treturn {\n\t\t\toriginalStartLineNumber,\n\t\t\toriginalEndLineNumber,\n\t\t\tmodifiedStartLineNumber,\n\t\t\tmodifiedEndLineNumber,\n\t\t\tcharChanges: innerChanges?.map(m => ({\n\t\t\t\toriginalStartLineNumber: m.originalRange.startLineNumber,\n\t\t\t\toriginalStartColumn: m.originalRange.startColumn,\n\t\t\t\toriginalEndLineNumber: m.originalRange.endLineNumber,\n\t\t\t\toriginalEndColumn: m.originalRange.endColumn,\n\t\t\t\tmodifiedStartLineNumber: m.modifiedRange.startLineNumber,\n\t\t\t\tmodifiedStartColumn: m.modifiedRange.startColumn,\n\t\t\t\tmodifiedEndLineNumber: m.modifiedRange.endLineNumber,\n\t\t\t\tmodifiedEndColumn: m.modifiedRange.endColumn,\n\t\t\t}))\n\t\t};\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts","vs/editor/browser/widget/diffEditor/diffEditorWidget.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAA6B,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,eAAe,EAAE,6BAA6B,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACtQ,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,gFAAgF,CAAC;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vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getWindow, h } from '../../../../base/browser/dom.js';\nimport { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js';\nimport { findLast } from '../../../../base/common/arraysFind.js';\nimport { BugIndicatingError, onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js';\nimport { toDisposable } from '../../../../base/common/lifecycle.js';\nimport { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedDisposable, disposableObservableValue, observableFromEvent, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../base/common/observable.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { bindContextKey } from '../../../../platform/observable/common/platformObservableUtils.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { ILineChange } from '../../../common/diff/legacyLinesDiffComputer.js';\nimport { LineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { IIdentifiedSingleEditOperation } from '../../../common/model.js';\nimport { IEditorConstructionOptions } from '../../config/editorConfiguration.js';\nimport { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from '../../editorBrowser.js';\nimport { EditorExtensionsRegistry, IDiffEditorContributionDescription } from '../../editorExtensions.js';\nimport { ICodeEditorService } from '../../services/codeEditorService.js';\nimport { StableEditorScrollState } from '../../stableEditorScroll.js';\nimport { CodeEditorWidget, ICodeEditorWidgetOptions } from '../codeEditor/codeEditorWidget.js';\nimport { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from './components/accessibleDiffViewer.js';\nimport { DiffEditorDecorations } from './components/diffEditorDecorations.js';\nimport { DiffEditorEditors } from './components/diffEditorEditors.js';\nimport { DiffEditorSash, SashLayout } from './components/diffEditorSash.js';\nimport { DiffEditorViewZones } from './components/diffEditorViewZones/diffEditorViewZones.js';\nimport { DelegatingEditor } from './delegatingEditorImpl.js';\nimport { DiffEditorOptions } from './diffEditorOptions.js';\nimport { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel.js';\nimport { DiffEditorGutter } from './features/gutterFeature.js';\nimport { HideUnchangedRegionsFeature } from './features/hideUnchangedRegionsFeature.js';\nimport { MovedBlocksLinesFeature } from './features/movedBlocksLinesFeature.js';\nimport { OverviewRulerFeature } from './features/overviewRulerFeature.js';\nimport { RevertButtonsFeature } from './features/revertButtonsFeature.js';\nimport './style.css';\nimport { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyViewZones, translatePosition } from './utils.js';\n\nexport interface IDiffCodeEditorWidgetOptions {\n\toriginalEditor?: ICodeEditorWidgetOptions;\n\tmodifiedEditor?: ICodeEditorWidgetOptions;\n}\n\nexport class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {\n\n\tprivate readonly elements;\n\tprivate readonly _diffModelSrc;\n\tprivate readonly _diffModel;\n\tpublic readonly onDidChangeModel;\n\n\tpublic get onDidContentSizeChange() { return this._editors.onDidContentSizeChange; }\n\n\tprivate readonly _contextKeyService;\n\tprivate readonly _instantiationService;\n\tprivate readonly _rootSizeObserver: ObservableElementSizeObserver;\n\n\n\tprivate readonly _sashLayout: SashLayout;\n\tprivate readonly _sash: IObservable<DiffEditorSash | undefined>;\n\tprivate readonly _boundarySashes;\n\n\tprivate _accessibleDiffViewerShouldBeVisible;\n\tprivate _accessibleDiffViewerVisible;\n\tprivate readonly _accessibleDiffViewer: IObservable<AccessibleDiffViewer>;\n\tprivate readonly _options: DiffEditorOptions;\n\tprivate readonly _editors: DiffEditorEditors;\n\n\tprivate readonly _overviewRulerPart: IObservable<OverviewRulerFeature | undefined>;\n\tprivate readonly _movedBlocksLinesPart;\n\n\tprivate readonly _gutter: IObservable<DiffEditorGutter | undefined>;\n\n\tconstructor(\n\t\tprivate readonly _domElement: HTMLElement,\n\t\toptions: Readonly<IDiffEditorConstructionOptions>,\n\t\tcodeEditorWidgetOptions: IDiffCodeEditorWidgetOptions,\n\t\t@IContextKeyService private readonly _parentContextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,\n\t\t@IEditorProgressService private readonly _editorProgressService: IEditorProgressService,\n\t) {\n\t\tsuper();\n\t\tthis.elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [\n\t\t\th('div.editor.original@original', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),\n\t\t]);\n\t\tthis._diffModelSrc = this._register(disposableObservableValue<RefCounted<DiffEditorViewModel> | undefined>(this, undefined));\n\t\tthis._diffModel = derived<DiffEditorViewModel | undefined>(this, reader => this._diffModelSrc.read(reader)?.object);\n\t\tthis.onDidChangeModel = Event.fromObservableLight(this._diffModel);\n\t\tthis._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement));\n\t\tthis._instantiationService = this._register(this._parentInstantiationService.createChild(\n\t\t\tnew ServiceCollection([IContextKeyService, this._contextKeyService])\n\t\t));\n\t\tthis._boundarySashes = observableValue<IBoundarySashes | undefined>(this, undefined);\n\t\tthis._accessibleDiffViewerShouldBeVisible = observableValue(this, false);\n\t\tthis._accessibleDiffViewerVisible = derived(this, reader =>\n\t\t\tthis._options.onlyShowAccessibleDiffViewer.read(reader)\n\t\t\t\t? true\n\t\t\t\t: this._accessibleDiffViewerShouldBeVisible.read(reader)\n\t\t);\n\t\tthis._movedBlocksLinesPart = observableValue<MovedBlocksLinesFeature | undefined>(this, undefined);\n\t\tthis._layoutInfo = derived(this, reader => {\n\t\t\tconst fullWidth = this._rootSizeObserver.width.read(reader);\n\t\t\tconst fullHeight = this._rootSizeObserver.height.read(reader);\n\n\t\t\tif (this._rootSizeObserver.automaticLayout) {\n\t\t\t\tthis.elements.root.style.height = '100%';\n\t\t\t} else {\n\t\t\t\tthis.elements.root.style.height = fullHeight + 'px';\n\t\t\t}\n\n\t\t\tconst sash = this._sash.read(reader);\n\n\t\t\tconst gutter = this._gutter.read(reader);\n\t\t\tconst gutterWidth = gutter?.width.read(reader) ?? 0;\n\n\t\t\tconst overviewRulerPartWidth = this._overviewRulerPart.read(reader)?.width ?? 0;\n\n\t\t\tlet originalLeft: number, originalWidth: number, modifiedLeft: number, modifiedWidth: number, gutterLeft: number;\n\n\t\t\tconst sideBySide = !!sash;\n\t\t\tif (sideBySide) {\n\t\t\t\tconst sashLeft = sash.sashLeft.read(reader);\n\t\t\t\tconst movedBlocksLinesWidth = this._movedBlocksLinesPart.read(reader)?.width.read(reader) ?? 0;\n\n\t\t\t\toriginalLeft = 0;\n\t\t\t\toriginalWidth = sashLeft - gutterWidth - movedBlocksLinesWidth;\n\n\t\t\t\tgutterLeft = sashLeft - gutterWidth;\n\n\t\t\t\tmodifiedLeft = sashLeft;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t} else {\n\t\t\t\tgutterLeft = 0;\n\n\t\t\t\tconst shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader);\n\t\t\t\toriginalLeft = gutterWidth;\n\t\t\t\tif (shouldHideOriginalLineNumbers) {\n\t\t\t\t\toriginalWidth = 0;\n\t\t\t\t} else {\n\t\t\t\t\toriginalWidth = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(reader));\n\t\t\t\t}\n\n\t\t\t\tmodifiedLeft = gutterWidth + originalWidth;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t}\n\n\t\t\tthis.elements.original.style.left = originalLeft + 'px';\n\t\t\tthis.elements.original.style.width = originalWidth + 'px';\n\t\t\tthis._editors.original.layout({ width: originalWidth, height: fullHeight }, true);\n\n\t\t\tgutter?.layout(gutterLeft);\n\n\t\t\tthis.elements.modified.style.left = modifiedLeft + 'px';\n\t\t\tthis.elements.modified.style.width = modifiedWidth + 'px';\n\t\t\tthis._editors.modified.layout({ width: modifiedWidth, height: fullHeight }, true);\n\n\t\t\treturn {\n\t\t\t\tmodifiedEditor: this._editors.modified.getLayoutInfo(),\n\t\t\t\toriginalEditor: this._editors.original.getLayoutInfo(),\n\t\t\t};\n\t\t});\n\t\tthis._diffValue = this._diffModel.map((m, r) => m?.diff.read(r));\n\t\tthis.onDidUpdateDiff = Event.fromObservableLight(this._diffValue);\n\t\tthis._codeEditorService.willCreateDiffEditor();\n\n\t\tthis._contextKeyService.createKey('isInDiffEditor', true);\n\n\t\tthis._domElement.appendChild(this.elements.root);\n\t\tthis._register(toDisposable(() => this.elements.root.remove()));\n\n\t\tthis._rootSizeObserver = this._register(new ObservableElementSizeObserver(this.elements.root, options.dimension));\n\t\tthis._rootSizeObserver.setAutomaticLayout(options.automaticLayout ?? false);\n\n\t\tthis._options = this._instantiationService.createInstance(DiffEditorOptions, options);\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setWidth(this._rootSizeObserver.width.read(reader));\n\t\t}));\n\n\t\tthis._contextKeyService.createKey(EditorContextKeys.isEmbeddedDiffEditor.key, false);\n\t\tthis._register(bindContextKey(EditorContextKeys.isEmbeddedDiffEditor, this._contextKeyService,\n\t\t\treader => this._options.isInEmbeddedEditor.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.comparingMovedCode, this._contextKeyService,\n\t\t\treader => !!this._diffModel.read(reader)?.movedTextToCompare.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService,\n\t\t\treader => this._options.couldShowInlineViewBecauseOfSize.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorInlineMode, this._contextKeyService,\n\t\t\treader => !this._options.renderSideBySide.read(reader)\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.hasChanges, this._contextKeyService,\n\t\t\treader => (this._diffModel.read(reader)?.diff.read(reader)?.mappings.length ?? 0) > 0\n\t\t));\n\n\t\tthis._editors = this._register(this._instantiationService.createInstance(\n\t\t\tDiffEditorEditors,\n\t\t\tthis.elements.original,\n\t\t\tthis.elements.modified,\n\t\t\tthis._options,\n\t\t\tcodeEditorWidgetOptions,\n\t\t\t(i, c, o, o2) => this._createInnerEditor(i, c, o, o2),\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalWritable, this._contextKeyService,\n\t\t\treader => this._options.originalEditable.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedWritable, this._contextKeyService,\n\t\t\treader => !this._options.readOnly.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.original.uri.toString() ?? ''\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.modified.uri.toString() ?? ''\n\t\t));\n\n\t\tthis._overviewRulerPart = derivedDisposable(this, reader =>\n\t\t\t!this._options.renderOverviewRuler.read(reader)\n\t\t\t\t? undefined\n\t\t\t\t: this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(OverviewRulerFeature, reader),\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst dimensions = {\n\t\t\theight: this._rootSizeObserver.height,\n\t\t\twidth: this._rootSizeObserver.width.map((w, reader) => w - (this._overviewRulerPart.read(reader)?.width ?? 0)),\n\t\t};\n\n\t\tthis._sashLayout = new SashLayout(this._options, dimensions);\n\n\t\tthis._sash = derivedDisposable(this, reader => {\n\t\t\tconst showSash = this._options.renderSideBySide.read(reader);\n\t\t\tthis.elements.root.classList.toggle('side-by-side', showSash);\n\t\t\treturn !showSash ? undefined : new DiffEditorSash(\n\t\t\t\tthis.elements.root,\n\t\t\t\tdimensions,\n\t\t\t\tthis._options.enableSplitViewResizing,\n\t\t\t\tthis._boundarySashes,\n\t\t\t\tthis._sashLayout.sashLeft,\n\t\t\t\t() => this._sashLayout.resetSash(),\n\t\t\t);\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst unchangedRangesFeature = derivedDisposable(this, reader => /** @description UnchangedRangesFeature */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(HideUnchangedRegionsFeature, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tderivedDisposable(this, reader => /** @description DiffEditorDecorations */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorDecorations, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options, this,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst origViewZoneIdsToIgnore = new Set<string>();\n\t\tconst modViewZoneIdsToIgnore = new Set<string>();\n\t\tlet isUpdatingViewZones = false;\n\t\tconst viewZoneManager = derivedDisposable(this, reader => /** @description ViewZoneManager */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorViewZones, reader),\n\t\t\t\tgetWindow(this._domElement),\n\t\t\t\tthis._editors,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._options,\n\t\t\t\tthis,\n\t\t\t\t() => isUpdatingViewZones || unchangedRangesFeature.read(undefined).isUpdatingHiddenAreas,\n\t\t\t\torigViewZoneIdsToIgnore,\n\t\t\t\tmodViewZoneIdsToIgnore\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst originalViewZones = derived(this, (reader) => { /** @description originalViewZones */\n\t\t\tconst orig = viewZoneManager.read(reader).viewZones.read(reader).orig;\n\t\t\tconst orig2 = unchangedRangesFeature.read(reader).viewZones.read(reader).origViewZones;\n\t\t\treturn orig.concat(orig2);\n\t\t});\n\t\tconst modifiedViewZones = derived(this, (reader) => { /** @description modifiedViewZones */\n\t\t\tconst mod = viewZoneManager.read(reader).viewZones.read(reader).mod;\n\t\t\tconst mod2 = unchangedRangesFeature.read(reader).viewZones.read(reader).modViewZones;\n\t\t\treturn mod.concat(mod2);\n\t\t});\n\t\tthis._register(applyViewZones(this._editors.original, originalViewZones, isUpdatingOrigViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingOrigViewZones;\n\t\t}, origViewZoneIdsToIgnore));\n\t\tlet scrollState: StableEditorScrollState | undefined;\n\t\tthis._register(applyViewZones(this._editors.modified, modifiedViewZones, isUpdatingModViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingModViewZones;\n\t\t\tif (isUpdatingViewZones) {\n\t\t\t\tscrollState = StableEditorScrollState.capture(this._editors.modified);\n\t\t\t} else {\n\t\t\t\tscrollState?.restore(this._editors.modified);\n\t\t\t\tscrollState = undefined;\n\t\t\t}\n\t\t}, modViewZoneIdsToIgnore));\n\n\t\tthis._accessibleDiffViewer = derivedDisposable(this, reader =>\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(AccessibleDiffViewer, reader),\n\t\t\t\tthis.elements.accessibleDiffViewer,\n\t\t\t\tthis._accessibleDiffViewerVisible,\n\t\t\t\t(visible, tx) => this._accessibleDiffViewerShouldBeVisible.set(visible, tx),\n\t\t\t\tthis._options.onlyShowAccessibleDiffViewer.map(v => !v),\n\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\tthis._diffModel.map((m, r) => m?.diff.read(r)?.mappings.map(m => m.lineRangeMapping)),\n\t\t\t\tnew AccessibleDiffViewerModelFromEditors(this._editors),\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst visibility = this._accessibleDiffViewerVisible.map<CSSStyle['visibility']>(v => v ? 'hidden' : 'visible');\n\t\tthis._register(applyStyle(this.elements.modified, { visibility }));\n\t\tthis._register(applyStyle(this.elements.original, { visibility }));\n\n\t\tthis._createDiffEditorContributions();\n\n\t\tthis._codeEditorService.addDiffEditor(this);\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis._codeEditorService.removeDiffEditor(this);\n\t\t}));\n\n\t\tthis._gutter = derivedDisposable(this, reader => {\n\t\t\treturn this._options.shouldRenderGutterMenu.read(reader)\n\t\t\t\t? this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(DiffEditorGutter, reader),\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis._options,\n\t\t\t\t\tthis._sashLayout,\n\t\t\t\t\tthis._boundarySashes,\n\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t});\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._layoutInfo));\n\n\t\tderivedDisposable(this, reader => /** @description MovedBlocksLinesPart */\n\t\t\tnew (readHotReloadableExport(MovedBlocksLinesFeature, reader))(\n\t\t\t\tthis.elements.root,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._layoutInfo.map(i => i.originalEditor),\n\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\tthis._editors,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store, value => {\n\t\t\t// This is to break the layout info <-> moved blocks lines part dependency cycle.\n\t\t\tthis._movedBlocksLinesPart.set(value, undefined);\n\t\t});\n\n\t\tthis._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, true)));\n\t\tthis._register(Event.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, false)));\n\n\t\tconst isInitializingDiff = this._diffModel.map(this, (m, reader) => {\n\t\t\t/** @isInitializingDiff isDiffUpToDate */\n\t\t\tif (!m) { return undefined; }\n\t\t\treturn m.diff.read(reader) === undefined && !m.isDiffUpToDate.read(reader);\n\t\t});\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\t/** @description DiffEditorWidgetHelper.ShowProgress */\n\t\t\tif (isInitializingDiff.read(reader) === true) {\n\t\t\t\tconst r = this._editorProgressService.show(true, 1000);\n\t\t\t\tstore.add(toDisposable(() => r.done()));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tstore.add(new (readHotReloadableExport(RevertButtonsFeature, reader))(this._editors, this._diffModel, this._options, this));\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst model = this._diffModel.read(reader);\n\t\t\tif (!model) { return; }\n\t\t\tfor (const m of [model.model.original, model.model.modified]) {\n\t\t\t\tstore.add(m.onWillDispose(e => {\n\t\t\t\t\tonUnexpectedError(new BugIndicatingError('TextModel got disposed before DiffEditorWidget model got reset'));\n\t\t\t\t\tthis.setModel(null);\n\t\t\t\t}));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setModel(this._diffModel.read(reader));\n\t\t}));\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: Readonly<IEditorConstructionOptions>, editorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\tconst editor = instantiationService.createInstance(CodeEditorWidget, container, options, editorWidgetOptions);\n\t\treturn editor;\n\t}\n\n\tprivate readonly _layoutInfo;\n\n\tprivate _createDiffEditorContributions() {\n\t\tconst contributions: IDiffEditorContributionDescription[] = EditorExtensionsRegistry.getDiffEditorContributions();\n\t\tfor (const desc of contributions) {\n\t\t\ttry {\n\t\t\t\tthis._register(this._instantiationService.createInstance(desc.ctor, this));\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override get _targetEditor(): CodeEditorWidget { return this._editors.modified; }\n\n\toverride getEditorType(): string { return EditorType.IDiffEditor; }\n\n\toverride layout(dimension?: IDimension | undefined): void {\n\t\tthis._rootSizeObserver.observe(dimension);\n\t}\n\n\toverride hasTextFocus(): boolean { return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus(); }\n\n\tpublic override saveViewState(): IDiffEditorViewState {\n\t\tconst originalViewState = this._editors.original.saveViewState();\n\t\tconst modifiedViewState = this._editors.modified.saveViewState();\n\t\treturn {\n\t\t\toriginal: originalViewState,\n\t\t\tmodified: modifiedViewState,\n\t\t\tmodelState: this._diffModel.get()?.serializeState(),\n\t\t};\n\t}\n\n\tpublic override restoreViewState(s: IDiffEditorViewState): void {\n\t\tif (s && s.original && s.modified) {\n\t\t\tconst diffEditorState = s as IDiffEditorViewState;\n\t\t\tthis._editors.original.restoreViewState(diffEditorState.original);\n\t\t\tthis._editors.modified.restoreViewState(diffEditorState.modified);\n\t\t\tif (diffEditorState.modelState) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\tthis._diffModel.get()?.restoreSerializedState(diffEditorState.modelState as any);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleInitialized(): void {\n\t\tthis._editors.original.handleInitialized();\n\t\tthis._editors.modified.handleInitialized();\n\t}\n\n\tpublic createViewModel(model: IDiffEditorModel): IDiffEditorViewModel {\n\t\treturn this._instantiationService.createInstance(DiffEditorViewModel, model, this._options);\n\t}\n\n\toverride getModel(): IDiffEditorModel | null { return this._diffModel.get()?.model ?? null; }\n\n\toverride setModel(model: IDiffEditorModel | null | IDiffEditorViewModel): void {\n\t\tconst vm = !model ? null\n\t\t\t: ('model' in model) ? RefCounted.create(model).createNewRef(this)\n\t\t\t\t: RefCounted.create(this.createViewModel(model), this);\n\t\tthis.setDiffModel(vm);\n\t}\n\n\tsetDiffModel(viewModel: RefCounted<IDiffEditorViewModel> | null, tx?: ITransaction): void {\n\t\tconst currentModel = this._diffModel.get();\n\n\t\tif (!viewModel && currentModel) {\n\t\t\t// Transitioning from a model to no-model\n\t\t\tthis._accessibleDiffViewer.get().close();\n\t\t}\n\n\t\tif (this._diffModel.get() !== viewModel?.object) {\n\t\t\tsubtransaction(tx, tx => {\n\t\t\t\tconst vm = viewModel?.object;\n\t\t\t\t/** @description DiffEditorWidget.setModel */\n\t\t\t\tobservableFromEvent.batchEventsGlobally(tx, () => {\n\t\t\t\t\tthis._editors.original.setModel(vm ? vm.model.original : null);\n\t\t\t\t\tthis._editors.modified.setModel(vm ? vm.model.modified : null);\n\t\t\t\t});\n\t\t\t\tconst prevValueRef = this._diffModelSrc.get()?.createNewRef(this);\n\t\t\t\tthis._diffModelSrc.set(viewModel?.createNewRef(this) as RefCounted<DiffEditorViewModel> | undefined, tx);\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// async, so that this runs after the transaction finished.\n\t\t\t\t\t// TODO: use the transaction to schedule disposal\n\t\t\t\t\tprevValueRef?.dispose();\n\t\t\t\t}, 0);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @param changedOptions Only has values for top-level options that have actually changed.\n\t */\n\toverride updateOptions(changedOptions: IDiffEditorOptions): void {\n\t\tthis._options.updateOptions(changedOptions);\n\t}\n\tgetContainerDomNode(): HTMLElement { return this._domElement; }\n\tgetOriginalEditor(): ICodeEditor { return this._editors.original; }\n\tgetModifiedEditor(): ICodeEditor { return this._editors.modified; }\n\n\tprivate readonly _diffValue;\n\treadonly onDidUpdateDiff: Event<void>;\n\n\t/**\n\t * @deprecated Use `this.getDiffComputationResult().changes2` instead.\n\t */\n\tgetLineChanges(): ILineChange[] | null {\n\t\tconst diffState = this._diffModel.get()?.diff.get();\n\t\tif (!diffState) { return null; }\n\t\treturn toLineChanges(diffState);\n\t}\n\n\trevert(diff: LineRangeMapping): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tthis._editors.modified.executeEdits('diffEditor', [\n\t\t\t{\n\t\t\t\trange: diff.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(diff.original.toExclusiveRange())\n\t\t\t}\n\t\t]);\n\t}\n\n\trevertRangeMappings(diffs: RangeMapping[]): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst changes: IIdentifiedSingleEditOperation[] = diffs.map<IIdentifiedSingleEditOperation>(c => ({\n\t\t\trange: c.modifiedRange,\n\t\t\ttext: model.model.original.getValueInRange(c.originalRange)\n\t\t}));\n\n\t\tthis._editors.modified.executeEdits('diffEditor', changes);\n\t}\n\n\trevertFocusedRangeMappings() {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) { return; }\n\n\t\tconst modifiedEditor = this._editors.modified;\n\t\tif (!modifiedEditor.hasTextFocus()) { return; }\n\n\t\tconst curLineNumber = modifiedEditor.getPosition()!.lineNumber;\n\t\tconst selection = modifiedEditor.getSelection();\n\t\tconst selectedRange = LineRange.fromRange(selection || new Range(curLineNumber, 0, curLineNumber, 0));\n\t\tconst diffsToRevert = diffs.filter(d => {\n\t\t\treturn d.lineRangeMapping.modified.intersect(selectedRange);\n\t\t});\n\n\t\tmodifiedEditor.executeEdits('diffEditor', diffsToRevert.map(d => (\n\t\t\t{\n\t\t\t\trange: d.lineRangeMapping.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange())\n\t\t\t}\n\t\t)));\n\t}\n\n\n\tprivate _goTo(diff: DiffMapping): void {\n\t\tthis._editors.modified.setPosition(new Position(diff.lineRangeMapping.modified.startLineNumber, 1));\n\t\tthis._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modified.toExclusiveRange());\n\t}\n\n\tgoToDiff(target: 'previous' | 'next'): void {\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst curLineNumber = this._editors.modified.getPosition()!.lineNumber;\n\t\tlet diff: DiffMapping | undefined;\n\t\tif (target === 'next') {\n\t\t\tconst modifiedLineCount = this._editors.modified.getModel()!.getLineCount();\n\t\t\tif (modifiedLineCount === curLineNumber) {\n\t\t\t\tdiff = diffs[0];\n\t\t\t} else {\n\t\t\t\tdiff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];\n\t\t\t}\n\t\t} else {\n\t\t\tdiff = findLast(diffs, d => d.lineRangeMapping.modified.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1];\n\t\t}\n\t\tthis._goTo(diff);\n\n\t\tif (diff.lineRangeMapping.modified.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff.lineRangeMapping.original.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.goToDiff' });\n\t\t}\n\t}\n\n\trevealFirstDiff(): void {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) {\n\t\t\treturn;\n\t\t}\n\t\t// wait for the diff computation to finish\n\t\tthis.waitForDiff().then(() => {\n\t\t\tconst diffs = diffModel.diff.get()?.mappings;\n\t\t\tif (!diffs || diffs.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._goTo(diffs[0]);\n\t\t});\n\t}\n\n\taccessibleDiffViewerNext(): void { this._accessibleDiffViewer.get().next(); }\n\n\taccessibleDiffViewerPrev(): void { this._accessibleDiffViewer.get().prev(); }\n\n\tasync waitForDiff(): Promise<void> {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) { return; }\n\t\tawait diffModel.waitForDiff();\n\t}\n\n\tmapToOtherSide(): { destination: CodeEditorWidget; destinationSelection: Range | undefined } {\n\t\tconst isModifiedFocus = this._editors.modified.hasWidgetFocus();\n\t\tconst source = isModifiedFocus ? this._editors.modified : this._editors.original;\n\t\tconst destination = isModifiedFocus ? this._editors.original : this._editors.modified;\n\n\t\tlet destinationSelection: Range | undefined;\n\n\t\tconst sourceSelection = source.getSelection();\n\t\tif (sourceSelection) {\n\t\t\tconst mappings = this._diffModel.get()?.diff.get()?.mappings.map(m => isModifiedFocus ? m.lineRangeMapping.flip() : m.lineRangeMapping);\n\t\t\tif (mappings) {\n\t\t\t\tconst newRange1 = translatePosition(sourceSelection.getStartPosition(), mappings);\n\t\t\t\tconst newRange2 = translatePosition(sourceSelection.getEndPosition(), mappings);\n\t\t\t\tdestinationSelection = Range.plusRange(newRange1, newRange2);\n\t\t\t}\n\t\t}\n\t\treturn { destination, destinationSelection };\n\t}\n\n\tswitchSide(): void {\n\t\tconst { destination, destinationSelection } = this.mapToOtherSide();\n\t\tdestination.focus();\n\t\tif (destinationSelection) {\n\t\t\tdestination.setSelection(destinationSelection);\n\t\t}\n\t}\n\n\texitCompareMove(): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model) { return; }\n\t\tmodel.movedTextToCompare.set(undefined, undefined);\n\t}\n\n\tcollapseAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.collapseAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tshowAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.showAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _handleCursorPositionChange(e: ICursorPositionChangedEvent | undefined, isModifiedEditor: boolean): void {\n\t\tif (e?.reason === CursorChangeReason.Explicit) {\n\t\t\tconst diff = this._diffModel.get()?.diff.get()?.mappings.find(m => isModifiedEditor ? m.lineRangeMapping.modified.contains(e.position.lineNumber) : m.lineRangeMapping.original.contains(e.position.lineNumber));\n\t\t\tif (diff?.lineRangeMapping.modified.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff?.lineRangeMapping.original.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function toLineChanges(state: DiffState): ILineChange[] {\n\treturn state.mappings.map(x => {\n\t\tconst m = x.lineRangeMapping;\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet innerChanges = m.innerChanges;\n\n\t\tif (m.original.isEmpty) {\n\t\t\t// Insertion\n\t\t\toriginalStartLineNumber = m.original.startLineNumber - 1;\n\t\t\toriginalEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\toriginalStartLineNumber = m.original.startLineNumber;\n\t\t\toriginalEndLineNumber = m.original.endLineNumberExclusive - 1;\n\t\t}\n\n\t\tif (m.modified.isEmpty) {\n\t\t\t// Deletion\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber - 1;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber;\n\t\t\tmodifiedEndLineNumber = m.modified.endLineNumberExclusive - 1;\n\t\t}\n\n\t\treturn {\n\t\t\toriginalStartLineNumber,\n\t\t\toriginalEndLineNumber,\n\t\t\tmodifiedStartLineNumber,\n\t\t\tmodifiedEndLineNumber,\n\t\t\tcharChanges: innerChanges?.map(m => ({\n\t\t\t\toriginalStartLineNumber: m.originalRange.startLineNumber,\n\t\t\t\toriginalStartColumn: m.originalRange.startColumn,\n\t\t\t\toriginalEndLineNumber: m.originalRange.endLineNumber,\n\t\t\t\toriginalEndColumn: m.originalRange.endColumn,\n\t\t\t\tmodifiedStartLineNumber: m.modifiedRange.startLineNumber,\n\t\t\t\tmodifiedStartColumn: m.modifiedRange.startColumn,\n\t\t\t\tmodifiedEndLineNumber: m.modifiedRange.endLineNumber,\n\t\t\t\tmodifiedEndColumn: m.modifiedRange.endColumn,\n\t\t\t}))\n\t\t};\n\t});\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getWindow, h } from '../../../../base/browser/dom.js';\nimport { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js';\nimport { findLast } from '../../../../base/common/arraysFind.js';\nimport { BugIndicatingError, onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js';\nimport { toDisposable } from '../../../../base/common/lifecycle.js';\nimport { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedDisposable, disposableObservableValue, observableFromEvent, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../base/common/observable.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';\nimport { bindContextKey } from '../../../../platform/observable/common/platformObservableUtils.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { IDiffEditorOptions } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { ILineChange } from '../../../common/diff/legacyLinesDiffComputer.js';\nimport { LineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { IIdentifiedSingleEditOperation } from '../../../common/model.js';\nimport { IEditorConstructionOptions } from '../../config/editorConfiguration.js';\nimport { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from '../../editorBrowser.js';\nimport { EditorExtensionsRegistry, IDiffEditorContributionDescription } from '../../editorExtensions.js';\nimport { ICodeEditorService } from '../../services/codeEditorService.js';\nimport { StableEditorScrollState } from '../../stableEditorScroll.js';\nimport { CodeEditorWidget, ICodeEditorWidgetOptions } from '../codeEditor/codeEditorWidget.js';\nimport { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from './components/accessibleDiffViewer.js';\nimport { DiffEditorDecorations } from './components/diffEditorDecorations.js';\nimport { DiffEditorEditors } from './components/diffEditorEditors.js';\nimport { DiffEditorSash, SashLayout } from './components/diffEditorSash.js';\nimport { DiffEditorViewZones } from './components/diffEditorViewZones/diffEditorViewZones.js';\nimport { DelegatingEditor } from './delegatingEditorImpl.js';\nimport { DiffEditorOptions } from './diffEditorOptions.js';\nimport { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel.js';\nimport { DiffEditorGutter } from './features/gutterFeature.js';\nimport { HideUnchangedRegionsFeature } from './features/hideUnchangedRegionsFeature.js';\nimport { MovedBlocksLinesFeature } from './features/movedBlocksLinesFeature.js';\nimport { OverviewRulerFeature } from './features/overviewRulerFeature.js';\nimport { RevertButtonsFeature } from './features/revertButtonsFeature.js';\nimport './style.css';\nimport { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyViewZones, translatePosition } from './utils.js';\n\nexport interface IDiffCodeEditorWidgetOptions {\n\toriginalEditor?: ICodeEditorWidgetOptions;\n\tmodifiedEditor?: ICodeEditorWidgetOptions;\n}\n\nexport class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {\n\n\tprivate readonly elements;\n\tprivate readonly _diffModelSrc;\n\tprivate readonly _diffModel;\n\tpublic readonly onDidChangeModel;\n\n\tpublic get onDidContentSizeChange() { return this._editors.onDidContentSizeChange; }\n\n\tprivate readonly _contextKeyService;\n\tprivate readonly _instantiationService;\n\tprivate readonly _rootSizeObserver: ObservableElementSizeObserver;\n\n\n\tprivate readonly _sashLayout: SashLayout;\n\tprivate readonly _sash: IObservable<DiffEditorSash | undefined>;\n\tprivate readonly _boundarySashes;\n\n\tprivate _accessibleDiffViewerShouldBeVisible;\n\tprivate _accessibleDiffViewerVisible;\n\tprivate readonly _accessibleDiffViewer: IObservable<AccessibleDiffViewer>;\n\tprivate readonly _options: DiffEditorOptions;\n\tprivate readonly _editors: DiffEditorEditors;\n\n\tprivate readonly _overviewRulerPart: IObservable<OverviewRulerFeature | undefined>;\n\tprivate readonly _movedBlocksLinesPart;\n\n\tprivate readonly _gutter: IObservable<DiffEditorGutter | undefined>;\n\n\tconstructor(\n\t\tprivate readonly _domElement: HTMLElement,\n\t\toptions: Readonly<IDiffEditorConstructionOptions>,\n\t\tcodeEditorWidgetOptions: IDiffCodeEditorWidgetOptions,\n\t\t@IContextKeyService private readonly _parentContextKeyService: IContextKeyService,\n\t\t@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,\n\t\t@IEditorProgressService private readonly _editorProgressService: IEditorProgressService,\n\t) {\n\t\tsuper();\n\t\tthis.elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [\n\t\t\th('div.editor.original@original', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }),\n\t\t\th('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),\n\t\t]);\n\t\tthis._diffModelSrc = this._register(disposableObservableValue<RefCounted<DiffEditorViewModel> | undefined>(this, undefined));\n\t\tthis._diffModel = derived<DiffEditorViewModel | undefined>(this, reader => this._diffModelSrc.read(reader)?.object);\n\t\tthis.onDidChangeModel = Event.fromObservableLight(this._diffModel);\n\t\tthis._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement));\n\t\tthis._instantiationService = this._register(this._parentInstantiationService.createChild(\n\t\t\tnew ServiceCollection([IContextKeyService, this._contextKeyService])\n\t\t));\n\t\tthis._boundarySashes = observableValue<IBoundarySashes | undefined>(this, undefined);\n\t\tthis._accessibleDiffViewerShouldBeVisible = observableValue(this, false);\n\t\tthis._accessibleDiffViewerVisible = derived(this, reader =>\n\t\t\tthis._options.onlyShowAccessibleDiffViewer.read(reader)\n\t\t\t\t? true\n\t\t\t\t: this._accessibleDiffViewerShouldBeVisible.read(reader)\n\t\t);\n\t\tthis._movedBlocksLinesPart = observableValue<MovedBlocksLinesFeature | undefined>(this, undefined);\n\t\tthis._layoutInfo = derived(this, reader => {\n\t\t\tconst fullWidth = this._rootSizeObserver.width.read(reader);\n\t\t\tconst fullHeight = this._rootSizeObserver.height.read(reader);\n\n\t\t\tif (this._rootSizeObserver.automaticLayout) {\n\t\t\t\tthis.elements.root.style.height = '100%';\n\t\t\t} else {\n\t\t\t\tthis.elements.root.style.height = fullHeight + 'px';\n\t\t\t}\n\n\t\t\tconst sash = this._sash.read(reader);\n\n\t\t\tconst gutter = this._gutter.read(reader);\n\t\t\tconst gutterWidth = gutter?.width.read(reader) ?? 0;\n\n\t\t\tconst overviewRulerPartWidth = this._overviewRulerPart.read(reader)?.width ?? 0;\n\n\t\t\tlet originalLeft: number, originalWidth: number, modifiedLeft: number, modifiedWidth: number, gutterLeft: number;\n\n\t\t\tconst sideBySide = !!sash;\n\t\t\tif (sideBySide) {\n\t\t\t\tconst sashLeft = sash.sashLeft.read(reader);\n\t\t\t\tconst movedBlocksLinesWidth = this._movedBlocksLinesPart.read(reader)?.width.read(reader) ?? 0;\n\n\t\t\t\toriginalLeft = 0;\n\t\t\t\toriginalWidth = sashLeft - gutterWidth - movedBlocksLinesWidth;\n\n\t\t\t\tgutterLeft = sashLeft - gutterWidth;\n\n\t\t\t\tmodifiedLeft = sashLeft;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t} else {\n\t\t\t\tgutterLeft = 0;\n\n\t\t\t\tconst shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader);\n\t\t\t\toriginalLeft = gutterWidth;\n\t\t\t\tif (shouldHideOriginalLineNumbers) {\n\t\t\t\t\toriginalWidth = 0;\n\t\t\t\t} else {\n\t\t\t\t\toriginalWidth = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(reader));\n\t\t\t\t}\n\n\t\t\t\tmodifiedLeft = gutterWidth + originalWidth;\n\t\t\t\tmodifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;\n\t\t\t}\n\n\t\t\tthis.elements.original.style.left = originalLeft + 'px';\n\t\t\tthis.elements.original.style.width = originalWidth + 'px';\n\t\t\tthis._editors.original.layout({ width: originalWidth, height: fullHeight }, true);\n\n\t\t\tgutter?.layout(gutterLeft);\n\n\t\t\tthis.elements.modified.style.left = modifiedLeft + 'px';\n\t\t\tthis.elements.modified.style.width = modifiedWidth + 'px';\n\t\t\tthis._editors.modified.layout({ width: modifiedWidth, height: fullHeight }, true);\n\n\t\t\treturn {\n\t\t\t\tmodifiedEditor: this._editors.modified.getLayoutInfo(),\n\t\t\t\toriginalEditor: this._editors.original.getLayoutInfo(),\n\t\t\t};\n\t\t});\n\t\tthis._diffValue = this._diffModel.map((m, r) => m?.diff.read(r));\n\t\tthis.onDidUpdateDiff = Event.fromObservableLight(this._diffValue);\n\t\tthis._codeEditorService.willCreateDiffEditor();\n\n\t\tthis._contextKeyService.createKey('isInDiffEditor', true);\n\n\t\tthis._domElement.appendChild(this.elements.root);\n\t\tthis._register(toDisposable(() => this.elements.root.remove()));\n\n\t\tthis._rootSizeObserver = this._register(new ObservableElementSizeObserver(this.elements.root, options.dimension));\n\t\tthis._rootSizeObserver.setAutomaticLayout(options.automaticLayout ?? false);\n\n\t\tthis._options = this._instantiationService.createInstance(DiffEditorOptions, options);\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setWidth(this._rootSizeObserver.width.read(reader));\n\t\t}));\n\n\t\tthis._contextKeyService.createKey(EditorContextKeys.isEmbeddedDiffEditor.key, false);\n\t\tthis._register(bindContextKey(EditorContextKeys.isEmbeddedDiffEditor, this._contextKeyService,\n\t\t\treader => this._options.isInEmbeddedEditor.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.comparingMovedCode, this._contextKeyService,\n\t\t\treader => !!this._diffModel.read(reader)?.movedTextToCompare.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService,\n\t\t\treader => this._options.couldShowInlineViewBecauseOfSize.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorInlineMode, this._contextKeyService,\n\t\t\treader => !this._options.renderSideBySide.read(reader)\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.hasChanges, this._contextKeyService,\n\t\t\treader => (this._diffModel.read(reader)?.diff.read(reader)?.mappings.length ?? 0) > 0\n\t\t));\n\n\t\tthis._editors = this._register(this._instantiationService.createInstance(\n\t\t\tDiffEditorEditors,\n\t\t\tthis.elements.original,\n\t\t\tthis.elements.modified,\n\t\t\tthis._options,\n\t\t\tcodeEditorWidgetOptions,\n\t\t\t(i, c, o, o2) => this._createInnerEditor(i, c, o, o2),\n\t\t));\n\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalWritable, this._contextKeyService,\n\t\t\treader => this._options.originalEditable.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedWritable, this._contextKeyService,\n\t\t\treader => !this._options.readOnly.read(reader)\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorOriginalUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.original.uri.toString() ?? ''\n\t\t));\n\t\tthis._register(bindContextKey(EditorContextKeys.diffEditorModifiedUri, this._contextKeyService,\n\t\t\treader => this._diffModel.read(reader)?.model.modified.uri.toString() ?? ''\n\t\t));\n\n\t\tthis._overviewRulerPart = derivedDisposable(this, reader =>\n\t\t\t!this._options.renderOverviewRuler.read(reader)\n\t\t\t\t? undefined\n\t\t\t\t: this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(OverviewRulerFeature, reader),\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst dimensions = {\n\t\t\theight: this._rootSizeObserver.height,\n\t\t\twidth: this._rootSizeObserver.width.map((w, reader) => w - (this._overviewRulerPart.read(reader)?.width ?? 0)),\n\t\t};\n\n\t\tthis._sashLayout = new SashLayout(this._options, dimensions);\n\n\t\tthis._sash = derivedDisposable(this, reader => {\n\t\t\tconst showSash = this._options.renderSideBySide.read(reader);\n\t\t\tthis.elements.root.classList.toggle('side-by-side', showSash);\n\t\t\treturn !showSash ? undefined : new DiffEditorSash(\n\t\t\t\tthis.elements.root,\n\t\t\t\tdimensions,\n\t\t\t\tthis._options.enableSplitViewResizing,\n\t\t\t\tthis._boundarySashes,\n\t\t\t\tthis._sashLayout.sashLeft,\n\t\t\t\t() => this._sashLayout.resetSash(),\n\t\t\t);\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst unchangedRangesFeature = derivedDisposable(this, reader => /** @description UnchangedRangesFeature */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(HideUnchangedRegionsFeature, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tderivedDisposable(this, reader => /** @description DiffEditorDecorations */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorDecorations, reader),\n\t\t\t\tthis._editors, this._diffModel, this._options, this,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst origViewZoneIdsToIgnore = new Set<string>();\n\t\tconst modViewZoneIdsToIgnore = new Set<string>();\n\t\tlet isUpdatingViewZones = false;\n\t\tconst viewZoneManager = derivedDisposable(this, reader => /** @description ViewZoneManager */\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(DiffEditorViewZones, reader),\n\t\t\t\tgetWindow(this._domElement),\n\t\t\t\tthis._editors,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._options,\n\t\t\t\tthis,\n\t\t\t\t() => isUpdatingViewZones || unchangedRangesFeature.read(undefined).isUpdatingHiddenAreas,\n\t\t\t\torigViewZoneIdsToIgnore,\n\t\t\t\tmodViewZoneIdsToIgnore\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst originalViewZones = derived(this, (reader) => { /** @description originalViewZones */\n\t\t\tconst orig = viewZoneManager.read(reader).viewZones.read(reader).orig;\n\t\t\tconst orig2 = unchangedRangesFeature.read(reader).viewZones.read(reader).origViewZones;\n\t\t\treturn orig.concat(orig2);\n\t\t});\n\t\tconst modifiedViewZones = derived(this, (reader) => { /** @description modifiedViewZones */\n\t\t\tconst mod = viewZoneManager.read(reader).viewZones.read(reader).mod;\n\t\t\tconst mod2 = unchangedRangesFeature.read(reader).viewZones.read(reader).modViewZones;\n\t\t\treturn mod.concat(mod2);\n\t\t});\n\t\tthis._register(applyViewZones(this._editors.original, originalViewZones, isUpdatingOrigViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingOrigViewZones;\n\t\t}, origViewZoneIdsToIgnore));\n\t\tlet scrollState: StableEditorScrollState | undefined;\n\t\tthis._register(applyViewZones(this._editors.modified, modifiedViewZones, isUpdatingModViewZones => {\n\t\t\tisUpdatingViewZones = isUpdatingModViewZones;\n\t\t\tif (isUpdatingViewZones) {\n\t\t\t\tscrollState = StableEditorScrollState.capture(this._editors.modified);\n\t\t\t} else {\n\t\t\t\tscrollState?.restore(this._editors.modified);\n\t\t\t\tscrollState = undefined;\n\t\t\t}\n\t\t}, modViewZoneIdsToIgnore));\n\n\t\tthis._accessibleDiffViewer = derivedDisposable(this, reader =>\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\treadHotReloadableExport(AccessibleDiffViewer, reader),\n\t\t\t\tthis.elements.accessibleDiffViewer,\n\t\t\t\tthis._accessibleDiffViewerVisible,\n\t\t\t\t(visible, tx) => this._accessibleDiffViewerShouldBeVisible.set(visible, tx),\n\t\t\t\tthis._options.onlyShowAccessibleDiffViewer.map(v => !v),\n\t\t\t\tthis._rootSizeObserver.width,\n\t\t\t\tthis._rootSizeObserver.height,\n\t\t\t\tthis._diffModel.map((m, r) => m?.diff.read(r)?.mappings.map(m => m.lineRangeMapping)),\n\t\t\t\tnew AccessibleDiffViewerModelFromEditors(this._editors),\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst visibility = this._accessibleDiffViewerVisible.map<CSSStyle['visibility']>(v => v ? 'hidden' : 'visible');\n\t\tthis._register(applyStyle(this.elements.modified, { visibility }));\n\t\tthis._register(applyStyle(this.elements.original, { visibility }));\n\n\t\tthis._createDiffEditorContributions();\n\n\t\tthis._codeEditorService.addDiffEditor(this);\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis._codeEditorService.removeDiffEditor(this);\n\t\t}));\n\n\t\tthis._gutter = derivedDisposable(this, reader => {\n\t\t\treturn this._options.shouldRenderGutterMenu.read(reader)\n\t\t\t\t? this._instantiationService.createInstance(\n\t\t\t\t\treadHotReloadableExport(DiffEditorGutter, reader),\n\t\t\t\t\tthis.elements.root,\n\t\t\t\t\tthis._diffModel,\n\t\t\t\t\tthis._editors,\n\t\t\t\t\tthis._options,\n\t\t\t\t\tthis._sashLayout,\n\t\t\t\t\tthis._boundarySashes,\n\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t});\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._layoutInfo));\n\n\t\tderivedDisposable(this, reader => /** @description MovedBlocksLinesPart */\n\t\t\tnew (readHotReloadableExport(MovedBlocksLinesFeature, reader))(\n\t\t\t\tthis.elements.root,\n\t\t\t\tthis._diffModel,\n\t\t\t\tthis._layoutInfo.map(i => i.originalEditor),\n\t\t\t\tthis._layoutInfo.map(i => i.modifiedEditor),\n\t\t\t\tthis._editors,\n\t\t\t)\n\t\t).recomputeInitiallyAndOnChange(this._store, value => {\n\t\t\t// This is to break the layout info <-> moved blocks lines part dependency cycle.\n\t\t\tthis._movedBlocksLinesPart.set(value, undefined);\n\t\t});\n\n\t\tthis._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, true)));\n\t\tthis._register(Event.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, false)));\n\n\t\tconst isInitializingDiff = this._diffModel.map(this, (m, reader) => {\n\t\t\t/** @isInitializingDiff isDiffUpToDate */\n\t\t\tif (!m) { return undefined; }\n\t\t\treturn m.diff.read(reader) === undefined && !m.isDiffUpToDate.read(reader);\n\t\t});\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\t/** @description DiffEditorWidgetHelper.ShowProgress */\n\t\t\tif (isInitializingDiff.read(reader) === true) {\n\t\t\t\tconst r = this._editorProgressService.show(true, 1000);\n\t\t\t\tstore.add(toDisposable(() => r.done()));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tstore.add(new (readHotReloadableExport(RevertButtonsFeature, reader))(this._editors, this._diffModel, this._options, this));\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst model = this._diffModel.read(reader);\n\t\t\tif (!model) { return; }\n\t\t\tfor (const m of [model.model.original, model.model.modified]) {\n\t\t\t\tstore.add(m.onWillDispose(e => {\n\t\t\t\t\tonUnexpectedError(new BugIndicatingError('TextModel got disposed before DiffEditorWidget model got reset'));\n\t\t\t\t\tthis.setModel(null);\n\t\t\t\t}));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._options.setModel(this._diffModel.read(reader));\n\t\t}));\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: Readonly<IEditorConstructionOptions>, editorWidgetOptions: ICodeEditorWidgetOptions): CodeEditorWidget {\n\t\tconst editor = instantiationService.createInstance(CodeEditorWidget, container, options, editorWidgetOptions);\n\t\treturn editor;\n\t}\n\n\tprivate readonly _layoutInfo;\n\n\tprivate _createDiffEditorContributions() {\n\t\tconst contributions: IDiffEditorContributionDescription[] = EditorExtensionsRegistry.getDiffEditorContributions();\n\t\tfor (const desc of contributions) {\n\t\t\ttry {\n\t\t\t\tthis._register(this._instantiationService.createInstance(desc.ctor, this));\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override get _targetEditor(): CodeEditorWidget { return this._editors.modified; }\n\n\toverride getEditorType(): string { return EditorType.IDiffEditor; }\n\n\toverride layout(dimension?: IDimension | undefined): void {\n\t\tthis._rootSizeObserver.observe(dimension);\n\t}\n\n\toverride hasTextFocus(): boolean { return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus(); }\n\n\tpublic override saveViewState(): IDiffEditorViewState {\n\t\tconst originalViewState = this._editors.original.saveViewState();\n\t\tconst modifiedViewState = this._editors.modified.saveViewState();\n\t\treturn {\n\t\t\toriginal: originalViewState,\n\t\t\tmodified: modifiedViewState,\n\t\t\tmodelState: this._diffModel.get()?.serializeState(),\n\t\t};\n\t}\n\n\tpublic override restoreViewState(s: IDiffEditorViewState): void {\n\t\tif (s && s.original && s.modified) {\n\t\t\tconst diffEditorState = s as IDiffEditorViewState;\n\t\t\tthis._editors.original.restoreViewState(diffEditorState.original);\n\t\t\tthis._editors.modified.restoreViewState(diffEditorState.modified);\n\t\t\tif (diffEditorState.modelState) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\tthis._diffModel.get()?.restoreSerializedState(diffEditorState.modelState as any);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleInitialized(): void {\n\t\tthis._editors.original.handleInitialized();\n\t\tthis._editors.modified.handleInitialized();\n\t}\n\n\tpublic createViewModel(model: IDiffEditorModel): IDiffEditorViewModel {\n\t\treturn this._instantiationService.createInstance(DiffEditorViewModel, model, this._options);\n\t}\n\n\toverride getModel(): IDiffEditorModel | null { return this._diffModel.get()?.model ?? null; }\n\n\toverride setModel(model: IDiffEditorModel | null | IDiffEditorViewModel): void {\n\t\tconst vm = !model ? null\n\t\t\t: ('model' in model) ? RefCounted.create(model).createNewRef(this)\n\t\t\t\t: RefCounted.create(this.createViewModel(model), this);\n\t\tthis.setDiffModel(vm);\n\t}\n\n\tsetDiffModel(viewModel: RefCounted<IDiffEditorViewModel> | null, tx?: ITransaction): void {\n\t\tconst currentModel = this._diffModel.get();\n\n\t\tif (!viewModel && currentModel) {\n\t\t\t// Transitioning from a model to no-model\n\t\t\tthis._accessibleDiffViewer.get().close();\n\t\t}\n\n\t\tif (this._diffModel.get() !== viewModel?.object) {\n\t\t\tsubtransaction(tx, tx => {\n\t\t\t\tconst vm = viewModel?.object;\n\t\t\t\t/** @description DiffEditorWidget.setModel */\n\t\t\t\tobservableFromEvent.batchEventsGlobally(tx, () => {\n\t\t\t\t\tthis._editors.original.setModel(vm ? vm.model.original : null);\n\t\t\t\t\tthis._editors.modified.setModel(vm ? vm.model.modified : null);\n\t\t\t\t});\n\t\t\t\tconst prevValueRef = this._diffModelSrc.get()?.createNewRef(this);\n\t\t\t\tthis._diffModelSrc.set(viewModel?.createNewRef(this) as RefCounted<DiffEditorViewModel> | undefined, tx);\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// async, so that this runs after the transaction finished.\n\t\t\t\t\t// TODO: use the transaction to schedule disposal\n\t\t\t\t\tprevValueRef?.dispose();\n\t\t\t\t}, 0);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @param changedOptions Only has values for top-level options that have actually changed.\n\t */\n\toverride updateOptions(changedOptions: IDiffEditorOptions): void {\n\t\tthis._options.updateOptions(changedOptions);\n\t}\n\tgetContainerDomNode(): HTMLElement { return this._domElement; }\n\tgetOriginalEditor(): ICodeEditor { return this._editors.original; }\n\tgetModifiedEditor(): ICodeEditor { return this._editors.modified; }\n\n\tprivate readonly _diffValue;\n\treadonly onDidUpdateDiff: Event<void>;\n\n\t/**\n\t * @deprecated Use `this.getDiffComputationResult().changes2` instead.\n\t */\n\tgetLineChanges(): ILineChange[] | null {\n\t\tconst diffState = this._diffModel.get()?.diff.get();\n\t\tif (!diffState) { return null; }\n\t\treturn toLineChanges(diffState);\n\t}\n\n\trevert(diff: LineRangeMapping): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tthis._editors.modified.executeEdits('diffEditor', [\n\t\t\t{\n\t\t\t\trange: diff.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(diff.original.toExclusiveRange())\n\t\t\t}\n\t\t]);\n\t}\n\n\trevertRangeMappings(diffs: RangeMapping[]): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst changes: IIdentifiedSingleEditOperation[] = diffs.map<IIdentifiedSingleEditOperation>(c => ({\n\t\t\trange: c.modifiedRange,\n\t\t\ttext: model.model.original.getValueInRange(c.originalRange)\n\t\t}));\n\n\t\tthis._editors.modified.executeEdits('diffEditor', changes);\n\t}\n\n\trevertFocusedRangeMappings() {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model || !model.isDiffUpToDate.get()) { return; }\n\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) { return; }\n\n\t\tconst modifiedEditor = this._editors.modified;\n\t\tif (!modifiedEditor.hasTextFocus()) { return; }\n\n\t\tconst curLineNumber = modifiedEditor.getPosition()!.lineNumber;\n\t\tconst selection = modifiedEditor.getSelection();\n\t\tconst selectedRange = LineRange.fromRange(selection || new Range(curLineNumber, 0, curLineNumber, 0));\n\t\tconst diffsToRevert = diffs.filter(d => {\n\t\t\treturn d.lineRangeMapping.modified.intersect(selectedRange);\n\t\t});\n\n\t\tmodifiedEditor.executeEdits('diffEditor', diffsToRevert.map(d => (\n\t\t\t{\n\t\t\t\trange: d.lineRangeMapping.modified.toExclusiveRange(),\n\t\t\t\ttext: model.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange())\n\t\t\t}\n\t\t)));\n\t}\n\n\n\tprivate _goTo(diff: DiffMapping): void {\n\t\tthis._editors.modified.setPosition(new Position(diff.lineRangeMapping.modified.startLineNumber, 1));\n\t\tthis._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modified.toExclusiveRange());\n\t}\n\n\tgoToDiff(target: 'previous' | 'next'): void {\n\t\tconst diffs = this._diffModel.get()?.diff.get()?.mappings;\n\t\tif (!diffs || diffs.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst curLineNumber = this._editors.modified.getPosition()!.lineNumber;\n\t\tlet diff: DiffMapping | undefined;\n\t\tif (target === 'next') {\n\t\t\tconst modifiedLineCount = this._editors.modified.getModel()!.getLineCount();\n\t\t\tif (modifiedLineCount === curLineNumber) {\n\t\t\t\tdiff = diffs[0];\n\t\t\t} else {\n\t\t\t\tdiff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];\n\t\t\t}\n\t\t} else {\n\t\t\tdiff = findLast(diffs, d => d.lineRangeMapping.modified.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1];\n\t\t}\n\t\tthis._goTo(diff);\n\n\t\tif (diff.lineRangeMapping.modified.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff.lineRangeMapping.original.isEmpty) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.goToDiff' });\n\t\t} else if (diff) {\n\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.goToDiff' });\n\t\t}\n\t}\n\n\trevealFirstDiff(): void {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) {\n\t\t\treturn;\n\t\t}\n\t\t// wait for the diff computation to finish\n\t\tthis.waitForDiff().then(() => {\n\t\t\tconst diffs = diffModel.diff.get()?.mappings;\n\t\t\tif (!diffs || diffs.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._goTo(diffs[0]);\n\t\t});\n\t}\n\n\taccessibleDiffViewerNext(): void { this._accessibleDiffViewer.get().next(); }\n\n\taccessibleDiffViewerPrev(): void { this._accessibleDiffViewer.get().prev(); }\n\n\tasync waitForDiff(): Promise<void> {\n\t\tconst diffModel = this._diffModel.get();\n\t\tif (!diffModel) { return; }\n\t\tawait diffModel.waitForDiff();\n\t}\n\n\tmapToOtherSide(): { destination: CodeEditorWidget; destinationSelection: Range | undefined } {\n\t\tconst isModifiedFocus = this._editors.modified.hasWidgetFocus();\n\t\tconst source = isModifiedFocus ? this._editors.modified : this._editors.original;\n\t\tconst destination = isModifiedFocus ? this._editors.original : this._editors.modified;\n\n\t\tlet destinationSelection: Range | undefined;\n\n\t\tconst sourceSelection = source.getSelection();\n\t\tif (sourceSelection) {\n\t\t\tconst mappings = this._diffModel.get()?.diff.get()?.mappings.map(m => isModifiedFocus ? m.lineRangeMapping.flip() : m.lineRangeMapping);\n\t\t\tif (mappings) {\n\t\t\t\tconst newRange1 = translatePosition(sourceSelection.getStartPosition(), mappings);\n\t\t\t\tconst newRange2 = translatePosition(sourceSelection.getEndPosition(), mappings);\n\t\t\t\tdestinationSelection = Range.plusRange(newRange1, newRange2);\n\t\t\t}\n\t\t}\n\t\treturn { destination, destinationSelection };\n\t}\n\n\tswitchSide(): void {\n\t\tconst { destination, destinationSelection } = this.mapToOtherSide();\n\t\tdestination.focus();\n\t\tif (destinationSelection) {\n\t\t\tdestination.setSelection(destinationSelection);\n\t\t}\n\t}\n\n\texitCompareMove(): void {\n\t\tconst model = this._diffModel.get();\n\t\tif (!model) { return; }\n\t\tmodel.movedTextToCompare.set(undefined, undefined);\n\t}\n\n\tcollapseAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.collapseAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tshowAllUnchangedRegions(): void {\n\t\tconst unchangedRegions = this._diffModel.get()?.unchangedRegions.get();\n\t\tif (!unchangedRegions) { return; }\n\t\ttransaction(tx => {\n\t\t\tfor (const region of unchangedRegions) {\n\t\t\t\tregion.showAll(tx);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _handleCursorPositionChange(e: ICursorPositionChangedEvent | undefined, isModifiedEditor: boolean): void {\n\t\tif (e?.reason === CursorChangeReason.Explicit) {\n\t\t\tconst diff = this._diffModel.get()?.diff.get()?.mappings.find(m => isModifiedEditor ? m.lineRangeMapping.modified.contains(e.position.lineNumber) : m.lineRangeMapping.original.contains(e.position.lineNumber));\n\t\t\tif (diff?.lineRangeMapping.modified.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff?.lineRangeMapping.original.isEmpty) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t} else if (diff) {\n\t\t\t\tthis._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: 'diffEditor.cursorPositionChanged' });\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function toLineChanges(state: DiffState): ILineChange[] {\n\treturn state.mappings.map(x => {\n\t\tconst m = x.lineRangeMapping;\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet innerChanges = m.innerChanges;\n\n\t\tif (m.original.isEmpty) {\n\t\t\t// Insertion\n\t\t\toriginalStartLineNumber = m.original.startLineNumber - 1;\n\t\t\toriginalEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\toriginalStartLineNumber = m.original.startLineNumber;\n\t\t\toriginalEndLineNumber = m.original.endLineNumberExclusive - 1;\n\t\t}\n\n\t\tif (m.modified.isEmpty) {\n\t\t\t// Deletion\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber - 1;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t\tinnerChanges = undefined;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = m.modified.startLineNumber;\n\t\t\tmodifiedEndLineNumber = m.modified.endLineNumberExclusive - 1;\n\t\t}\n\n\t\treturn {\n\t\t\toriginalStartLineNumber,\n\t\t\toriginalEndLineNumber,\n\t\t\tmodifiedStartLineNumber,\n\t\t\tmodifiedEndLineNumber,\n\t\t\tcharChanges: innerChanges?.map(m => ({\n\t\t\t\toriginalStartLineNumber: m.originalRange.startLineNumber,\n\t\t\t\toriginalStartColumn: m.originalRange.startColumn,\n\t\t\t\toriginalEndLineNumber: m.originalRange.endLineNumber,\n\t\t\t\toriginalEndColumn: m.originalRange.endColumn,\n\t\t\t\tmodifiedStartLineNumber: m.modifiedRange.startLineNumber,\n\t\t\t\tmodifiedStartColumn: m.modifiedRange.startColumn,\n\t\t\t\tmodifiedEndLineNumber: m.modifiedRange.endLineNumber,\n\t\t\t\tmodifiedEndColumn: m.modifiedRange.endColumn,\n\t\t\t}))\n\t\t};\n\t});\n}\n"]}
|
|
@@ -145,7 +145,7 @@ let HideUnchangedRegionsFeature = class HideUnchangedRegionsFeature extends Disp
|
|
|
145
145
|
const unchangedLinesDecorationShow = {
|
|
146
146
|
description: 'Fold Unchanged',
|
|
147
147
|
glyphMarginHoverMessage: new MarkdownString(undefined, { isTrusted: true, supportThemeIcons: true })
|
|
148
|
-
.appendMarkdown(localize(
|
|
148
|
+
.appendMarkdown(localize(122, 'Fold Unchanged Region')),
|
|
149
149
|
glyphMarginClassName: 'fold-unchanged ' + ThemeIcon.asClassName(Codicon.fold),
|
|
150
150
|
zIndex: 10001,
|
|
151
151
|
};
|
|
@@ -252,7 +252,7 @@ class CompactCollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
252
252
|
/** @description update labels */
|
|
253
253
|
if (!this._hide) {
|
|
254
254
|
const lineCount = this._unchangedRegion.getHiddenModifiedRange(reader).length;
|
|
255
|
-
const linesHiddenText = localize(
|
|
255
|
+
const linesHiddenText = localize(123, '{0} hidden lines', lineCount);
|
|
256
256
|
this._nodes.text.innerText = linesHiddenText;
|
|
257
257
|
}
|
|
258
258
|
}));
|
|
@@ -270,12 +270,12 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
270
270
|
this._revealModifiedHiddenLine = _revealModifiedHiddenLine;
|
|
271
271
|
this._options = _options;
|
|
272
272
|
this._nodes = h('div.diff-hidden-lines', [
|
|
273
|
-
h('div.top@top', { title: localize(
|
|
273
|
+
h('div.top@top', { title: localize(124, 'Click or drag to show more above') }),
|
|
274
274
|
h('div.center@content', { style: { display: 'flex' } }, [
|
|
275
|
-
h('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: '0' } }, [$('a', { title: localize(
|
|
275
|
+
h('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: '0' } }, [$('a', { title: localize(125, 'Show Unchanged Region'), role: 'button', onclick: () => { this._unchangedRegion.showAll(undefined); } }, ...renderLabelWithIcons('$(unfold)'))]),
|
|
276
276
|
h('div@others', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } }),
|
|
277
277
|
]),
|
|
278
|
-
h('div.bottom@bottom', { title: localize(
|
|
278
|
+
h('div.bottom@bottom', { title: localize(126, 'Click or drag to show more below'), role: 'button' }),
|
|
279
279
|
]);
|
|
280
280
|
root.root.appendChild(this._nodes.root);
|
|
281
281
|
if (!this._hide) {
|
|
@@ -387,8 +387,8 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
387
387
|
const children = [];
|
|
388
388
|
if (!this._hide) {
|
|
389
389
|
const lineCount = _unchangedRegion.getHiddenModifiedRange(reader).length;
|
|
390
|
-
const linesHiddenText = localize(
|
|
391
|
-
const span = $('span', { title: localize(
|
|
390
|
+
const linesHiddenText = localize(127, '{0} hidden lines', lineCount);
|
|
391
|
+
const span = $('span', { title: localize(128, 'Double click to unfold') }, linesHiddenText);
|
|
392
392
|
span.addEventListener('dblclick', e => {
|
|
393
393
|
if (e.button !== 0) {
|
|
394
394
|
return;
|