monaco-editor-core 0.56.0-dev-20251218 → 0.56.0-dev-20251220

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.
Files changed (57) hide show
  1. package/esm/nls.messages.cs.js +1 -1
  2. package/esm/nls.messages.de.js +1 -1
  3. package/esm/nls.messages.es.js +1 -1
  4. package/esm/nls.messages.fr.js +1 -1
  5. package/esm/nls.messages.it.js +1 -1
  6. package/esm/nls.messages.ja.js +1 -1
  7. package/esm/nls.messages.ko.js +1 -1
  8. package/esm/nls.messages.pl.js +1 -1
  9. package/esm/nls.messages.pt-br.js +1 -1
  10. package/esm/nls.messages.ru.js +1 -1
  11. package/esm/nls.messages.tr.js +1 -1
  12. package/esm/nls.messages.zh-cn.js +1 -1
  13. package/esm/nls.messages.zh-tw.js +1 -1
  14. package/esm/vs/base/common/fuzzyScorer.js +3 -2
  15. package/esm/vs/base/common/fuzzyScorer.js.map +1 -1
  16. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +3 -3
  17. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
  18. package/esm/vs/editor/common/viewModel/viewModelImpl.js +4 -15
  19. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  20. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -1
  21. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  22. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +1 -1
  23. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  24. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  25. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
  26. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +6 -6
  27. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  28. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
  29. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  30. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +13 -11
  31. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  32. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +5 -7
  33. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  34. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +6 -5
  35. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
  36. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +6 -5
  37. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  38. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +9 -7
  39. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  40. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +14 -9
  41. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
  42. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +9 -7
  43. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
  44. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +5 -4
  45. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  46. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
  47. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  48. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -1
  49. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
  50. package/esm/vs/platform/quickinput/browser/quickInput.js +3 -37
  51. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  52. package/esm/vs/platform/quickinput/browser/quickInputController.js +1 -0
  53. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  54. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  55. package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
  56. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  57. package/package.json +2 -2
@@ -17,8 +17,7 @@ import { Emitter } from '../../../../../../../base/common/event.js';
17
17
  import { Disposable } from '../../../../../../../base/common/lifecycle.js';
18
18
  import { autorun, constObservable, derived, derivedObservableWithCache, observableFromEvent } from '../../../../../../../base/common/observable.js';
19
19
  import { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';
20
- import { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';
21
- import { asCssVariable, asCssVariableWithDefault } from '../../../../../../../platform/theme/common/colorUtils.js';
20
+ import { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';
22
21
  import { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';
23
22
  import { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';
24
23
  import { Rect } from '../../../../../../common/core/2d/rect.js';
@@ -29,8 +28,9 @@ import { Range } from '../../../../../../common/core/range.js';
29
28
  import { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';
30
29
  import { InlineCompletionContextKeys } from '../../../controller/inlineCompletionContextKeys.js';
31
30
  import { InlineEditClickEvent } from '../inlineEditsViewInterface.js';
32
- import { getEditorBlendedColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, modifiedBackgroundColor, originalBackgroundColor } from '../theme.js';
31
+ import { getEditorBackgroundColor, getEditorBlendedColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, modifiedBackgroundColor, originalBackgroundColor } from '../theme.js';
33
32
  import { PathBuilder, getContentRenderWidth, getOffsetForPos, mapOutFalsy, maxContentWidthInRange, observeEditorBoundingClientRect } from '../utils/utils.js';
33
+ import { InlineCompletionEditorType } from '../../../model/provideInlineCompletions.js';
34
34
  const HORIZONTAL_PADDING = 0;
35
35
  const VERTICAL_PADDING = 0;
36
36
  const ENABLE_OVERFLOW = false;
@@ -68,7 +68,7 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
68
68
  this._editorObs = observableCodeEditor(this._editor);
69
69
  this._display = derived(this, reader => !!this._uiState.read(reader) ? 'block' : 'none');
70
70
  this.previewRef = n.ref();
71
- const separatorWidthObs = this._uiState.map(s => s?.isInDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH);
71
+ const separatorWidthObs = this._uiState.map(s => s?.editorType === InlineCompletionEditorType.DiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH);
72
72
  this._editorContainer = n.div({
73
73
  class: ['editorContainer'],
74
74
  style: { position: 'absolute', overflow: 'hidden', cursor: 'pointer' },
@@ -307,6 +307,9 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
307
307
  this._originalBackgroundColor = observableFromEvent(this, this._themeService.onDidColorThemeChange, () => {
308
308
  return this._themeService.getColorTheme().getColor(originalBackgroundColor) ?? Color.transparent;
309
309
  });
310
+ this._editorBackgroundColor = this._uiState.map(s => {
311
+ return getEditorBackgroundColor(s?.editorType ?? InlineCompletionEditorType.TextEditor);
312
+ });
310
313
  this._backgroundSvg = n.svg({
311
314
  transform: 'translate(-0.5 -0.5)',
312
315
  style: { overflow: 'visible', pointerEvents: 'none', position: 'absolute' },
@@ -330,7 +333,7 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
330
333
  .build();
331
334
  }),
332
335
  style: {
333
- fill: asCssVariableWithDefault(editorBackground, 'transparent'),
336
+ fill: this._editorBackgroundColor,
334
337
  }
335
338
  }),
336
339
  ]).keepUpdated(this._store);
@@ -341,9 +344,10 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
341
344
  if (!layoutInfoObs) {
342
345
  return undefined;
343
346
  }
347
+ const editorBackground = this._editorBackgroundColor.read(reader);
344
348
  const separatorWidth = separatorWidthObs.read(reader);
345
349
  const borderStyling = getOriginalBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`);
346
- const borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`;
350
+ const borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${editorBackground}`;
347
351
  const hasBorderLeft = layoutInfoObs.read(reader).codeScrollLeft !== 0;
348
352
  const isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);
349
353
  const transitionRectSize = BORDER_RADIUS * 2 + BORDER_WIDTH * 2;
@@ -401,7 +405,7 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
401
405
  borderTop: borderStyling,
402
406
  borderRight: borderStyling,
403
407
  borderRadius: `0 100% 0 0`,
404
- backgroundColor: asCssVariable(editorBackground)
408
+ backgroundColor: editorBackground
405
409
  }
406
410
  })
407
411
  ]),
@@ -409,7 +413,7 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
409
413
  class: 'originalOverlaySideBySideHider',
410
414
  style: {
411
415
  ...overlayHider.toStyles(),
412
- backgroundColor: asCssVariable(editorBackground),
416
+ backgroundColor: editorBackground,
413
417
  }
414
418
  }),
415
419
  ];
@@ -422,10 +426,11 @@ let InlineEditsSideBySideView = class InlineEditsSideBySideView extends Disposab
422
426
  return undefined;
423
427
  }
424
428
  const isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);
429
+ const editorBackground = this._editorBackgroundColor.read(reader);
425
430
  const separatorWidth = separatorWidthObs.read(reader);
426
431
  const borderRadius = isModifiedLower.map(isLower => `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px ${isLower ? BORDER_RADIUS : 0}px`);
427
432
  const borderStyling = getEditorBlendedColor(getModifiedBorderColor(this._tabAction), this._themeService).map(c => `1px solid ${c.toString()}`);
428
- const borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`;
433
+ const borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${editorBackground}`;
429
434
  const overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.editRect.withMargin(0, BORDER_WIDTH));
430
435
  const separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, separatorWidth, separatorWidth, 0));
431
436
  const insertionRect = derived(this, reader => {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.ts"],"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SideBySideView.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, n } from '../../../../../../../base/browser/dom.js';\nimport { Color } from '../../../../../../../base/common/color.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, IReader, autorun, constObservable, derived, derivedObservableWithCache, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable, asCssVariableWithDefault } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EmbeddedCodeEditorWidget } from '../../../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { InlineCompletionContextKeys } from '../../../controller/inlineCompletionContextKeys.js';\nimport { IInlineEditsView, InlineEditClickEvent, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../inlineEditWithChanges.js';\nimport { getEditorBlendedColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, modifiedBackgroundColor, originalBackgroundColor } from '../theme.js';\nimport { PathBuilder, getContentRenderWidth, getOffsetForPos, mapOutFalsy, maxContentWidthInRange, observeEditorBoundingClientRect } from '../utils/utils.js';\n\nconst HORIZONTAL_PADDING = 0;\nconst VERTICAL_PADDING = 0;\nconst ENABLE_OVERFLOW = false;\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = INLINE_EDITS_BORDER_RADIUS;\nconst ORIGINAL_END_PADDING = 20;\nconst MODIFIED_END_PADDING = 12;\n\nexport class InlineEditsSideBySideView extends Disposable implements IInlineEditsView {\n\n\t// This is an approximation and should be improved by using the real parameters used bellow\n\tstatic fitsInsideViewport(editor: ICodeEditor, textModel: ITextModel, edit: InlineEditWithChanges, reader: IReader): boolean {\n\t\tconst editorObs = observableCodeEditor(editor);\n\t\tconst editorWidth = editorObs.layoutInfoWidth.read(reader);\n\t\tconst editorContentLeft = editorObs.layoutInfoContentLeft.read(reader);\n\t\tconst editorVerticalScrollbar = editor.getLayoutInfo().verticalScrollbarWidth;\n\t\tconst minimapWidth = editorObs.layoutInfoMinimap.read(reader).minimapLeft !== 0 ? editorObs.layoutInfoMinimap.read(reader).minimapWidth : 0;\n\n\t\tconst maxOriginalContent = maxContentWidthInRange(editorObs, edit.displayRange, undefined/* do not reconsider on each layout info change */);\n\t\tconst maxModifiedContent = edit.lineEdit.newLines.reduce((max, line) => Math.max(max, getContentRenderWidth(line, editor, textModel)), 0);\n\t\tconst originalPadding = ORIGINAL_END_PADDING; // padding after last line of original editor\n\t\tconst modifiedPadding = MODIFIED_END_PADDING + 2 * BORDER_WIDTH; // padding after last line of modified editor\n\n\t\treturn maxOriginalContent + maxModifiedContent + originalPadding + modifiedPadding < editorWidth - editorContentLeft - editorVerticalScrollbar - minimapWidth;\n\t}\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEditWithChanges | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\n\t\tprivate readonly _uiState: IObservable<{\n\t\t\tnewTextLineCount: number;\n\t\t\tisInDiffEditor: boolean;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._display = derived(this, reader => !!this._uiState.read(reader) ? 'block' : 'none');\n\t\tthis.previewRef = n.ref<HTMLDivElement>();\n\t\tconst separatorWidthObs = this._uiState.map(s => s?.isInDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH);\n\t\tthis._editorContainer = n.div({\n\t\t\tclass: ['editorContainer'],\n\t\t\tstyle: { position: 'absolute', overflow: 'hidden', cursor: 'pointer' },\n\t\t\tonmousedown: e => {\n\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t},\n\t\t\tonclick: (e) => {\n\t\t\t\tthis._onDidClick.fire(InlineEditClickEvent.create(e));\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({ class: 'preview', style: { pointerEvents: 'none' }, ref: this.previewRef }),\n\t\t]).keepUpdated(this._store);\n\t\tthis.isHovered = this._editorContainer.didMouseMoveDuringHover;\n\t\tthis.previewEditor = this._register(this._instantiationService.createInstance(\n\t\t\tEmbeddedCodeEditorWidget,\n\t\t\tthis.previewRef.element,\n\t\t\t{\n\t\t\t\tglyphMargin: false,\n\t\t\t\tlineNumbers: 'off',\n\t\t\t\tminimap: { enabled: false },\n\t\t\t\tguides: {\n\t\t\t\t\tindentation: false,\n\t\t\t\t\tbracketPairs: false,\n\t\t\t\t\tbracketPairsHorizontal: false,\n\t\t\t\t\thighlightActiveIndentation: false,\n\t\t\t\t},\n\t\t\t\teditContext: false, // is a bit faster\n\t\t\t\trulers: [],\n\t\t\t\tpadding: { top: 0, bottom: 0 },\n\t\t\t\tfolding: false,\n\t\t\t\tselectOnLineNumbers: false,\n\t\t\t\tselectionHighlight: false,\n\t\t\t\tcolumnSelection: false,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t\toverviewRulerLanes: 0,\n\t\t\t\tlineDecorationsWidth: 0,\n\t\t\t\tlineNumbersMinChars: 0,\n\t\t\t\trevealHorizontalRightPadding: 0,\n\t\t\t\tbracketPairColorization: { enabled: true, independentColorPoolPerBracketType: false },\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t},\n\t\t\t\treadOnly: true,\n\t\t\t\twordWrap: 'off',\n\t\t\t\twordWrapOverride1: 'off',\n\t\t\t\twordWrapOverride2: 'off',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcontextKeyValues: {\n\t\t\t\t\t[InlineCompletionContextKeys.inInlineEditsPreviewEditor.key]: true,\n\t\t\t\t},\n\t\t\t\tcontributions: [],\n\t\t\t},\n\t\t\tthis._editor\n\t\t));\n\t\tthis._previewEditorObs = observableCodeEditor(this.previewEditor);\n\t\tthis._activeViewZones = [];\n\t\tthis._updatePreviewEditor = derived(this, reader => {\n\t\t\tthis._editorContainer.readEffect(reader);\n\t\t\tthis._previewEditorObs.model.read(reader); // update when the model is set\n\n\t\t\t// Setting this here explicitly to make sure that the preview editor is\n\t\t\t// visible when needed, we're also checking that these fields are defined\n\t\t\t// because of the auto run initial\n\t\t\t// Before removing these, verify with a non-monospace font family\n\t\t\tthis._display.read(reader);\n\t\t\tif (this._nonOverflowView) {\n\t\t\t\tthis._nonOverflowView.element.style.display = this._display.read(reader);\n\t\t\t}\n\n\t\t\tconst uiState = this._uiState.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!uiState || !edit) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst range = edit.originalLineRange;\n\n\t\t\tconst hiddenAreas: Range[] = [];\n\t\t\tif (range.startLineNumber > 1) {\n\t\t\t\thiddenAreas.push(new Range(1, 1, range.startLineNumber - 1, 1));\n\t\t\t}\n\t\t\tif (range.startLineNumber + uiState.newTextLineCount < this._previewTextModel.getLineCount() + 1) {\n\t\t\t\thiddenAreas.push(new Range(range.startLineNumber + uiState.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1));\n\t\t\t}\n\n\t\t\tthis.previewEditor.setHiddenAreas(hiddenAreas, undefined, true);\n\n\t\t\t// TODO: is this the proper way to handle viewzones?\n\t\t\tconst previousViewZones = [...this._activeViewZones];\n\t\t\tthis._activeViewZones = [];\n\n\t\t\tconst reducedLinesCount = (range.endLineNumberExclusive - range.startLineNumber) - uiState.newTextLineCount;\n\t\t\tthis.previewEditor.changeViewZones((changeAccessor) => {\n\t\t\t\tpreviousViewZones.forEach(id => changeAccessor.removeZone(id));\n\n\t\t\t\tif (reducedLinesCount > 0) {\n\t\t\t\t\tthis._activeViewZones.push(changeAccessor.addZone({\n\t\t\t\t\t\tafterLineNumber: range.startLineNumber + uiState.newTextLineCount - 1,\n\t\t\t\t\t\theightInLines: reducedLinesCount,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tdomNode: $('div.diagonal-fill.inline-edits-view-zone'),\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis._previewEditorWidth = derived(this, reader => {\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit) { return 0; }\n\t\t\tthis._updatePreviewEditor.read(reader);\n\n\t\t\treturn maxContentWidthInRange(this._previewEditorObs, edit.modifiedLineRange, reader);\n\t\t});\n\t\tthis._cursorPosIfTouchesEdit = derived(this, reader => {\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit || !cursorPos) { return undefined; }\n\t\t\treturn edit.modifiedLineRange.contains(cursorPos.lineNumber) ? cursorPos : undefined;\n\t\t});\n\t\tthis._originalStartPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.startLineNumber, 1) : null;\n\t\t});\n\t\tthis._originalEndPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.endLineNumberExclusive, 1) : null;\n\t\t});\n\t\tthis._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map(p => p?.y);\n\t\tthis._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map(p => p?.y);\n\t\tthis._originalDisplayRange = this._edit.map(e => e?.displayRange);\n\t\tthis._editorMaxContentWidthInRange = derived(this, reader => {\n\t\t\tconst originalDisplayRange = this._originalDisplayRange.read(reader);\n\t\t\tif (!originalDisplayRange) {\n\t\t\t\treturn constObservable(0);\n\t\t\t}\n\t\t\tthis._editorObs.versionId.read(reader);\n\n\t\t\t// Take the max value that we observed.\n\t\t\t// Reset when either the edit changes or the editor text version.\n\t\t\treturn derivedObservableWithCache<number>(this, (reader, lastValue) => {\n\t\t\t\tconst maxWidth = maxContentWidthInRange(this._editorObs, originalDisplayRange, reader);\n\t\t\t\treturn Math.max(maxWidth, lastValue ?? 0);\n\t\t\t});\n\t\t}).map((v, r) => v.read(r));\n\n\t\tconst editorDomContentRect = observeEditorBoundingClientRect(this._editor, this._store);\n\n\t\tthis._previewEditorLayoutInfo = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\tif (!inlineEdit) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst state = this._uiState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst range = inlineEdit.originalLineRange;\n\n\t\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\n\t\t\tconst editorContentMaxWidthInRange = this._editorMaxContentWidthInRange.read(reader);\n\t\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst previewContentWidth = this._previewEditorWidth.read(reader);\n\t\t\tconst editorContentAreaWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\t\tconst editorBoundingClientRect = editorDomContentRect.read(reader);\n\t\t\tconst clientContentAreaRight = editorLayout.contentLeft + editorLayout.contentWidth + editorBoundingClientRect.left;\n\t\t\tconst remainingWidthRightOfContent = getWindow(this._editor.getContainerDomNode()).innerWidth - clientContentAreaRight;\n\t\t\tconst remainingWidthRightOfEditor = getWindow(this._editor.getContainerDomNode()).innerWidth - editorBoundingClientRect.right;\n\t\t\tconst desiredMinimumWidth = Math.min(editorLayout.contentWidth * 0.3, previewContentWidth, 100);\n\t\t\tconst IN_EDITOR_DISPLACEMENT = 0;\n\t\t\tconst maximumAvailableWidth = IN_EDITOR_DISPLACEMENT + remainingWidthRightOfContent;\n\n\t\t\tconst cursorPos = this._cursorPosIfTouchesEdit.read(reader);\n\n\t\t\tconst maxPreviewEditorLeft = Math.max(\n\t\t\t\t// We're starting from the content area right and moving it left by IN_EDITOR_DISPLACEMENT and also by an amount to ensure some minimum desired width\n\t\t\t\teditorContentAreaWidth + horizontalScrollOffset - IN_EDITOR_DISPLACEMENT - Math.max(0, desiredMinimumWidth - maximumAvailableWidth),\n\t\t\t\t// But we don't want that the moving left ends up covering the cursor, so this will push it to the right again\n\t\t\t\tMath.min(\n\t\t\t\t\tcursorPos ? getOffsetForPos(this._editorObs, cursorPos, reader) + 50 : 0,\n\t\t\t\t\teditorContentAreaWidth + horizontalScrollOffset\n\t\t\t\t)\n\t\t\t);\n\t\t\tconst previewEditorLeftInTextArea = Math.min(editorContentMaxWidthInRange + ORIGINAL_END_PADDING, maxPreviewEditorLeft);\n\n\t\t\tconst maxContentWidth = editorContentMaxWidthInRange + ORIGINAL_END_PADDING + previewContentWidth + 70;\n\n\t\t\tconst dist = maxPreviewEditorLeft - previewEditorLeftInTextArea;\n\n\t\t\tlet desiredPreviewEditorScrollLeft;\n\t\t\tlet codeRight;\n\t\t\tif (previewEditorLeftInTextArea > horizontalScrollOffset) {\n\t\t\t\tdesiredPreviewEditorScrollLeft = 0;\n\t\t\t\tcodeRight = editorLayout.contentLeft + previewEditorLeftInTextArea - horizontalScrollOffset;\n\t\t\t} else {\n\t\t\t\tdesiredPreviewEditorScrollLeft = horizontalScrollOffset - previewEditorLeftInTextArea;\n\t\t\t\tcodeRight = editorLayout.contentLeft;\n\t\t\t}\n\n\t\t\tconst selectionTop = this._originalVerticalStartPosition.read(reader) ?? this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tconst selectionBottom = this._originalVerticalEndPosition.read(reader) ?? this._editor.getBottomForLineNumber(range.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(reader);\n\n\t\t\t// TODO: const { prefixLeftOffset } = getPrefixTrim(inlineEdit.edit.edits.map(e => e.range), inlineEdit.originalLineRange, [], this._editor);\n\t\t\tconst codeLeft = editorLayout.contentLeft - horizontalScrollOffset;\n\n\t\t\tlet codeRect = Rect.fromLeftTopRightBottom(codeLeft, selectionTop, codeRight, selectionBottom);\n\t\t\tconst isInsertion = codeRect.height === 0;\n\t\t\tif (!isInsertion) {\n\t\t\t\tcodeRect = codeRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING);\n\t\t\t}\n\n\t\t\tconst previewLineHeights = this._previewEditorObs.observeLineHeightsForLineRange(inlineEdit.modifiedLineRange).read(reader);\n\t\t\tconst editHeight = previewLineHeights.reduce((acc, h) => acc + h, 0);\n\t\t\tconst codeHeight = selectionBottom - selectionTop;\n\t\t\tconst previewEditorHeight = Math.max(codeHeight, editHeight);\n\n\t\t\tconst clipped = dist === 0;\n\t\t\tconst codeEditDist = 0;\n\t\t\tconst previewEditorWidth = Math.min(previewContentWidth + MODIFIED_END_PADDING, remainingWidthRightOfEditor + editorLayout.width - editorLayout.contentLeft - codeEditDist);\n\n\t\t\tlet editRect = Rect.fromLeftTopWidthHeight(codeRect.right + codeEditDist, selectionTop, previewEditorWidth, previewEditorHeight);\n\t\t\tif (!isInsertion) {\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateX(HORIZONTAL_PADDING + BORDER_WIDTH);\n\t\t\t} else {\n\t\t\t\t// Align top of edit with insertion line\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateY(VERTICAL_PADDING);\n\t\t\t}\n\n\t\t\t// debugView(debugLogRects({ codeRect, editRect }, this._editor.getDomNode()!), reader);\n\n\t\t\treturn {\n\t\t\t\tcodeRect,\n\t\t\t\teditRect,\n\t\t\t\tcodeScrollLeft: horizontalScrollOffset,\n\t\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\t\tisInsertion,\n\t\t\t\tmaxContentWidth,\n\t\t\t\tshouldShowShadow: clipped,\n\t\t\t\tdesiredPreviewEditorScrollLeft,\n\t\t\t\tpreviewEditorWidth,\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController ? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight) : constObservable(0);\n\t\tthis._shouldOverflow = derived(this, reader => {\n\t\t\tif (!ENABLE_OVERFLOW) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst range = this._edit.read(reader)?.originalLineRange;\n\t\t\tif (!range) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst stickyScrollHeight = this._stickyScrollHeight.read(reader);\n\t\t\tconst top = this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (top <= stickyScrollHeight) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst bottom = this._editor.getTopForLineNumber(range.endLineNumberExclusive) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (bottom >= this._editorObs.layoutInfo.read(reader).height) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tthis._originalBackgroundColor = observableFromEvent(this, this._themeService.onDidColorThemeChange, () => {\n\t\t\treturn this._themeService.getColorTheme().getColor(originalBackgroundColor) ?? Color.transparent;\n\t\t});\n\t\tthis._backgroundSvg = n.svg({\n\t\t\ttransform: 'translate(-0.5 -0.5)',\n\t\t\tstyle: { overflow: 'visible', pointerEvents: 'none', position: 'absolute' },\n\t\t}, [\n\t\t\tn.svgElem('path', {\n\t\t\t\tclass: 'rightOfModifiedBackgroundCoverUp',\n\t\t\t\td: derived(this, reader => {\n\t\t\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\t\t\tif (!layoutInfo) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tconst originalBackgroundColor = this._originalBackgroundColor.read(reader);\n\t\t\t\t\tif (originalBackgroundColor.isTransparent()) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new PathBuilder()\n\t\t\t\t\t\t.moveTo(layoutInfo.codeRect.getRightTop())\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightTop().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom())\n\t\t\t\t\t\t.build();\n\t\t\t\t}),\n\t\t\t\tstyle: {\n\t\t\t\t\tfill: asCssVariableWithDefault(editorBackground, 'transparent'),\n\t\t\t\t}\n\t\t\t}),\n\t\t]).keepUpdated(this._store);\n\t\tthis._originalOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', display: this._previewEditorLayoutInfo.map(layoutInfo => layoutInfo?.isInsertion ? 'none' : 'block') },\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderStyling = getOriginalBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`;\n\n\t\t\tconst hasBorderLeft = layoutInfoObs.read(reader).codeScrollLeft !== 0;\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\t\t\tconst transitionRectSize = BORDER_RADIUS * 2 + BORDER_WIDTH * 2;\n\n\t\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t\t// such that there is a smooth transition at the edge of content left\n\t\t\tconst overlayHider = layoutInfoObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\t\tlayoutInfo.codeRect.top,\n\t\t\t\tlayoutInfo.contentLeft,\n\t\t\t\tlayoutInfo.codeRect.bottom + transitionRectSize\n\t\t\t)).read(reader);\n\n\t\t\tconst intersectionLine = new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER);\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.intersectHorizontal(intersectionLine));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, 0, separatorWidth, separatorWidth).intersectHorizontal(intersectionLine));\n\n\t\t\tconst transitionRect = overlayRect.map(overlayRect => Rect.fromLeftTopWidthHeight(overlayRect.right - transitionRectSize + BORDER_WIDTH, overlayRect.bottom - BORDER_WIDTH, transitionRectSize, transitionRectSize).intersectHorizontal(intersectionLine));\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStylingSeparator,\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\tborderBottom: borderStyling,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStyling,\n\t\t\t\t\t\tbackgroundColor: asCssVariable(originalBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalCornerCutoutSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\tdisplay: isModifiedLower.map(isLower => isLower ? 'block' : 'none'),\n\t\t\t\t\t\t...transitionRect.read(reader).toStyles(),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBackground',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tbackgroundColor: getEditorBlendedColor(originalBackgroundColor, this._themeService).map(c => c.toString()),\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBorder',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\t\tborderRight: borderStyling,\n\t\t\t\t\t\t\tborderRadius: `0 100% 0 0`,\n\t\t\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySideHider',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground),\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._modifiedOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', }\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderRadius = isModifiedLower.map(isLower => `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px ${isLower ? BORDER_RADIUS : 0}px`);\n\t\t\tconst borderStyling = getEditorBlendedColor(getModifiedBorderColor(this._tabAction), this._themeService).map(c => `1px solid ${c.toString()}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`;\n\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.editRect.withMargin(0, BORDER_WIDTH));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, separatorWidth, separatorWidth, 0));\n\n\t\t\tconst insertionRect = derived(this, reader => {\n\t\t\t\tconst overlay = overlayRect.read(reader);\n\t\t\t\tconst layoutinfo = layoutInfoObs.read(reader);\n\t\t\t\tif (!layoutinfo.isInsertion || layoutinfo.contentLeft >= overlay.left) {\n\t\t\t\t\treturn Rect.fromLeftTopWidthHeight(overlay.left, overlay.top, 0, 0);\n\t\t\t\t}\n\t\t\t\treturn new Rect(layoutinfo.contentLeft, overlay.top, overlay.left, overlay.top + BORDER_WIDTH * 2);\n\t\t\t});\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedInsertionSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...insertionRect.read(reader).toStyles(),\n\t\t\t\t\t\tbackgroundColor: getModifiedBorderColor(this._tabAction).map(c => asCssVariable(c)),\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderRight: borderStylingSeparator,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborder: borderStyling,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._nonOverflowView = n.div({\n\t\t\tclass: 'inline-edits-view',\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t\ttop: '0px',\n\t\t\t\tleft: '0px',\n\t\t\t\tdisplay: this._display,\n\t\t\t},\n\t\t}, [\n\t\t\tthis._backgroundSvg,\n\t\t\tderived(this, reader => this._shouldOverflow.read(reader) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay]),\n\t\t]).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._nonOverflowView.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst x = this._previewEditorLayoutInfo.read(reader)?.maxContentWidth;\n\t\t\t\tif (x === undefined) { return 0; }\n\t\t\t\treturn x;\n\t\t\t}),\n\t\t}));\n\n\t\tthis.previewEditor.setModel(this._previewTextModel);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst editorRect = layoutInfo.editRect.withMargin(-VERTICAL_PADDING, -HORIZONTAL_PADDING);\n\n\t\t\tthis.previewEditor.layout({ height: editorRect.height, width: layoutInfo.previewEditorWidth + 15 /* Make sure editor does not scroll horizontally */ });\n\t\t\tthis._editorContainer.element.style.top = `${editorRect.top}px`;\n\t\t\tthis._editorContainer.element.style.left = `${editorRect.left}px`;\n\t\t\tthis._editorContainer.element.style.width = `${layoutInfo.previewEditorWidth + HORIZONTAL_PADDING}px`; // Set width to clip view zone\n\t\t\t//this._editorContainer.element.style.borderRadius = `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px 0`;\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._previewEditorObs.editor.setScrollLeft(layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _display;\n\n\tprivate readonly previewRef;\n\n\tprivate readonly _editorContainer;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly previewEditor;\n\n\tprivate readonly _previewEditorObs;\n\n\tprivate _activeViewZones: string[];\n\tprivate readonly _updatePreviewEditor;\n\n\tprivate readonly _previewEditorWidth;\n\n\tprivate readonly _cursorPosIfTouchesEdit;\n\n\tprivate readonly _originalStartPosition;\n\n\tprivate readonly _originalEndPosition;\n\n\tprivate readonly _originalVerticalStartPosition;\n\tprivate readonly _originalVerticalEndPosition;\n\n\tprivate readonly _originalDisplayRange;\n\tprivate readonly _editorMaxContentWidthInRange;\n\n\tprivate readonly _previewEditorLayoutInfo;\n\n\tprivate _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _shouldOverflow;\n\n\tprivate readonly _originalBackgroundColor;\n\n\tprivate readonly _backgroundSvg;\n\n\tprivate readonly _originalOverlay;\n\n\tprivate readonly _modifiedOverlay;\n\n\tprivate readonly _nonOverflowView;\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, n } from '../../../../../../../base/browser/dom.js';\nimport { Color } from '../../../../../../../base/common/color.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, IReader, autorun, constObservable, derived, derivedObservableWithCache, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable, asCssVariableWithDefault } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EmbeddedCodeEditorWidget } from '../../../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { InlineCompletionContextKeys } from '../../../controller/inlineCompletionContextKeys.js';\nimport { IInlineEditsView, InlineEditClickEvent, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../inlineEditWithChanges.js';\nimport { getEditorBlendedColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, modifiedBackgroundColor, originalBackgroundColor } from '../theme.js';\nimport { PathBuilder, getContentRenderWidth, getOffsetForPos, mapOutFalsy, maxContentWidthInRange, observeEditorBoundingClientRect } from '../utils/utils.js';\n\nconst HORIZONTAL_PADDING = 0;\nconst VERTICAL_PADDING = 0;\nconst ENABLE_OVERFLOW = false;\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = INLINE_EDITS_BORDER_RADIUS;\nconst ORIGINAL_END_PADDING = 20;\nconst MODIFIED_END_PADDING = 12;\n\nexport class InlineEditsSideBySideView extends Disposable implements IInlineEditsView {\n\n\t// This is an approximation and should be improved by using the real parameters used bellow\n\tstatic fitsInsideViewport(editor: ICodeEditor, textModel: ITextModel, edit: InlineEditWithChanges, reader: IReader): boolean {\n\t\tconst editorObs = observableCodeEditor(editor);\n\t\tconst editorWidth = editorObs.layoutInfoWidth.read(reader);\n\t\tconst editorContentLeft = editorObs.layoutInfoContentLeft.read(reader);\n\t\tconst editorVerticalScrollbar = editor.getLayoutInfo().verticalScrollbarWidth;\n\t\tconst minimapWidth = editorObs.layoutInfoMinimap.read(reader).minimapLeft !== 0 ? editorObs.layoutInfoMinimap.read(reader).minimapWidth : 0;\n\n\t\tconst maxOriginalContent = maxContentWidthInRange(editorObs, edit.displayRange, undefined/* do not reconsider on each layout info change */);\n\t\tconst maxModifiedContent = edit.lineEdit.newLines.reduce((max, line) => Math.max(max, getContentRenderWidth(line, editor, textModel)), 0);\n\t\tconst originalPadding = ORIGINAL_END_PADDING; // padding after last line of original editor\n\t\tconst modifiedPadding = MODIFIED_END_PADDING + 2 * BORDER_WIDTH; // padding after last line of modified editor\n\n\t\treturn maxOriginalContent + maxModifiedContent + originalPadding + modifiedPadding < editorWidth - editorContentLeft - editorVerticalScrollbar - minimapWidth;\n\t}\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEditWithChanges | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\n\t\tprivate readonly _uiState: IObservable<{\n\t\t\tnewTextLineCount: number;\n\t\t\tisInDiffEditor: boolean;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._display = derived(this, reader => !!this._uiState.read(reader) ? 'block' : 'none');\n\t\tthis.previewRef = n.ref<HTMLDivElement>();\n\t\tconst separatorWidthObs = this._uiState.map(s => s?.isInDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH);\n\t\tthis._editorContainer = n.div({\n\t\t\tclass: ['editorContainer'],\n\t\t\tstyle: { position: 'absolute', overflow: 'hidden', cursor: 'pointer' },\n\t\t\tonmousedown: e => {\n\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t},\n\t\t\tonclick: (e) => {\n\t\t\t\tthis._onDidClick.fire(InlineEditClickEvent.create(e));\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({ class: 'preview', style: { pointerEvents: 'none' }, ref: this.previewRef }),\n\t\t]).keepUpdated(this._store);\n\t\tthis.isHovered = this._editorContainer.didMouseMoveDuringHover;\n\t\tthis.previewEditor = this._register(this._instantiationService.createInstance(\n\t\t\tEmbeddedCodeEditorWidget,\n\t\t\tthis.previewRef.element,\n\t\t\t{\n\t\t\t\tglyphMargin: false,\n\t\t\t\tlineNumbers: 'off',\n\t\t\t\tminimap: { enabled: false },\n\t\t\t\tguides: {\n\t\t\t\t\tindentation: false,\n\t\t\t\t\tbracketPairs: false,\n\t\t\t\t\tbracketPairsHorizontal: false,\n\t\t\t\t\thighlightActiveIndentation: false,\n\t\t\t\t},\n\t\t\t\teditContext: false, // is a bit faster\n\t\t\t\trulers: [],\n\t\t\t\tpadding: { top: 0, bottom: 0 },\n\t\t\t\tfolding: false,\n\t\t\t\tselectOnLineNumbers: false,\n\t\t\t\tselectionHighlight: false,\n\t\t\t\tcolumnSelection: false,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t\toverviewRulerLanes: 0,\n\t\t\t\tlineDecorationsWidth: 0,\n\t\t\t\tlineNumbersMinChars: 0,\n\t\t\t\trevealHorizontalRightPadding: 0,\n\t\t\t\tbracketPairColorization: { enabled: true, independentColorPoolPerBracketType: false },\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t},\n\t\t\t\treadOnly: true,\n\t\t\t\twordWrap: 'off',\n\t\t\t\twordWrapOverride1: 'off',\n\t\t\t\twordWrapOverride2: 'off',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcontextKeyValues: {\n\t\t\t\t\t[InlineCompletionContextKeys.inInlineEditsPreviewEditor.key]: true,\n\t\t\t\t},\n\t\t\t\tcontributions: [],\n\t\t\t},\n\t\t\tthis._editor\n\t\t));\n\t\tthis._previewEditorObs = observableCodeEditor(this.previewEditor);\n\t\tthis._activeViewZones = [];\n\t\tthis._updatePreviewEditor = derived(this, reader => {\n\t\t\tthis._editorContainer.readEffect(reader);\n\t\t\tthis._previewEditorObs.model.read(reader); // update when the model is set\n\n\t\t\t// Setting this here explicitly to make sure that the preview editor is\n\t\t\t// visible when needed, we're also checking that these fields are defined\n\t\t\t// because of the auto run initial\n\t\t\t// Before removing these, verify with a non-monospace font family\n\t\t\tthis._display.read(reader);\n\t\t\tif (this._nonOverflowView) {\n\t\t\t\tthis._nonOverflowView.element.style.display = this._display.read(reader);\n\t\t\t}\n\n\t\t\tconst uiState = this._uiState.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!uiState || !edit) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst range = edit.originalLineRange;\n\n\t\t\tconst hiddenAreas: Range[] = [];\n\t\t\tif (range.startLineNumber > 1) {\n\t\t\t\thiddenAreas.push(new Range(1, 1, range.startLineNumber - 1, 1));\n\t\t\t}\n\t\t\tif (range.startLineNumber + uiState.newTextLineCount < this._previewTextModel.getLineCount() + 1) {\n\t\t\t\thiddenAreas.push(new Range(range.startLineNumber + uiState.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1));\n\t\t\t}\n\n\t\t\tthis.previewEditor.setHiddenAreas(hiddenAreas, undefined, true);\n\n\t\t\t// TODO: is this the proper way to handle viewzones?\n\t\t\tconst previousViewZones = [...this._activeViewZones];\n\t\t\tthis._activeViewZones = [];\n\n\t\t\tconst reducedLinesCount = (range.endLineNumberExclusive - range.startLineNumber) - uiState.newTextLineCount;\n\t\t\tthis.previewEditor.changeViewZones((changeAccessor) => {\n\t\t\t\tpreviousViewZones.forEach(id => changeAccessor.removeZone(id));\n\n\t\t\t\tif (reducedLinesCount > 0) {\n\t\t\t\t\tthis._activeViewZones.push(changeAccessor.addZone({\n\t\t\t\t\t\tafterLineNumber: range.startLineNumber + uiState.newTextLineCount - 1,\n\t\t\t\t\t\theightInLines: reducedLinesCount,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tdomNode: $('div.diagonal-fill.inline-edits-view-zone'),\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis._previewEditorWidth = derived(this, reader => {\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit) { return 0; }\n\t\t\tthis._updatePreviewEditor.read(reader);\n\n\t\t\treturn maxContentWidthInRange(this._previewEditorObs, edit.modifiedLineRange, reader);\n\t\t});\n\t\tthis._cursorPosIfTouchesEdit = derived(this, reader => {\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit || !cursorPos) { return undefined; }\n\t\t\treturn edit.modifiedLineRange.contains(cursorPos.lineNumber) ? cursorPos : undefined;\n\t\t});\n\t\tthis._originalStartPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.startLineNumber, 1) : null;\n\t\t});\n\t\tthis._originalEndPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.endLineNumberExclusive, 1) : null;\n\t\t});\n\t\tthis._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map(p => p?.y);\n\t\tthis._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map(p => p?.y);\n\t\tthis._originalDisplayRange = this._edit.map(e => e?.displayRange);\n\t\tthis._editorMaxContentWidthInRange = derived(this, reader => {\n\t\t\tconst originalDisplayRange = this._originalDisplayRange.read(reader);\n\t\t\tif (!originalDisplayRange) {\n\t\t\t\treturn constObservable(0);\n\t\t\t}\n\t\t\tthis._editorObs.versionId.read(reader);\n\n\t\t\t// Take the max value that we observed.\n\t\t\t// Reset when either the edit changes or the editor text version.\n\t\t\treturn derivedObservableWithCache<number>(this, (reader, lastValue) => {\n\t\t\t\tconst maxWidth = maxContentWidthInRange(this._editorObs, originalDisplayRange, reader);\n\t\t\t\treturn Math.max(maxWidth, lastValue ?? 0);\n\t\t\t});\n\t\t}).map((v, r) => v.read(r));\n\n\t\tconst editorDomContentRect = observeEditorBoundingClientRect(this._editor, this._store);\n\n\t\tthis._previewEditorLayoutInfo = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\tif (!inlineEdit) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst state = this._uiState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst range = inlineEdit.originalLineRange;\n\n\t\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\n\t\t\tconst editorContentMaxWidthInRange = this._editorMaxContentWidthInRange.read(reader);\n\t\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst previewContentWidth = this._previewEditorWidth.read(reader);\n\t\t\tconst editorContentAreaWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\t\tconst editorBoundingClientRect = editorDomContentRect.read(reader);\n\t\t\tconst clientContentAreaRight = editorLayout.contentLeft + editorLayout.contentWidth + editorBoundingClientRect.left;\n\t\t\tconst remainingWidthRightOfContent = getWindow(this._editor.getContainerDomNode()).innerWidth - clientContentAreaRight;\n\t\t\tconst remainingWidthRightOfEditor = getWindow(this._editor.getContainerDomNode()).innerWidth - editorBoundingClientRect.right;\n\t\t\tconst desiredMinimumWidth = Math.min(editorLayout.contentWidth * 0.3, previewContentWidth, 100);\n\t\t\tconst IN_EDITOR_DISPLACEMENT = 0;\n\t\t\tconst maximumAvailableWidth = IN_EDITOR_DISPLACEMENT + remainingWidthRightOfContent;\n\n\t\t\tconst cursorPos = this._cursorPosIfTouchesEdit.read(reader);\n\n\t\t\tconst maxPreviewEditorLeft = Math.max(\n\t\t\t\t// We're starting from the content area right and moving it left by IN_EDITOR_DISPLACEMENT and also by an amount to ensure some minimum desired width\n\t\t\t\teditorContentAreaWidth + horizontalScrollOffset - IN_EDITOR_DISPLACEMENT - Math.max(0, desiredMinimumWidth - maximumAvailableWidth),\n\t\t\t\t// But we don't want that the moving left ends up covering the cursor, so this will push it to the right again\n\t\t\t\tMath.min(\n\t\t\t\t\tcursorPos ? getOffsetForPos(this._editorObs, cursorPos, reader) + 50 : 0,\n\t\t\t\t\teditorContentAreaWidth + horizontalScrollOffset\n\t\t\t\t)\n\t\t\t);\n\t\t\tconst previewEditorLeftInTextArea = Math.min(editorContentMaxWidthInRange + ORIGINAL_END_PADDING, maxPreviewEditorLeft);\n\n\t\t\tconst maxContentWidth = editorContentMaxWidthInRange + ORIGINAL_END_PADDING + previewContentWidth + 70;\n\n\t\t\tconst dist = maxPreviewEditorLeft - previewEditorLeftInTextArea;\n\n\t\t\tlet desiredPreviewEditorScrollLeft;\n\t\t\tlet codeRight;\n\t\t\tif (previewEditorLeftInTextArea > horizontalScrollOffset) {\n\t\t\t\tdesiredPreviewEditorScrollLeft = 0;\n\t\t\t\tcodeRight = editorLayout.contentLeft + previewEditorLeftInTextArea - horizontalScrollOffset;\n\t\t\t} else {\n\t\t\t\tdesiredPreviewEditorScrollLeft = horizontalScrollOffset - previewEditorLeftInTextArea;\n\t\t\t\tcodeRight = editorLayout.contentLeft;\n\t\t\t}\n\n\t\t\tconst selectionTop = this._originalVerticalStartPosition.read(reader) ?? this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tconst selectionBottom = this._originalVerticalEndPosition.read(reader) ?? this._editor.getBottomForLineNumber(range.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(reader);\n\n\t\t\t// TODO: const { prefixLeftOffset } = getPrefixTrim(inlineEdit.edit.edits.map(e => e.range), inlineEdit.originalLineRange, [], this._editor);\n\t\t\tconst codeLeft = editorLayout.contentLeft - horizontalScrollOffset;\n\n\t\t\tlet codeRect = Rect.fromLeftTopRightBottom(codeLeft, selectionTop, codeRight, selectionBottom);\n\t\t\tconst isInsertion = codeRect.height === 0;\n\t\t\tif (!isInsertion) {\n\t\t\t\tcodeRect = codeRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING);\n\t\t\t}\n\n\t\t\tconst previewLineHeights = this._previewEditorObs.observeLineHeightsForLineRange(inlineEdit.modifiedLineRange).read(reader);\n\t\t\tconst editHeight = previewLineHeights.reduce((acc, h) => acc + h, 0);\n\t\t\tconst codeHeight = selectionBottom - selectionTop;\n\t\t\tconst previewEditorHeight = Math.max(codeHeight, editHeight);\n\n\t\t\tconst clipped = dist === 0;\n\t\t\tconst codeEditDist = 0;\n\t\t\tconst previewEditorWidth = Math.min(previewContentWidth + MODIFIED_END_PADDING, remainingWidthRightOfEditor + editorLayout.width - editorLayout.contentLeft - codeEditDist);\n\n\t\t\tlet editRect = Rect.fromLeftTopWidthHeight(codeRect.right + codeEditDist, selectionTop, previewEditorWidth, previewEditorHeight);\n\t\t\tif (!isInsertion) {\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateX(HORIZONTAL_PADDING + BORDER_WIDTH);\n\t\t\t} else {\n\t\t\t\t// Align top of edit with insertion line\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateY(VERTICAL_PADDING);\n\t\t\t}\n\n\t\t\t// debugView(debugLogRects({ codeRect, editRect }, this._editor.getDomNode()!), reader);\n\n\t\t\treturn {\n\t\t\t\tcodeRect,\n\t\t\t\teditRect,\n\t\t\t\tcodeScrollLeft: horizontalScrollOffset,\n\t\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\t\tisInsertion,\n\t\t\t\tmaxContentWidth,\n\t\t\t\tshouldShowShadow: clipped,\n\t\t\t\tdesiredPreviewEditorScrollLeft,\n\t\t\t\tpreviewEditorWidth,\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController ? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight) : constObservable(0);\n\t\tthis._shouldOverflow = derived(this, reader => {\n\t\t\tif (!ENABLE_OVERFLOW) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst range = this._edit.read(reader)?.originalLineRange;\n\t\t\tif (!range) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst stickyScrollHeight = this._stickyScrollHeight.read(reader);\n\t\t\tconst top = this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (top <= stickyScrollHeight) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst bottom = this._editor.getTopForLineNumber(range.endLineNumberExclusive) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (bottom >= this._editorObs.layoutInfo.read(reader).height) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tthis._originalBackgroundColor = observableFromEvent(this, this._themeService.onDidColorThemeChange, () => {\n\t\t\treturn this._themeService.getColorTheme().getColor(originalBackgroundColor) ?? Color.transparent;\n\t\t});\n\t\tthis._backgroundSvg = n.svg({\n\t\t\ttransform: 'translate(-0.5 -0.5)',\n\t\t\tstyle: { overflow: 'visible', pointerEvents: 'none', position: 'absolute' },\n\t\t}, [\n\t\t\tn.svgElem('path', {\n\t\t\t\tclass: 'rightOfModifiedBackgroundCoverUp',\n\t\t\t\td: derived(this, reader => {\n\t\t\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\t\t\tif (!layoutInfo) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tconst originalBackgroundColor = this._originalBackgroundColor.read(reader);\n\t\t\t\t\tif (originalBackgroundColor.isTransparent()) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new PathBuilder()\n\t\t\t\t\t\t.moveTo(layoutInfo.codeRect.getRightTop())\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightTop().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom())\n\t\t\t\t\t\t.build();\n\t\t\t\t}),\n\t\t\t\tstyle: {\n\t\t\t\t\tfill: asCssVariableWithDefault(editorBackground, 'transparent'),\n\t\t\t\t}\n\t\t\t}),\n\t\t]).keepUpdated(this._store);\n\t\tthis._originalOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', display: this._previewEditorLayoutInfo.map(layoutInfo => layoutInfo?.isInsertion ? 'none' : 'block') },\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderStyling = getOriginalBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`;\n\n\t\t\tconst hasBorderLeft = layoutInfoObs.read(reader).codeScrollLeft !== 0;\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\t\t\tconst transitionRectSize = BORDER_RADIUS * 2 + BORDER_WIDTH * 2;\n\n\t\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t\t// such that there is a smooth transition at the edge of content left\n\t\t\tconst overlayHider = layoutInfoObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\t\tlayoutInfo.codeRect.top,\n\t\t\t\tlayoutInfo.contentLeft,\n\t\t\t\tlayoutInfo.codeRect.bottom + transitionRectSize\n\t\t\t)).read(reader);\n\n\t\t\tconst intersectionLine = new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER);\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.intersectHorizontal(intersectionLine));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, 0, separatorWidth, separatorWidth).intersectHorizontal(intersectionLine));\n\n\t\t\tconst transitionRect = overlayRect.map(overlayRect => Rect.fromLeftTopWidthHeight(overlayRect.right - transitionRectSize + BORDER_WIDTH, overlayRect.bottom - BORDER_WIDTH, transitionRectSize, transitionRectSize).intersectHorizontal(intersectionLine));\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStylingSeparator,\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\tborderBottom: borderStyling,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStyling,\n\t\t\t\t\t\tbackgroundColor: asCssVariable(originalBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalCornerCutoutSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\tdisplay: isModifiedLower.map(isLower => isLower ? 'block' : 'none'),\n\t\t\t\t\t\t...transitionRect.read(reader).toStyles(),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBackground',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tbackgroundColor: getEditorBlendedColor(originalBackgroundColor, this._themeService).map(c => c.toString()),\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBorder',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\t\tborderRight: borderStyling,\n\t\t\t\t\t\t\tborderRadius: `0 100% 0 0`,\n\t\t\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySideHider',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground),\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._modifiedOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', }\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderRadius = isModifiedLower.map(isLower => `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px ${isLower ? BORDER_RADIUS : 0}px`);\n\t\t\tconst borderStyling = getEditorBlendedColor(getModifiedBorderColor(this._tabAction), this._themeService).map(c => `1px solid ${c.toString()}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`;\n\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.editRect.withMargin(0, BORDER_WIDTH));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, separatorWidth, separatorWidth, 0));\n\n\t\t\tconst insertionRect = derived(this, reader => {\n\t\t\t\tconst overlay = overlayRect.read(reader);\n\t\t\t\tconst layoutinfo = layoutInfoObs.read(reader);\n\t\t\t\tif (!layoutinfo.isInsertion || layoutinfo.contentLeft >= overlay.left) {\n\t\t\t\t\treturn Rect.fromLeftTopWidthHeight(overlay.left, overlay.top, 0, 0);\n\t\t\t\t}\n\t\t\t\treturn new Rect(layoutinfo.contentLeft, overlay.top, overlay.left, overlay.top + BORDER_WIDTH * 2);\n\t\t\t});\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedInsertionSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...insertionRect.read(reader).toStyles(),\n\t\t\t\t\t\tbackgroundColor: getModifiedBorderColor(this._tabAction).map(c => asCssVariable(c)),\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderRight: borderStylingSeparator,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborder: borderStyling,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._nonOverflowView = n.div({\n\t\t\tclass: 'inline-edits-view',\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t\ttop: '0px',\n\t\t\t\tleft: '0px',\n\t\t\t\tdisplay: this._display,\n\t\t\t},\n\t\t}, [\n\t\t\tthis._backgroundSvg,\n\t\t\tderived(this, reader => this._shouldOverflow.read(reader) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay]),\n\t\t]).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._nonOverflowView.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst x = this._previewEditorLayoutInfo.read(reader)?.maxContentWidth;\n\t\t\t\tif (x === undefined) { return 0; }\n\t\t\t\treturn x;\n\t\t\t}),\n\t\t}));\n\n\t\tthis.previewEditor.setModel(this._previewTextModel);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst editorRect = layoutInfo.editRect.withMargin(-VERTICAL_PADDING, -HORIZONTAL_PADDING);\n\n\t\t\tthis.previewEditor.layout({ height: editorRect.height, width: layoutInfo.previewEditorWidth + 15 /* Make sure editor does not scroll horizontally */ });\n\t\t\tthis._editorContainer.element.style.top = `${editorRect.top}px`;\n\t\t\tthis._editorContainer.element.style.left = `${editorRect.left}px`;\n\t\t\tthis._editorContainer.element.style.width = `${layoutInfo.previewEditorWidth + HORIZONTAL_PADDING}px`; // Set width to clip view zone\n\t\t\t//this._editorContainer.element.style.borderRadius = `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px 0`;\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._previewEditorObs.editor.setScrollLeft(layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _display;\n\n\tprivate readonly previewRef;\n\n\tprivate readonly _editorContainer;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly previewEditor;\n\n\tprivate readonly _previewEditorObs;\n\n\tprivate _activeViewZones: string[];\n\tprivate readonly _updatePreviewEditor;\n\n\tprivate readonly _previewEditorWidth;\n\n\tprivate readonly _cursorPosIfTouchesEdit;\n\n\tprivate readonly _originalStartPosition;\n\n\tprivate readonly _originalEndPosition;\n\n\tprivate readonly _originalVerticalStartPosition;\n\tprivate readonly _originalVerticalEndPosition;\n\n\tprivate readonly _originalDisplayRange;\n\tprivate readonly _editorMaxContentWidthInRange;\n\n\tprivate readonly _previewEditorLayoutInfo;\n\n\tprivate _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _shouldOverflow;\n\n\tprivate readonly _originalBackgroundColor;\n\n\tprivate readonly _backgroundSvg;\n\n\tprivate readonly _originalOverlay;\n\n\tprivate readonly _modifiedOverlay;\n\n\tprivate readonly _nonOverflowView;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAwB,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1K,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,4DAA4D,CAAC;AAE3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OA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AC,CAAC;YACxJ,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;YAChE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC,IAAI,IAAI,CAAC;YAClE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,UAAU,CAAC,kBAAkB,GAAG,kBAAkB,IAAI,CAAC,CAAC,8BAA8B;YACrI,iGAAiG;QAClG,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9D,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,OAAO;YACR,CAAC;YAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,oBAAoB,CAAC,6BAA6B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC;CAiDD,CAAA;AAhlBY,yBAAyB;IAgCnC,WAAA,qBAAqB,CAAA;IACrB,WAAA,aAAa,CAAA;GAjCH,yBAAyB,CAglBrC","file":"inlineEditsSideBySideView.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, n } from '../../../../../../../base/browser/dom.js';\nimport { Color } from '../../../../../../../base/common/color.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, IReader, autorun, constObservable, derived, derivedObservableWithCache, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EmbeddedCodeEditorWidget } from '../../../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { InlineCompletionContextKeys } from '../../../controller/inlineCompletionContextKeys.js';\nimport { IInlineEditsView, InlineEditClickEvent, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../inlineEditWithChanges.js';\nimport { getEditorBackgroundColor, getEditorBlendedColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, modifiedBackgroundColor, originalBackgroundColor } from '../theme.js';\nimport { PathBuilder, getContentRenderWidth, getOffsetForPos, mapOutFalsy, maxContentWidthInRange, observeEditorBoundingClientRect } from '../utils/utils.js';\nimport { InlineCompletionEditorType } from '../../../model/provideInlineCompletions.js';\n\nconst HORIZONTAL_PADDING = 0;\nconst VERTICAL_PADDING = 0;\nconst ENABLE_OVERFLOW = false;\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = INLINE_EDITS_BORDER_RADIUS;\nconst ORIGINAL_END_PADDING = 20;\nconst MODIFIED_END_PADDING = 12;\n\nexport class InlineEditsSideBySideView extends Disposable implements IInlineEditsView {\n\n\t// This is an approximation and should be improved by using the real parameters used bellow\n\tstatic fitsInsideViewport(editor: ICodeEditor, textModel: ITextModel, edit: InlineEditWithChanges, reader: IReader): boolean {\n\t\tconst editorObs = observableCodeEditor(editor);\n\t\tconst editorWidth = editorObs.layoutInfoWidth.read(reader);\n\t\tconst editorContentLeft = editorObs.layoutInfoContentLeft.read(reader);\n\t\tconst editorVerticalScrollbar = editor.getLayoutInfo().verticalScrollbarWidth;\n\t\tconst minimapWidth = editorObs.layoutInfoMinimap.read(reader).minimapLeft !== 0 ? editorObs.layoutInfoMinimap.read(reader).minimapWidth : 0;\n\n\t\tconst maxOriginalContent = maxContentWidthInRange(editorObs, edit.displayRange, undefined/* do not reconsider on each layout info change */);\n\t\tconst maxModifiedContent = edit.lineEdit.newLines.reduce((max, line) => Math.max(max, getContentRenderWidth(line, editor, textModel)), 0);\n\t\tconst originalPadding = ORIGINAL_END_PADDING; // padding after last line of original editor\n\t\tconst modifiedPadding = MODIFIED_END_PADDING + 2 * BORDER_WIDTH; // padding after last line of modified editor\n\n\t\treturn maxOriginalContent + maxModifiedContent + originalPadding + modifiedPadding < editorWidth - editorContentLeft - editorVerticalScrollbar - minimapWidth;\n\t}\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEditWithChanges | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\n\t\tprivate readonly _uiState: IObservable<{\n\t\t\tnewTextLineCount: number;\n\t\t\teditorType: InlineCompletionEditorType;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._display = derived(this, reader => !!this._uiState.read(reader) ? 'block' : 'none');\n\t\tthis.previewRef = n.ref<HTMLDivElement>();\n\t\tconst separatorWidthObs = this._uiState.map(s => s?.editorType === InlineCompletionEditorType.DiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH);\n\t\tthis._editorContainer = n.div({\n\t\t\tclass: ['editorContainer'],\n\t\t\tstyle: { position: 'absolute', overflow: 'hidden', cursor: 'pointer' },\n\t\t\tonmousedown: e => {\n\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t},\n\t\t\tonclick: (e) => {\n\t\t\t\tthis._onDidClick.fire(InlineEditClickEvent.create(e));\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({ class: 'preview', style: { pointerEvents: 'none' }, ref: this.previewRef }),\n\t\t]).keepUpdated(this._store);\n\t\tthis.isHovered = this._editorContainer.didMouseMoveDuringHover;\n\t\tthis.previewEditor = this._register(this._instantiationService.createInstance(\n\t\t\tEmbeddedCodeEditorWidget,\n\t\t\tthis.previewRef.element,\n\t\t\t{\n\t\t\t\tglyphMargin: false,\n\t\t\t\tlineNumbers: 'off',\n\t\t\t\tminimap: { enabled: false },\n\t\t\t\tguides: {\n\t\t\t\t\tindentation: false,\n\t\t\t\t\tbracketPairs: false,\n\t\t\t\t\tbracketPairsHorizontal: false,\n\t\t\t\t\thighlightActiveIndentation: false,\n\t\t\t\t},\n\t\t\t\teditContext: false, // is a bit faster\n\t\t\t\trulers: [],\n\t\t\t\tpadding: { top: 0, bottom: 0 },\n\t\t\t\tfolding: false,\n\t\t\t\tselectOnLineNumbers: false,\n\t\t\t\tselectionHighlight: false,\n\t\t\t\tcolumnSelection: false,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t\toverviewRulerLanes: 0,\n\t\t\t\tlineDecorationsWidth: 0,\n\t\t\t\tlineNumbersMinChars: 0,\n\t\t\t\trevealHorizontalRightPadding: 0,\n\t\t\t\tbracketPairColorization: { enabled: true, independentColorPoolPerBracketType: false },\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t},\n\t\t\t\treadOnly: true,\n\t\t\t\twordWrap: 'off',\n\t\t\t\twordWrapOverride1: 'off',\n\t\t\t\twordWrapOverride2: 'off',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcontextKeyValues: {\n\t\t\t\t\t[InlineCompletionContextKeys.inInlineEditsPreviewEditor.key]: true,\n\t\t\t\t},\n\t\t\t\tcontributions: [],\n\t\t\t},\n\t\t\tthis._editor\n\t\t));\n\t\tthis._previewEditorObs = observableCodeEditor(this.previewEditor);\n\t\tthis._activeViewZones = [];\n\t\tthis._updatePreviewEditor = derived(this, reader => {\n\t\t\tthis._editorContainer.readEffect(reader);\n\t\t\tthis._previewEditorObs.model.read(reader); // update when the model is set\n\n\t\t\t// Setting this here explicitly to make sure that the preview editor is\n\t\t\t// visible when needed, we're also checking that these fields are defined\n\t\t\t// because of the auto run initial\n\t\t\t// Before removing these, verify with a non-monospace font family\n\t\t\tthis._display.read(reader);\n\t\t\tif (this._nonOverflowView) {\n\t\t\t\tthis._nonOverflowView.element.style.display = this._display.read(reader);\n\t\t\t}\n\n\t\t\tconst uiState = this._uiState.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!uiState || !edit) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst range = edit.originalLineRange;\n\n\t\t\tconst hiddenAreas: Range[] = [];\n\t\t\tif (range.startLineNumber > 1) {\n\t\t\t\thiddenAreas.push(new Range(1, 1, range.startLineNumber - 1, 1));\n\t\t\t}\n\t\t\tif (range.startLineNumber + uiState.newTextLineCount < this._previewTextModel.getLineCount() + 1) {\n\t\t\t\thiddenAreas.push(new Range(range.startLineNumber + uiState.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1));\n\t\t\t}\n\n\t\t\tthis.previewEditor.setHiddenAreas(hiddenAreas, undefined, true);\n\n\t\t\t// TODO: is this the proper way to handle viewzones?\n\t\t\tconst previousViewZones = [...this._activeViewZones];\n\t\t\tthis._activeViewZones = [];\n\n\t\t\tconst reducedLinesCount = (range.endLineNumberExclusive - range.startLineNumber) - uiState.newTextLineCount;\n\t\t\tthis.previewEditor.changeViewZones((changeAccessor) => {\n\t\t\t\tpreviousViewZones.forEach(id => changeAccessor.removeZone(id));\n\n\t\t\t\tif (reducedLinesCount > 0) {\n\t\t\t\t\tthis._activeViewZones.push(changeAccessor.addZone({\n\t\t\t\t\t\tafterLineNumber: range.startLineNumber + uiState.newTextLineCount - 1,\n\t\t\t\t\t\theightInLines: reducedLinesCount,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tdomNode: $('div.diagonal-fill.inline-edits-view-zone'),\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis._previewEditorWidth = derived(this, reader => {\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit) { return 0; }\n\t\t\tthis._updatePreviewEditor.read(reader);\n\n\t\t\treturn maxContentWidthInRange(this._previewEditorObs, edit.modifiedLineRange, reader);\n\t\t});\n\t\tthis._cursorPosIfTouchesEdit = derived(this, reader => {\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit || !cursorPos) { return undefined; }\n\t\t\treturn edit.modifiedLineRange.contains(cursorPos.lineNumber) ? cursorPos : undefined;\n\t\t});\n\t\tthis._originalStartPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.startLineNumber, 1) : null;\n\t\t});\n\t\tthis._originalEndPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.endLineNumberExclusive, 1) : null;\n\t\t});\n\t\tthis._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map(p => p?.y);\n\t\tthis._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map(p => p?.y);\n\t\tthis._originalDisplayRange = this._edit.map(e => e?.displayRange);\n\t\tthis._editorMaxContentWidthInRange = derived(this, reader => {\n\t\t\tconst originalDisplayRange = this._originalDisplayRange.read(reader);\n\t\t\tif (!originalDisplayRange) {\n\t\t\t\treturn constObservable(0);\n\t\t\t}\n\t\t\tthis._editorObs.versionId.read(reader);\n\n\t\t\t// Take the max value that we observed.\n\t\t\t// Reset when either the edit changes or the editor text version.\n\t\t\treturn derivedObservableWithCache<number>(this, (reader, lastValue) => {\n\t\t\t\tconst maxWidth = maxContentWidthInRange(this._editorObs, originalDisplayRange, reader);\n\t\t\t\treturn Math.max(maxWidth, lastValue ?? 0);\n\t\t\t});\n\t\t}).map((v, r) => v.read(r));\n\n\t\tconst editorDomContentRect = observeEditorBoundingClientRect(this._editor, this._store);\n\n\t\tthis._previewEditorLayoutInfo = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\tif (!inlineEdit) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst state = this._uiState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst range = inlineEdit.originalLineRange;\n\n\t\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\n\t\t\tconst editorContentMaxWidthInRange = this._editorMaxContentWidthInRange.read(reader);\n\t\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst previewContentWidth = this._previewEditorWidth.read(reader);\n\t\t\tconst editorContentAreaWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\t\tconst editorBoundingClientRect = editorDomContentRect.read(reader);\n\t\t\tconst clientContentAreaRight = editorLayout.contentLeft + editorLayout.contentWidth + editorBoundingClientRect.left;\n\t\t\tconst remainingWidthRightOfContent = getWindow(this._editor.getContainerDomNode()).innerWidth - clientContentAreaRight;\n\t\t\tconst remainingWidthRightOfEditor = getWindow(this._editor.getContainerDomNode()).innerWidth - editorBoundingClientRect.right;\n\t\t\tconst desiredMinimumWidth = Math.min(editorLayout.contentWidth * 0.3, previewContentWidth, 100);\n\t\t\tconst IN_EDITOR_DISPLACEMENT = 0;\n\t\t\tconst maximumAvailableWidth = IN_EDITOR_DISPLACEMENT + remainingWidthRightOfContent;\n\n\t\t\tconst cursorPos = this._cursorPosIfTouchesEdit.read(reader);\n\n\t\t\tconst maxPreviewEditorLeft = Math.max(\n\t\t\t\t// We're starting from the content area right and moving it left by IN_EDITOR_DISPLACEMENT and also by an amount to ensure some minimum desired width\n\t\t\t\teditorContentAreaWidth + horizontalScrollOffset - IN_EDITOR_DISPLACEMENT - Math.max(0, desiredMinimumWidth - maximumAvailableWidth),\n\t\t\t\t// But we don't want that the moving left ends up covering the cursor, so this will push it to the right again\n\t\t\t\tMath.min(\n\t\t\t\t\tcursorPos ? getOffsetForPos(this._editorObs, cursorPos, reader) + 50 : 0,\n\t\t\t\t\teditorContentAreaWidth + horizontalScrollOffset\n\t\t\t\t)\n\t\t\t);\n\t\t\tconst previewEditorLeftInTextArea = Math.min(editorContentMaxWidthInRange + ORIGINAL_END_PADDING, maxPreviewEditorLeft);\n\n\t\t\tconst maxContentWidth = editorContentMaxWidthInRange + ORIGINAL_END_PADDING + previewContentWidth + 70;\n\n\t\t\tconst dist = maxPreviewEditorLeft - previewEditorLeftInTextArea;\n\n\t\t\tlet desiredPreviewEditorScrollLeft;\n\t\t\tlet codeRight;\n\t\t\tif (previewEditorLeftInTextArea > horizontalScrollOffset) {\n\t\t\t\tdesiredPreviewEditorScrollLeft = 0;\n\t\t\t\tcodeRight = editorLayout.contentLeft + previewEditorLeftInTextArea - horizontalScrollOffset;\n\t\t\t} else {\n\t\t\t\tdesiredPreviewEditorScrollLeft = horizontalScrollOffset - previewEditorLeftInTextArea;\n\t\t\t\tcodeRight = editorLayout.contentLeft;\n\t\t\t}\n\n\t\t\tconst selectionTop = this._originalVerticalStartPosition.read(reader) ?? this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tconst selectionBottom = this._originalVerticalEndPosition.read(reader) ?? this._editor.getBottomForLineNumber(range.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(reader);\n\n\t\t\t// TODO: const { prefixLeftOffset } = getPrefixTrim(inlineEdit.edit.edits.map(e => e.range), inlineEdit.originalLineRange, [], this._editor);\n\t\t\tconst codeLeft = editorLayout.contentLeft - horizontalScrollOffset;\n\n\t\t\tlet codeRect = Rect.fromLeftTopRightBottom(codeLeft, selectionTop, codeRight, selectionBottom);\n\t\t\tconst isInsertion = codeRect.height === 0;\n\t\t\tif (!isInsertion) {\n\t\t\t\tcodeRect = codeRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING);\n\t\t\t}\n\n\t\t\tconst previewLineHeights = this._previewEditorObs.observeLineHeightsForLineRange(inlineEdit.modifiedLineRange).read(reader);\n\t\t\tconst editHeight = previewLineHeights.reduce((acc, h) => acc + h, 0);\n\t\t\tconst codeHeight = selectionBottom - selectionTop;\n\t\t\tconst previewEditorHeight = Math.max(codeHeight, editHeight);\n\n\t\t\tconst clipped = dist === 0;\n\t\t\tconst codeEditDist = 0;\n\t\t\tconst previewEditorWidth = Math.min(previewContentWidth + MODIFIED_END_PADDING, remainingWidthRightOfEditor + editorLayout.width - editorLayout.contentLeft - codeEditDist);\n\n\t\t\tlet editRect = Rect.fromLeftTopWidthHeight(codeRect.right + codeEditDist, selectionTop, previewEditorWidth, previewEditorHeight);\n\t\t\tif (!isInsertion) {\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateX(HORIZONTAL_PADDING + BORDER_WIDTH);\n\t\t\t} else {\n\t\t\t\t// Align top of edit with insertion line\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateY(VERTICAL_PADDING);\n\t\t\t}\n\n\t\t\t// debugView(debugLogRects({ codeRect, editRect }, this._editor.getDomNode()!), reader);\n\n\t\t\treturn {\n\t\t\t\tcodeRect,\n\t\t\t\teditRect,\n\t\t\t\tcodeScrollLeft: horizontalScrollOffset,\n\t\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\t\tisInsertion,\n\t\t\t\tmaxContentWidth,\n\t\t\t\tshouldShowShadow: clipped,\n\t\t\t\tdesiredPreviewEditorScrollLeft,\n\t\t\t\tpreviewEditorWidth,\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController ? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight) : constObservable(0);\n\t\tthis._shouldOverflow = derived(this, reader => {\n\t\t\tif (!ENABLE_OVERFLOW) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst range = this._edit.read(reader)?.originalLineRange;\n\t\t\tif (!range) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst stickyScrollHeight = this._stickyScrollHeight.read(reader);\n\t\t\tconst top = this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (top <= stickyScrollHeight) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst bottom = this._editor.getTopForLineNumber(range.endLineNumberExclusive) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (bottom >= this._editorObs.layoutInfo.read(reader).height) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tthis._originalBackgroundColor = observableFromEvent(this, this._themeService.onDidColorThemeChange, () => {\n\t\t\treturn this._themeService.getColorTheme().getColor(originalBackgroundColor) ?? Color.transparent;\n\t\t});\n\t\tthis._editorBackgroundColor = this._uiState.map(s => {\n\t\t\treturn getEditorBackgroundColor(s?.editorType ?? InlineCompletionEditorType.TextEditor);\n\t\t});\n\t\tthis._backgroundSvg = n.svg({\n\t\t\ttransform: 'translate(-0.5 -0.5)',\n\t\t\tstyle: { overflow: 'visible', pointerEvents: 'none', position: 'absolute' },\n\t\t}, [\n\t\t\tn.svgElem('path', {\n\t\t\t\tclass: 'rightOfModifiedBackgroundCoverUp',\n\t\t\t\td: derived(this, reader => {\n\t\t\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\t\t\tif (!layoutInfo) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tconst originalBackgroundColor = this._originalBackgroundColor.read(reader);\n\t\t\t\t\tif (originalBackgroundColor.isTransparent()) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new PathBuilder()\n\t\t\t\t\t\t.moveTo(layoutInfo.codeRect.getRightTop())\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightTop().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom())\n\t\t\t\t\t\t.build();\n\t\t\t\t}),\n\t\t\t\tstyle: {\n\t\t\t\t\tfill: this._editorBackgroundColor,\n\t\t\t\t}\n\t\t\t}),\n\t\t]).keepUpdated(this._store);\n\t\tthis._originalOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', display: this._previewEditorLayoutInfo.map(layoutInfo => layoutInfo?.isInsertion ? 'none' : 'block') },\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst editorBackground = this._editorBackgroundColor.read(reader);\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderStyling = getOriginalBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${editorBackground}`;\n\n\t\t\tconst hasBorderLeft = layoutInfoObs.read(reader).codeScrollLeft !== 0;\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\t\t\tconst transitionRectSize = BORDER_RADIUS * 2 + BORDER_WIDTH * 2;\n\n\t\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t\t// such that there is a smooth transition at the edge of content left\n\t\t\tconst overlayHider = layoutInfoObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\t\tlayoutInfo.codeRect.top,\n\t\t\t\tlayoutInfo.contentLeft,\n\t\t\t\tlayoutInfo.codeRect.bottom + transitionRectSize\n\t\t\t)).read(reader);\n\n\t\t\tconst intersectionLine = new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER);\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.intersectHorizontal(intersectionLine));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, 0, separatorWidth, separatorWidth).intersectHorizontal(intersectionLine));\n\n\t\t\tconst transitionRect = overlayRect.map(overlayRect => Rect.fromLeftTopWidthHeight(overlayRect.right - transitionRectSize + BORDER_WIDTH, overlayRect.bottom - BORDER_WIDTH, transitionRectSize, transitionRectSize).intersectHorizontal(intersectionLine));\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStylingSeparator,\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\tborderBottom: borderStyling,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStyling,\n\t\t\t\t\t\tbackgroundColor: asCssVariable(originalBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalCornerCutoutSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\tdisplay: isModifiedLower.map(isLower => isLower ? 'block' : 'none'),\n\t\t\t\t\t\t...transitionRect.read(reader).toStyles(),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBackground',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tbackgroundColor: getEditorBlendedColor(originalBackgroundColor, this._themeService).map(c => c.toString()),\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBorder',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\t\tborderRight: borderStyling,\n\t\t\t\t\t\t\tborderRadius: `0 100% 0 0`,\n\t\t\t\t\t\t\tbackgroundColor: editorBackground\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySideHider',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\t\tbackgroundColor: editorBackground,\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._modifiedOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', }\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\t\t\tconst editorBackground = this._editorBackgroundColor.read(reader);\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderRadius = isModifiedLower.map(isLower => `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px ${isLower ? BORDER_RADIUS : 0}px`);\n\t\t\tconst borderStyling = getEditorBlendedColor(getModifiedBorderColor(this._tabAction), this._themeService).map(c => `1px solid ${c.toString()}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${editorBackground}`;\n\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.editRect.withMargin(0, BORDER_WIDTH));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, separatorWidth, separatorWidth, 0));\n\n\t\t\tconst insertionRect = derived(this, reader => {\n\t\t\t\tconst overlay = overlayRect.read(reader);\n\t\t\t\tconst layoutinfo = layoutInfoObs.read(reader);\n\t\t\t\tif (!layoutinfo.isInsertion || layoutinfo.contentLeft >= overlay.left) {\n\t\t\t\t\treturn Rect.fromLeftTopWidthHeight(overlay.left, overlay.top, 0, 0);\n\t\t\t\t}\n\t\t\t\treturn new Rect(layoutinfo.contentLeft, overlay.top, overlay.left, overlay.top + BORDER_WIDTH * 2);\n\t\t\t});\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedInsertionSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...insertionRect.read(reader).toStyles(),\n\t\t\t\t\t\tbackgroundColor: getModifiedBorderColor(this._tabAction).map(c => asCssVariable(c)),\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderRight: borderStylingSeparator,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborder: borderStyling,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._nonOverflowView = n.div({\n\t\t\tclass: 'inline-edits-view',\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t\ttop: '0px',\n\t\t\t\tleft: '0px',\n\t\t\t\tdisplay: this._display,\n\t\t\t},\n\t\t}, [\n\t\t\tthis._backgroundSvg,\n\t\t\tderived(this, reader => this._shouldOverflow.read(reader) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay]),\n\t\t]).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._nonOverflowView.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst x = this._previewEditorLayoutInfo.read(reader)?.maxContentWidth;\n\t\t\t\tif (x === undefined) { return 0; }\n\t\t\t\treturn x;\n\t\t\t}),\n\t\t}));\n\n\t\tthis.previewEditor.setModel(this._previewTextModel);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst editorRect = layoutInfo.editRect.withMargin(-VERTICAL_PADDING, -HORIZONTAL_PADDING);\n\n\t\t\tthis.previewEditor.layout({ height: editorRect.height, width: layoutInfo.previewEditorWidth + 15 /* Make sure editor does not scroll horizontally */ });\n\t\t\tthis._editorContainer.element.style.top = `${editorRect.top}px`;\n\t\t\tthis._editorContainer.element.style.left = `${editorRect.left}px`;\n\t\t\tthis._editorContainer.element.style.width = `${layoutInfo.previewEditorWidth + HORIZONTAL_PADDING}px`; // Set width to clip view zone\n\t\t\t//this._editorContainer.element.style.borderRadius = `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px 0`;\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._previewEditorObs.editor.setScrollLeft(layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _display;\n\n\tprivate readonly previewRef;\n\n\tprivate readonly _editorContainer;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly previewEditor;\n\n\tprivate readonly _previewEditorObs;\n\n\tprivate _activeViewZones: string[];\n\tprivate readonly _updatePreviewEditor;\n\n\tprivate readonly _previewEditorWidth;\n\n\tprivate readonly _cursorPosIfTouchesEdit;\n\n\tprivate readonly _originalStartPosition;\n\n\tprivate readonly _originalEndPosition;\n\n\tprivate readonly _originalVerticalStartPosition;\n\tprivate readonly _originalVerticalEndPosition;\n\n\tprivate readonly _originalDisplayRange;\n\tprivate readonly _editorMaxContentWidthInRange;\n\n\tprivate readonly _previewEditorLayoutInfo;\n\n\tprivate _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _shouldOverflow;\n\n\tprivate readonly _originalBackgroundColor;\n\n\tprivate readonly _editorBackgroundColor;\n\n\tprivate readonly _backgroundSvg;\n\n\tprivate readonly _originalOverlay;\n\n\tprivate readonly _modifiedOverlay;\n\n\tprivate readonly _nonOverflowView;\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, n } from '../../../../../../../base/browser/dom.js';\nimport { Color } from '../../../../../../../base/common/color.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, IReader, autorun, constObservable, derived, derivedObservableWithCache, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EmbeddedCodeEditorWidget } from '../../../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { InlineCompletionContextKeys } from '../../../controller/inlineCompletionContextKeys.js';\nimport { IInlineEditsView, InlineEditClickEvent, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../inlineEditWithChanges.js';\nimport { getEditorBackgroundColor, getEditorBlendedColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, modifiedBackgroundColor, originalBackgroundColor } from '../theme.js';\nimport { PathBuilder, getContentRenderWidth, getOffsetForPos, mapOutFalsy, maxContentWidthInRange, observeEditorBoundingClientRect } from '../utils/utils.js';\nimport { InlineCompletionEditorType } from '../../../model/provideInlineCompletions.js';\n\nconst HORIZONTAL_PADDING = 0;\nconst VERTICAL_PADDING = 0;\nconst ENABLE_OVERFLOW = false;\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = INLINE_EDITS_BORDER_RADIUS;\nconst ORIGINAL_END_PADDING = 20;\nconst MODIFIED_END_PADDING = 12;\n\nexport class InlineEditsSideBySideView extends Disposable implements IInlineEditsView {\n\n\t// This is an approximation and should be improved by using the real parameters used bellow\n\tstatic fitsInsideViewport(editor: ICodeEditor, textModel: ITextModel, edit: InlineEditWithChanges, reader: IReader): boolean {\n\t\tconst editorObs = observableCodeEditor(editor);\n\t\tconst editorWidth = editorObs.layoutInfoWidth.read(reader);\n\t\tconst editorContentLeft = editorObs.layoutInfoContentLeft.read(reader);\n\t\tconst editorVerticalScrollbar = editor.getLayoutInfo().verticalScrollbarWidth;\n\t\tconst minimapWidth = editorObs.layoutInfoMinimap.read(reader).minimapLeft !== 0 ? editorObs.layoutInfoMinimap.read(reader).minimapWidth : 0;\n\n\t\tconst maxOriginalContent = maxContentWidthInRange(editorObs, edit.displayRange, undefined/* do not reconsider on each layout info change */);\n\t\tconst maxModifiedContent = edit.lineEdit.newLines.reduce((max, line) => Math.max(max, getContentRenderWidth(line, editor, textModel)), 0);\n\t\tconst originalPadding = ORIGINAL_END_PADDING; // padding after last line of original editor\n\t\tconst modifiedPadding = MODIFIED_END_PADDING + 2 * BORDER_WIDTH; // padding after last line of modified editor\n\n\t\treturn maxOriginalContent + maxModifiedContent + originalPadding + modifiedPadding < editorWidth - editorContentLeft - editorVerticalScrollbar - minimapWidth;\n\t}\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEditWithChanges | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\n\t\tprivate readonly _uiState: IObservable<{\n\t\t\tnewTextLineCount: number;\n\t\t\teditorType: InlineCompletionEditorType;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._display = derived(this, reader => !!this._uiState.read(reader) ? 'block' : 'none');\n\t\tthis.previewRef = n.ref<HTMLDivElement>();\n\t\tconst separatorWidthObs = this._uiState.map(s => s?.editorType === InlineCompletionEditorType.DiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH);\n\t\tthis._editorContainer = n.div({\n\t\t\tclass: ['editorContainer'],\n\t\t\tstyle: { position: 'absolute', overflow: 'hidden', cursor: 'pointer' },\n\t\t\tonmousedown: e => {\n\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t},\n\t\t\tonclick: (e) => {\n\t\t\t\tthis._onDidClick.fire(InlineEditClickEvent.create(e));\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({ class: 'preview', style: { pointerEvents: 'none' }, ref: this.previewRef }),\n\t\t]).keepUpdated(this._store);\n\t\tthis.isHovered = this._editorContainer.didMouseMoveDuringHover;\n\t\tthis.previewEditor = this._register(this._instantiationService.createInstance(\n\t\t\tEmbeddedCodeEditorWidget,\n\t\t\tthis.previewRef.element,\n\t\t\t{\n\t\t\t\tglyphMargin: false,\n\t\t\t\tlineNumbers: 'off',\n\t\t\t\tminimap: { enabled: false },\n\t\t\t\tguides: {\n\t\t\t\t\tindentation: false,\n\t\t\t\t\tbracketPairs: false,\n\t\t\t\t\tbracketPairsHorizontal: false,\n\t\t\t\t\thighlightActiveIndentation: false,\n\t\t\t\t},\n\t\t\t\teditContext: false, // is a bit faster\n\t\t\t\trulers: [],\n\t\t\t\tpadding: { top: 0, bottom: 0 },\n\t\t\t\tfolding: false,\n\t\t\t\tselectOnLineNumbers: false,\n\t\t\t\tselectionHighlight: false,\n\t\t\t\tcolumnSelection: false,\n\t\t\t\toverviewRulerBorder: false,\n\t\t\t\toverviewRulerLanes: 0,\n\t\t\t\tlineDecorationsWidth: 0,\n\t\t\t\tlineNumbersMinChars: 0,\n\t\t\t\trevealHorizontalRightPadding: 0,\n\t\t\t\tbracketPairColorization: { enabled: true, independentColorPoolPerBracketType: false },\n\t\t\t\tscrollBeyondLastLine: false,\n\t\t\t\tscrollbar: {\n\t\t\t\t\tvertical: 'hidden',\n\t\t\t\t\thorizontal: 'hidden',\n\t\t\t\t\thandleMouseWheel: false,\n\t\t\t\t},\n\t\t\t\treadOnly: true,\n\t\t\t\twordWrap: 'off',\n\t\t\t\twordWrapOverride1: 'off',\n\t\t\t\twordWrapOverride2: 'off',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcontextKeyValues: {\n\t\t\t\t\t[InlineCompletionContextKeys.inInlineEditsPreviewEditor.key]: true,\n\t\t\t\t},\n\t\t\t\tcontributions: [],\n\t\t\t},\n\t\t\tthis._editor\n\t\t));\n\t\tthis._previewEditorObs = observableCodeEditor(this.previewEditor);\n\t\tthis._activeViewZones = [];\n\t\tthis._updatePreviewEditor = derived(this, reader => {\n\t\t\tthis._editorContainer.readEffect(reader);\n\t\t\tthis._previewEditorObs.model.read(reader); // update when the model is set\n\n\t\t\t// Setting this here explicitly to make sure that the preview editor is\n\t\t\t// visible when needed, we're also checking that these fields are defined\n\t\t\t// because of the auto run initial\n\t\t\t// Before removing these, verify with a non-monospace font family\n\t\t\tthis._display.read(reader);\n\t\t\tif (this._nonOverflowView) {\n\t\t\t\tthis._nonOverflowView.element.style.display = this._display.read(reader);\n\t\t\t}\n\n\t\t\tconst uiState = this._uiState.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!uiState || !edit) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst range = edit.originalLineRange;\n\n\t\t\tconst hiddenAreas: Range[] = [];\n\t\t\tif (range.startLineNumber > 1) {\n\t\t\t\thiddenAreas.push(new Range(1, 1, range.startLineNumber - 1, 1));\n\t\t\t}\n\t\t\tif (range.startLineNumber + uiState.newTextLineCount < this._previewTextModel.getLineCount() + 1) {\n\t\t\t\thiddenAreas.push(new Range(range.startLineNumber + uiState.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1));\n\t\t\t}\n\n\t\t\tthis.previewEditor.setHiddenAreas(hiddenAreas, undefined, true);\n\n\t\t\t// TODO: is this the proper way to handle viewzones?\n\t\t\tconst previousViewZones = [...this._activeViewZones];\n\t\t\tthis._activeViewZones = [];\n\n\t\t\tconst reducedLinesCount = (range.endLineNumberExclusive - range.startLineNumber) - uiState.newTextLineCount;\n\t\t\tthis.previewEditor.changeViewZones((changeAccessor) => {\n\t\t\t\tpreviousViewZones.forEach(id => changeAccessor.removeZone(id));\n\n\t\t\t\tif (reducedLinesCount > 0) {\n\t\t\t\t\tthis._activeViewZones.push(changeAccessor.addZone({\n\t\t\t\t\t\tafterLineNumber: range.startLineNumber + uiState.newTextLineCount - 1,\n\t\t\t\t\t\theightInLines: reducedLinesCount,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tdomNode: $('div.diagonal-fill.inline-edits-view-zone'),\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis._previewEditorWidth = derived(this, reader => {\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit) { return 0; }\n\t\t\tthis._updatePreviewEditor.read(reader);\n\n\t\t\treturn maxContentWidthInRange(this._previewEditorObs, edit.modifiedLineRange, reader);\n\t\t});\n\t\tthis._cursorPosIfTouchesEdit = derived(this, reader => {\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tconst edit = this._edit.read(reader);\n\t\t\tif (!edit || !cursorPos) { return undefined; }\n\t\t\treturn edit.modifiedLineRange.contains(cursorPos.lineNumber) ? cursorPos : undefined;\n\t\t});\n\t\tthis._originalStartPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.startLineNumber, 1) : null;\n\t\t});\n\t\tthis._originalEndPosition = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\treturn inlineEdit ? new Position(inlineEdit.originalLineRange.endLineNumberExclusive, 1) : null;\n\t\t});\n\t\tthis._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map(p => p?.y);\n\t\tthis._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map(p => p?.y);\n\t\tthis._originalDisplayRange = this._edit.map(e => e?.displayRange);\n\t\tthis._editorMaxContentWidthInRange = derived(this, reader => {\n\t\t\tconst originalDisplayRange = this._originalDisplayRange.read(reader);\n\t\t\tif (!originalDisplayRange) {\n\t\t\t\treturn constObservable(0);\n\t\t\t}\n\t\t\tthis._editorObs.versionId.read(reader);\n\n\t\t\t// Take the max value that we observed.\n\t\t\t// Reset when either the edit changes or the editor text version.\n\t\t\treturn derivedObservableWithCache<number>(this, (reader, lastValue) => {\n\t\t\t\tconst maxWidth = maxContentWidthInRange(this._editorObs, originalDisplayRange, reader);\n\t\t\t\treturn Math.max(maxWidth, lastValue ?? 0);\n\t\t\t});\n\t\t}).map((v, r) => v.read(r));\n\n\t\tconst editorDomContentRect = observeEditorBoundingClientRect(this._editor, this._store);\n\n\t\tthis._previewEditorLayoutInfo = derived(this, (reader) => {\n\t\t\tconst inlineEdit = this._edit.read(reader);\n\t\t\tif (!inlineEdit) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst state = this._uiState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst range = inlineEdit.originalLineRange;\n\n\t\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\n\t\t\tconst editorContentMaxWidthInRange = this._editorMaxContentWidthInRange.read(reader);\n\t\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst previewContentWidth = this._previewEditorWidth.read(reader);\n\t\t\tconst editorContentAreaWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\t\tconst editorBoundingClientRect = editorDomContentRect.read(reader);\n\t\t\tconst clientContentAreaRight = editorLayout.contentLeft + editorLayout.contentWidth + editorBoundingClientRect.left;\n\t\t\tconst remainingWidthRightOfContent = getWindow(this._editor.getContainerDomNode()).innerWidth - clientContentAreaRight;\n\t\t\tconst remainingWidthRightOfEditor = getWindow(this._editor.getContainerDomNode()).innerWidth - editorBoundingClientRect.right;\n\t\t\tconst desiredMinimumWidth = Math.min(editorLayout.contentWidth * 0.3, previewContentWidth, 100);\n\t\t\tconst IN_EDITOR_DISPLACEMENT = 0;\n\t\t\tconst maximumAvailableWidth = IN_EDITOR_DISPLACEMENT + remainingWidthRightOfContent;\n\n\t\t\tconst cursorPos = this._cursorPosIfTouchesEdit.read(reader);\n\n\t\t\tconst maxPreviewEditorLeft = Math.max(\n\t\t\t\t// We're starting from the content area right and moving it left by IN_EDITOR_DISPLACEMENT and also by an amount to ensure some minimum desired width\n\t\t\t\teditorContentAreaWidth + horizontalScrollOffset - IN_EDITOR_DISPLACEMENT - Math.max(0, desiredMinimumWidth - maximumAvailableWidth),\n\t\t\t\t// But we don't want that the moving left ends up covering the cursor, so this will push it to the right again\n\t\t\t\tMath.min(\n\t\t\t\t\tcursorPos ? getOffsetForPos(this._editorObs, cursorPos, reader) + 50 : 0,\n\t\t\t\t\teditorContentAreaWidth + horizontalScrollOffset\n\t\t\t\t)\n\t\t\t);\n\t\t\tconst previewEditorLeftInTextArea = Math.min(editorContentMaxWidthInRange + ORIGINAL_END_PADDING, maxPreviewEditorLeft);\n\n\t\t\tconst maxContentWidth = editorContentMaxWidthInRange + ORIGINAL_END_PADDING + previewContentWidth + 70;\n\n\t\t\tconst dist = maxPreviewEditorLeft - previewEditorLeftInTextArea;\n\n\t\t\tlet desiredPreviewEditorScrollLeft;\n\t\t\tlet codeRight;\n\t\t\tif (previewEditorLeftInTextArea > horizontalScrollOffset) {\n\t\t\t\tdesiredPreviewEditorScrollLeft = 0;\n\t\t\t\tcodeRight = editorLayout.contentLeft + previewEditorLeftInTextArea - horizontalScrollOffset;\n\t\t\t} else {\n\t\t\t\tdesiredPreviewEditorScrollLeft = horizontalScrollOffset - previewEditorLeftInTextArea;\n\t\t\t\tcodeRight = editorLayout.contentLeft;\n\t\t\t}\n\n\t\t\tconst selectionTop = this._originalVerticalStartPosition.read(reader) ?? this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tconst selectionBottom = this._originalVerticalEndPosition.read(reader) ?? this._editor.getBottomForLineNumber(range.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(reader);\n\n\t\t\t// TODO: const { prefixLeftOffset } = getPrefixTrim(inlineEdit.edit.edits.map(e => e.range), inlineEdit.originalLineRange, [], this._editor);\n\t\t\tconst codeLeft = editorLayout.contentLeft - horizontalScrollOffset;\n\n\t\t\tlet codeRect = Rect.fromLeftTopRightBottom(codeLeft, selectionTop, codeRight, selectionBottom);\n\t\t\tconst isInsertion = codeRect.height === 0;\n\t\t\tif (!isInsertion) {\n\t\t\t\tcodeRect = codeRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING);\n\t\t\t}\n\n\t\t\tconst previewLineHeights = this._previewEditorObs.observeLineHeightsForLineRange(inlineEdit.modifiedLineRange).read(reader);\n\t\t\tconst editHeight = previewLineHeights.reduce((acc, h) => acc + h, 0);\n\t\t\tconst codeHeight = selectionBottom - selectionTop;\n\t\t\tconst previewEditorHeight = Math.max(codeHeight, editHeight);\n\n\t\t\tconst clipped = dist === 0;\n\t\t\tconst codeEditDist = 0;\n\t\t\tconst previewEditorWidth = Math.min(previewContentWidth + MODIFIED_END_PADDING, remainingWidthRightOfEditor + editorLayout.width - editorLayout.contentLeft - codeEditDist);\n\n\t\t\tlet editRect = Rect.fromLeftTopWidthHeight(codeRect.right + codeEditDist, selectionTop, previewEditorWidth, previewEditorHeight);\n\t\t\tif (!isInsertion) {\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateX(HORIZONTAL_PADDING + BORDER_WIDTH);\n\t\t\t} else {\n\t\t\t\t// Align top of edit with insertion line\n\t\t\t\teditRect = editRect.withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING).translateY(VERTICAL_PADDING);\n\t\t\t}\n\n\t\t\t// debugView(debugLogRects({ codeRect, editRect }, this._editor.getDomNode()!), reader);\n\n\t\t\treturn {\n\t\t\t\tcodeRect,\n\t\t\t\teditRect,\n\t\t\t\tcodeScrollLeft: horizontalScrollOffset,\n\t\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\t\tisInsertion,\n\t\t\t\tmaxContentWidth,\n\t\t\t\tshouldShowShadow: clipped,\n\t\t\t\tdesiredPreviewEditorScrollLeft,\n\t\t\t\tpreviewEditorWidth,\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController ? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight) : constObservable(0);\n\t\tthis._shouldOverflow = derived(this, reader => {\n\t\t\tif (!ENABLE_OVERFLOW) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst range = this._edit.read(reader)?.originalLineRange;\n\t\t\tif (!range) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst stickyScrollHeight = this._stickyScrollHeight.read(reader);\n\t\t\tconst top = this._editor.getTopForLineNumber(range.startLineNumber) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (top <= stickyScrollHeight) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst bottom = this._editor.getTopForLineNumber(range.endLineNumberExclusive) - this._editorObs.scrollTop.read(reader);\n\t\t\tif (bottom >= this._editorObs.layoutInfo.read(reader).height) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tthis._originalBackgroundColor = observableFromEvent(this, this._themeService.onDidColorThemeChange, () => {\n\t\t\treturn this._themeService.getColorTheme().getColor(originalBackgroundColor) ?? Color.transparent;\n\t\t});\n\t\tthis._editorBackgroundColor = this._uiState.map(s => {\n\t\t\treturn getEditorBackgroundColor(s?.editorType ?? InlineCompletionEditorType.TextEditor);\n\t\t});\n\t\tthis._backgroundSvg = n.svg({\n\t\t\ttransform: 'translate(-0.5 -0.5)',\n\t\t\tstyle: { overflow: 'visible', pointerEvents: 'none', position: 'absolute' },\n\t\t}, [\n\t\t\tn.svgElem('path', {\n\t\t\t\tclass: 'rightOfModifiedBackgroundCoverUp',\n\t\t\t\td: derived(this, reader => {\n\t\t\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\t\t\tif (!layoutInfo) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tconst originalBackgroundColor = this._originalBackgroundColor.read(reader);\n\t\t\t\t\tif (originalBackgroundColor.isTransparent()) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new PathBuilder()\n\t\t\t\t\t\t.moveTo(layoutInfo.codeRect.getRightTop())\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightTop().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom().deltaX(1000))\n\t\t\t\t\t\t.lineTo(layoutInfo.codeRect.getRightBottom())\n\t\t\t\t\t\t.build();\n\t\t\t\t}),\n\t\t\t\tstyle: {\n\t\t\t\t\tfill: this._editorBackgroundColor,\n\t\t\t\t}\n\t\t\t}),\n\t\t]).keepUpdated(this._store);\n\t\tthis._originalOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', display: this._previewEditorLayoutInfo.map(layoutInfo => layoutInfo?.isInsertion ? 'none' : 'block') },\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst editorBackground = this._editorBackgroundColor.read(reader);\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderStyling = getOriginalBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${editorBackground}`;\n\n\t\t\tconst hasBorderLeft = layoutInfoObs.read(reader).codeScrollLeft !== 0;\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\t\t\tconst transitionRectSize = BORDER_RADIUS * 2 + BORDER_WIDTH * 2;\n\n\t\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t\t// such that there is a smooth transition at the edge of content left\n\t\t\tconst overlayHider = layoutInfoObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\t\tlayoutInfo.codeRect.top,\n\t\t\t\tlayoutInfo.contentLeft,\n\t\t\t\tlayoutInfo.codeRect.bottom + transitionRectSize\n\t\t\t)).read(reader);\n\n\t\t\tconst intersectionLine = new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER);\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.intersectHorizontal(intersectionLine));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, 0, separatorWidth, separatorWidth).intersectHorizontal(intersectionLine));\n\n\t\t\tconst transitionRect = overlayRect.map(overlayRect => Rect.fromLeftTopWidthHeight(overlayRect.right - transitionRectSize + BORDER_WIDTH, overlayRect.bottom - BORDER_WIDTH, transitionRectSize, transitionRectSize).intersectHorizontal(intersectionLine));\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStylingSeparator,\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tborderRadius: `${BORDER_RADIUS}px 0 0 ${BORDER_RADIUS}px`,\n\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\tborderBottom: borderStyling,\n\t\t\t\t\t\tborderLeft: hasBorderLeft ? 'none' : borderStyling,\n\t\t\t\t\t\tbackgroundColor: asCssVariable(originalBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t}),\n\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalCornerCutoutSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\tdisplay: isModifiedLower.map(isLower => isLower ? 'block' : 'none'),\n\t\t\t\t\t\t...transitionRect.read(reader).toStyles(),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBackground',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tbackgroundColor: getEditorBlendedColor(originalBackgroundColor, this._themeService).map(c => c.toString()),\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'originalCornerCutoutBorder',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tposition: 'absolute', top: '0px', left: '0px', width: '100%', height: '100%',\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\tborderTop: borderStyling,\n\t\t\t\t\t\t\tborderRight: borderStyling,\n\t\t\t\t\t\t\tborderRadius: `0 100% 0 0`,\n\t\t\t\t\t\t\tbackgroundColor: editorBackground\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'originalOverlaySideBySideHider',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\t\tbackgroundColor: editorBackground,\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._modifiedOverlay = n.div({\n\t\t\tstyle: { pointerEvents: 'none', }\n\t\t}, derived(this, reader => {\n\t\t\tconst layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader);\n\t\t\tif (!layoutInfoObs) { return undefined; }\n\n\t\t\tconst isModifiedLower = layoutInfoObs.map(layoutInfo => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom);\n\t\t\tconst editorBackground = this._editorBackgroundColor.read(reader);\n\n\t\t\tconst separatorWidth = separatorWidthObs.read(reader);\n\t\t\tconst borderRadius = isModifiedLower.map(isLower => `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px ${isLower ? BORDER_RADIUS : 0}px`);\n\t\t\tconst borderStyling = getEditorBlendedColor(getModifiedBorderColor(this._tabAction), this._themeService).map(c => `1px solid ${c.toString()}`);\n\t\t\tconst borderStylingSeparator = `${BORDER_WIDTH + separatorWidth}px solid ${editorBackground}`;\n\n\t\t\tconst overlayRect = layoutInfoObs.map(layoutInfo => layoutInfo.editRect.withMargin(0, BORDER_WIDTH));\n\t\t\tconst separatorRect = overlayRect.map(overlayRect => overlayRect.withMargin(separatorWidth, separatorWidth, separatorWidth, 0));\n\n\t\t\tconst insertionRect = derived(this, reader => {\n\t\t\t\tconst overlay = overlayRect.read(reader);\n\t\t\t\tconst layoutinfo = layoutInfoObs.read(reader);\n\t\t\t\tif (!layoutinfo.isInsertion || layoutinfo.contentLeft >= overlay.left) {\n\t\t\t\t\treturn Rect.fromLeftTopWidthHeight(overlay.left, overlay.top, 0, 0);\n\t\t\t\t}\n\t\t\t\treturn new Rect(layoutinfo.contentLeft, overlay.top, overlay.left, overlay.top + BORDER_WIDTH * 2);\n\t\t\t});\n\n\t\t\treturn [\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedInsertionSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...insertionRect.read(reader).toStyles(),\n\t\t\t\t\t\tbackgroundColor: getModifiedBorderColor(this._tabAction).map(c => asCssVariable(c)),\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedSeparatorSideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...separatorRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborderTop: borderStylingSeparator,\n\t\t\t\t\t\tborderBottom: borderStylingSeparator,\n\t\t\t\t\t\tborderRight: borderStylingSeparator,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tn.div({\n\t\t\t\t\tclass: 'modifiedOverlaySideBySide',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\tborder: borderStyling,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t})).keepUpdated(this._store);\n\t\tthis._nonOverflowView = n.div({\n\t\t\tclass: 'inline-edits-view',\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t\ttop: '0px',\n\t\t\t\tleft: '0px',\n\t\t\t\tdisplay: this._display,\n\t\t\t},\n\t\t}, [\n\t\t\tthis._backgroundSvg,\n\t\t\tderived(this, reader => this._shouldOverflow.read(reader) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay]),\n\t\t]).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._nonOverflowView.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst x = this._previewEditorLayoutInfo.read(reader)?.maxContentWidth;\n\t\t\t\tif (x === undefined) { return 0; }\n\t\t\t\treturn x;\n\t\t\t}),\n\t\t}));\n\n\t\tthis.previewEditor.setModel(this._previewTextModel);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst editorRect = layoutInfo.editRect.withMargin(-VERTICAL_PADDING, -HORIZONTAL_PADDING);\n\n\t\t\tthis.previewEditor.layout({ height: editorRect.height, width: layoutInfo.previewEditorWidth + 15 /* Make sure editor does not scroll horizontally */ });\n\t\t\tthis._editorContainer.element.style.top = `${editorRect.top}px`;\n\t\t\tthis._editorContainer.element.style.left = `${editorRect.left}px`;\n\t\t\tthis._editorContainer.element.style.width = `${layoutInfo.previewEditorWidth + HORIZONTAL_PADDING}px`; // Set width to clip view zone\n\t\t\t//this._editorContainer.element.style.borderRadius = `0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px 0`;\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._previewEditorObs.editor.setScrollLeft(layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _display;\n\n\tprivate readonly previewRef;\n\n\tprivate readonly _editorContainer;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly previewEditor;\n\n\tprivate readonly _previewEditorObs;\n\n\tprivate _activeViewZones: string[];\n\tprivate readonly _updatePreviewEditor;\n\n\tprivate readonly _previewEditorWidth;\n\n\tprivate readonly _cursorPosIfTouchesEdit;\n\n\tprivate readonly _originalStartPosition;\n\n\tprivate readonly _originalEndPosition;\n\n\tprivate readonly _originalVerticalStartPosition;\n\tprivate readonly _originalVerticalEndPosition;\n\n\tprivate readonly _originalDisplayRange;\n\tprivate readonly _editorMaxContentWidthInRange;\n\n\tprivate readonly _previewEditorLayoutInfo;\n\n\tprivate _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _shouldOverflow;\n\n\tprivate readonly _originalBackgroundColor;\n\n\tprivate readonly _editorBackgroundColor;\n\n\tprivate readonly _backgroundSvg;\n\n\tprivate readonly _originalOverlay;\n\n\tprivate readonly _modifiedOverlay;\n\n\tprivate readonly _nonOverflowView;\n}\n"]}
@@ -21,7 +21,7 @@ import { OS } from '../../../../../../../base/common/platform.js';
21
21
  import { localize } from '../../../../../../../nls.js';
22
22
  import { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';
23
23
  import { IKeybindingService } from '../../../../../../../platform/keybinding/common/keybinding.js';
24
- import { editorBackground, editorHoverForeground } from '../../../../../../../platform/theme/common/colorRegistry.js';
24
+ import { editorHoverForeground } from '../../../../../../../platform/theme/common/colorRegistry.js';
25
25
  import { contrastBorder } from '../../../../../../../platform/theme/common/colors/baseColors.js';
26
26
  import { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';
27
27
  import { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';
@@ -34,11 +34,12 @@ import { ILanguageService } from '../../../../../../common/languages/language.js
34
34
  import { LineTokens, TokenArray } from '../../../../../../common/tokens/lineTokens.js';
35
35
  import { inlineSuggestCommitAlternativeActionId } from '../../../controller/commandIds.js';
36
36
  import { InlineEditClickEvent } from '../inlineEditsViewInterface.js';
37
- import { getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, modifiedChangedTextOverlayColor, observeColor, originalChangedTextOverlayColor } from '../theme.js';
37
+ import { getEditorBackgroundColor, getModifiedBorderColor, getOriginalBorderColor, INLINE_EDITS_BORDER_RADIUS, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, modifiedChangedTextOverlayColor, observeColor, originalChangedTextOverlayColor } from '../theme.js';
38
38
  import { getEditorValidOverlayRect, mapOutFalsy, rectToProps } from '../utils/utils.js';
39
39
  export class WordReplacementsViewData {
40
- constructor(edit, alternativeAction) {
40
+ constructor(edit, editorType, alternativeAction) {
41
41
  this.edit = edit;
42
+ this.editorType = editorType;
42
43
  this.alternativeAction = alternativeAction;
43
44
  }
44
45
  equals(other) {
@@ -175,10 +176,11 @@ let InlineEditsWordReplacementView = class InlineEditsWordReplacementView extend
175
176
  };
176
177
  const passiveStyles = {
177
178
  borderColor: hcBorderColor ? hcBorderColor.toString() : observeColor(editorHoverForeground, this._themeService).map(c => c.transparent(0.2).toString()).read(reader),
178
- backgroundColor: asCssVariable(editorBackground),
179
+ backgroundColor: getEditorBackgroundColor(this._viewData.editorType),
179
180
  color: '',
180
181
  opacity: '0.7',
181
182
  };
183
+ const editorBackground = getEditorBackgroundColor(this._viewData.editorType);
182
184
  const primaryActionStyles = derived(this, r => alternativeActionActive.read(r) ? primaryActiveStyles : primaryActiveStyles);
183
185
  const secondaryActionStyles = derived(this, r => alternativeActionActive.read(r) ? secondaryActiveStyles : passiveStyles);
184
186
  // TODO@benibenj clicking the arrow does not accept suggestion anymore
@@ -196,7 +198,7 @@ let InlineEditsWordReplacementView = class InlineEditsWordReplacementView extend
196
198
  style: {
197
199
  position: 'absolute',
198
200
  ...rectToProps(reader => layout.read(reader).lowerBackground.withMargin(BORDER_WIDTH, 2 * BORDER_WIDTH, BORDER_WIDTH, 0)),
199
- background: asCssVariable(editorBackground),
201
+ background: editorBackground,
200
202
  cursor: 'pointer',
201
203
  pointerEvents: 'auto',
202
204
  },
@@ -211,10 +213,10 @@ let InlineEditsWordReplacementView = class InlineEditsWordReplacementView extend
211
213
  pointerEvents: 'auto',
212
214
  boxSizing: 'border-box',
213
215
  borderRadius: `${INLINE_EDITS_BORDER_RADIUS}px`,
214
- background: asCssVariable(editorBackground),
216
+ background: editorBackground,
215
217
  display: 'flex',
216
218
  justifyContent: 'left',
217
- outline: `2px solid ${asCssVariable(editorBackground)}`,
219
+ outline: `2px solid ${editorBackground}`,
218
220
  },
219
221
  onmousedown: (e) => this._mouseDown(e),
220
222
  }, [