monaco-editor-core 0.55.1 → 0.56.0-dev-20251121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +27 -8
- package/esm/vs/base/browser/dom.js +31 -34
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +0 -1
- package/esm/vs/base/browser/keyboardEvent.js +3 -3
- package/esm/vs/base/browser/keyboardEvent.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +5 -2
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/pixelRatio.js +5 -5
- package/esm/vs/base/browser/pixelRatio.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js +1 -1
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.js +3 -0
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +7 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hoverWidget.css +0 -13
- package/esm/vs/base/browser/ui/inputbox/inputBox.js +7 -0
- package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
- package/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +4 -2
- package/esm/vs/base/browser/ui/list/listView.js +7 -2
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.js +4 -0
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css +12 -32
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +8 -18
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +41 -14
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +11 -0
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +1 -0
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
- package/esm/vs/base/common/arrays.js +10 -0
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/async.js +34 -0
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/buffer.js +1 -1
- package/esm/vs/base/common/buffer.js.map +1 -1
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +3 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/collections.js.map +1 -1
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +32 -15
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/filters.js +22 -3
- package/esm/vs/base/common/filters.js.map +1 -1
- package/esm/vs/base/common/hotReload.js +2 -2
- package/esm/vs/base/common/hotReload.js.map +1 -1
- package/esm/vs/base/common/iterator.js +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keyCodes.js +7 -6
- package/esm/vs/base/common/keyCodes.js.map +1 -1
- package/esm/vs/base/common/linkedList.js.map +1 -1
- package/esm/vs/base/common/map.js.map +1 -1
- package/esm/vs/base/common/marked/marked.js +0 -1
- package/esm/vs/base/common/network.js +26 -1
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/normalization.js +19 -6
- package/esm/vs/base/common/normalization.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugLocation.js +1 -2
- package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugName.js +0 -1
- package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +4 -4
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +38 -10
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js +3 -3
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +46 -5
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/path.js +1 -0
- package/esm/vs/base/common/path.js.map +1 -1
- package/esm/vs/base/common/strings.js +27 -19
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/config/elementSizeObserver.js +5 -5
- package/esm/vs/editor/browser/config/elementSizeObserver.js.map +1 -1
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/config/migrateOptions.js +6 -0
- package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
- package/esm/vs/editor/browser/config/tabFocus.js +4 -2
- package/esm/vs/editor/browser/config/tabFocus.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -0
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js +1 -2
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -1
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/contribution.js +9 -0
- package/esm/vs/editor/browser/services/contribution.js.map +1 -0
- package/esm/vs/editor/browser/services/editorWorkerService.js +27 -14
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +5 -1
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/renderingContext.js +1 -1
- package/esm/vs/editor/browser/view/renderingContext.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +10 -3
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +3 -4
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +1 -1
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +4 -2
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +1 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js +2 -1
- package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +6 -18
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +0 -7
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +7 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js.map +1 -1
- package/esm/vs/editor/common/commands/replaceCommand.js +2 -2
- package/esm/vs/editor/common/commands/replaceCommand.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +374 -360
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/2d/rect.js +7 -0
- package/esm/vs/editor/common/core/2d/rect.js.map +1 -1
- package/esm/vs/editor/common/core/2d/size.js +20 -0
- package/esm/vs/editor/common/core/2d/size.js.map +1 -0
- package/esm/vs/editor/common/core/editorColorRegistry.js +69 -68
- package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
- package/esm/vs/editor/common/core/ranges/offsetRange.js +9 -0
- package/esm/vs/editor/common/core/ranges/offsetRange.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/services/languagesAssociations.js +6 -8
- package/esm/vs/editor/common/services/languagesAssociations.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -10
- package/esm/vs/editor/common/standaloneStrings.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +1 -1
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelens.js.map +1 -1
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +14 -0
- package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/format.js +21 -6
- package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +5 -10
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +11 -6
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverUtils.js +24 -0
- package/esm/vs/editor/contrib/hover/browser/hoverUtils.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +18 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +42 -37
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +54 -43
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +74 -48
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +8 -36
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +10 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +105 -119
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +8 -36
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js +95 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +17 -9
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +415 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +253 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js +103 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js +32 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +44 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +181 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -0
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -31
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +2 -2
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +18 -13
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +12 -12
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +29 -29
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +4 -4
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/editor/editor.all.js +1 -0
- package/esm/vs/editor/editor.all.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +9 -5
- package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js +22 -2
- package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +39 -0
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -0
- package/esm/vs/editor/standalone/browser/standaloneEditor.js +2 -1
- package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +3 -21
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js +4 -4
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +7 -9
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +2 -0
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configuration.js +5 -4
- package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +21 -10
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +3 -3
- package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +11 -32
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +9 -3
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +35 -14
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +4 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +71 -40
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +21 -8
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/telemetry/common/gdprTypings.js.map +1 -1
- package/esm/vs/platform/telemetry/common/telemetry.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/editorColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js +12 -0
- package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js.map +1 -0
- package/esm/vs/platform/webWorker/browser/webWorkerService.js +7 -0
- package/esm/vs/platform/webWorker/browser/webWorkerService.js.map +1 -0
- package/esm/vs/{base/browser/webWorkerFactory.js → platform/webWorker/browser/webWorkerServiceImpl.js} +47 -66
- package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js.map +1 -0
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +9 -5
- package/package.json +2 -2
- package/esm/vs/base/browser/webWorkerFactory.js.map +0 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +0 -82
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js.map +0 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
};
|
|
10
|
+
/*---------------------------------------------------------------------------------------------
|
|
11
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
13
|
+
*--------------------------------------------------------------------------------------------*/
|
|
14
|
+
import { n } from '../../../../../../../../base/browser/dom.js';
|
|
15
|
+
import { Event } from '../../../../../../../../base/common/event.js';
|
|
16
|
+
import { Disposable } from '../../../../../../../../base/common/lifecycle.js';
|
|
17
|
+
import { autorun, constObservable, debouncedObservable2, derived, derivedDisposable } from '../../../../../../../../base/common/observable.js';
|
|
18
|
+
import { IInstantiationService } from '../../../../../../../../platform/instantiation/common/instantiation.js';
|
|
19
|
+
import { observableCodeEditor } from '../../../../../../../browser/observableCodeEditor.js';
|
|
20
|
+
import { Rect } from '../../../../../../../common/core/2d/rect.js';
|
|
21
|
+
import { Position } from '../../../../../../../common/core/position.js';
|
|
22
|
+
import { InlineEditTabAction } from '../../inlineEditsViewInterface.js';
|
|
23
|
+
import { getContentSizeOfLines, rectToProps } from '../../utils/utils.js';
|
|
24
|
+
import { OffsetRange } from '../../../../../../../common/core/ranges/offsetRange.js';
|
|
25
|
+
import { LineRange } from '../../../../../../../common/core/ranges/lineRange.js';
|
|
26
|
+
import { HideUnchangedRegionsFeature } from '../../../../../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js';
|
|
27
|
+
import { Codicon } from '../../../../../../../../base/common/codicons.js';
|
|
28
|
+
import { renderIcon } from '../../../../../../../../base/browser/ui/iconLabel/iconLabels.js';
|
|
29
|
+
import { SymbolKinds } from '../../../../../../../common/languages.js';
|
|
30
|
+
import { debugLogRects, debugView } from '../debugVisualization.js';
|
|
31
|
+
import { distributeFlexBoxLayout } from '../../utils/flexBoxLayout.js';
|
|
32
|
+
import { Point } from '../../../../../../../common/core/2d/point.js';
|
|
33
|
+
import { Size2D } from '../../../../../../../common/core/2d/size.js';
|
|
34
|
+
import { getMaxTowerHeightInAvailableArea } from '../../utils/towersLayout.js';
|
|
35
|
+
import { IThemeService } from '../../../../../../../../platform/theme/common/themeService.js';
|
|
36
|
+
import { getEditorBlendedColor, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorsuccessfulBackground } from '../../theme.js';
|
|
37
|
+
import { asCssVariable, descriptionForeground, editorBackground } from '../../../../../../../../platform/theme/common/colorRegistry.js';
|
|
38
|
+
import { LongDistancePreviewEditor } from './longDistancePreviewEditor.js';
|
|
39
|
+
const BORDER_RADIUS = 4;
|
|
40
|
+
const MAX_WIDGET_WIDTH = 400;
|
|
41
|
+
const MIN_WIDGET_WIDTH = 200;
|
|
42
|
+
let InlineEditsLongDistanceHint = class InlineEditsLongDistanceHint extends Disposable {
|
|
43
|
+
constructor(_editor, _viewState, _previewTextModel, _tabAction, _instantiationService, _themeService) {
|
|
44
|
+
super();
|
|
45
|
+
this._editor = _editor;
|
|
46
|
+
this._viewState = _viewState;
|
|
47
|
+
this._previewTextModel = _previewTextModel;
|
|
48
|
+
this._tabAction = _tabAction;
|
|
49
|
+
this._instantiationService = _instantiationService;
|
|
50
|
+
this._themeService = _themeService;
|
|
51
|
+
this.onDidClick = Event.None;
|
|
52
|
+
this._viewWithElement = undefined;
|
|
53
|
+
this._hintTextPosition = derived(this, (reader) => {
|
|
54
|
+
const viewState = this._viewState.read(reader);
|
|
55
|
+
return viewState ? new Position(viewState.hint.lineNumber, Number.MAX_SAFE_INTEGER) : null;
|
|
56
|
+
});
|
|
57
|
+
this._lineSizesAroundHintPosition = derived(this, (reader) => {
|
|
58
|
+
const viewState = this._viewState.read(reader);
|
|
59
|
+
const p = this._hintTextPosition.read(reader);
|
|
60
|
+
if (!viewState || !p) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const model = this._editorObs.model.read(reader);
|
|
64
|
+
if (!model) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const range = LineRange.ofLength(p.lineNumber, 1).addMargin(5, 5).intersect(LineRange.ofLength(1, model.getLineCount()));
|
|
68
|
+
if (!range) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const sizes = getContentSizeOfLines(this._editorObs, range, reader);
|
|
72
|
+
const top = this._editorObs.observeTopForLineNumber(range.startLineNumber).read(reader);
|
|
73
|
+
return {
|
|
74
|
+
lineRange: range,
|
|
75
|
+
top: top,
|
|
76
|
+
sizes: sizes,
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
this._isVisibleDelayed = debouncedObservable2(derived(this, reader => this._viewState.read(reader)?.hint.isVisible), (lastValue, newValue) => lastValue === true && newValue === false ? 200 : 0);
|
|
80
|
+
this._previewEditorLayoutInfo = derived(this, (reader) => {
|
|
81
|
+
const viewState = this._viewState.read(reader);
|
|
82
|
+
if (!viewState || !this._isVisibleDelayed.read(reader)) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
const lineSizes = this._lineSizesAroundHintPosition.read(reader);
|
|
86
|
+
if (!lineSizes) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
const editorScrollTop = this._editorObs.scrollTop.read(reader);
|
|
90
|
+
const editorScrollLeft = this._editorObs.scrollLeft.read(reader);
|
|
91
|
+
const editorLayout = this._editorObs.layoutInfo.read(reader);
|
|
92
|
+
const previewContentHeight = this._previewEditor.contentHeight.read(reader);
|
|
93
|
+
const previewEditorContentLayout = this._previewEditor.horizontalContentRangeInPreviewEditorToShow.read(reader);
|
|
94
|
+
if (!previewContentHeight || !previewEditorContentLayout) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
// const debugRects = stackSizesDown(new Point(editorLayout.contentLeft, lineSizes.top - scrollTop), lineSizes.sizes);
|
|
98
|
+
const editorTrueContentWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;
|
|
99
|
+
const editorTrueContentRight = editorLayout.contentLeft + editorTrueContentWidth;
|
|
100
|
+
// drawEditorWidths(this._editor, reader);
|
|
101
|
+
const c = this._editorObs.cursorLineNumber.read(reader);
|
|
102
|
+
if (!c) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
const availableSpaceSizes = lineSizes.sizes.map((s, idx) => {
|
|
106
|
+
const lineNumber = lineSizes.lineRange.startLineNumber + idx;
|
|
107
|
+
let linePaddingLeft = 20;
|
|
108
|
+
if (lineNumber === viewState.hint.lineNumber) {
|
|
109
|
+
linePaddingLeft = 100;
|
|
110
|
+
}
|
|
111
|
+
return new Size2D(Math.max(0, editorTrueContentWidth - s.width - linePaddingLeft), s.height);
|
|
112
|
+
});
|
|
113
|
+
const showRects = false;
|
|
114
|
+
if (showRects) {
|
|
115
|
+
const rects2 = stackSizesDown(new Point(editorTrueContentRight, lineSizes.top - editorScrollTop), availableSpaceSizes, 'right');
|
|
116
|
+
debugView(debugLogRects({ ...rects2 }, this._editor.getDomNode()), reader);
|
|
117
|
+
}
|
|
118
|
+
const availableSpaceHeightPrefixSums = getSums(availableSpaceSizes, s => s.height);
|
|
119
|
+
const availableSpaceSizesTransposed = availableSpaceSizes.map(s => s.transpose());
|
|
120
|
+
const previewEditorMargin = 2;
|
|
121
|
+
const widgetPadding = 2;
|
|
122
|
+
const lowerBarHeight = 20;
|
|
123
|
+
const widgetBorder = 1;
|
|
124
|
+
const extraGutterMarginToAvoidScrollBar = 2;
|
|
125
|
+
const previewEditorHeight = previewContentHeight + extraGutterMarginToAvoidScrollBar;
|
|
126
|
+
function getWidgetVerticalOutline(lineNumber) {
|
|
127
|
+
const sizeIdx = lineNumber - lineSizes.lineRange.startLineNumber;
|
|
128
|
+
const top = lineSizes.top + availableSpaceHeightPrefixSums[sizeIdx];
|
|
129
|
+
const editorRange = OffsetRange.ofStartAndLength(top, previewEditorHeight);
|
|
130
|
+
const verticalWidgetRange = editorRange.withMargin(previewEditorMargin + widgetPadding + widgetBorder).withMargin(0, lowerBarHeight);
|
|
131
|
+
return verticalWidgetRange;
|
|
132
|
+
}
|
|
133
|
+
let possibleWidgetOutline = findFirstMinimzeDistance(lineSizes.lineRange.addMargin(-1, -1), viewState.hint.lineNumber, lineNumber => {
|
|
134
|
+
const verticalWidgetRange = getWidgetVerticalOutline(lineNumber);
|
|
135
|
+
const maxWidth = getMaxTowerHeightInAvailableArea(verticalWidgetRange.delta(-lineSizes.top), availableSpaceSizesTransposed);
|
|
136
|
+
if (maxWidth < MIN_WIDGET_WIDTH) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
const horizontalWidgetRange = OffsetRange.ofStartAndLength(editorTrueContentRight - maxWidth, maxWidth);
|
|
140
|
+
return { horizontalWidgetRange, verticalWidgetRange };
|
|
141
|
+
});
|
|
142
|
+
if (!possibleWidgetOutline) {
|
|
143
|
+
possibleWidgetOutline = {
|
|
144
|
+
horizontalWidgetRange: OffsetRange.ofStartAndLength(editorTrueContentRight - MAX_WIDGET_WIDTH, MAX_WIDGET_WIDTH),
|
|
145
|
+
verticalWidgetRange: getWidgetVerticalOutline(viewState.hint.lineNumber + 2).delta(10),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (!possibleWidgetOutline) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
const rectAvailableSpace = Rect.fromRanges(possibleWidgetOutline.horizontalWidgetRange, possibleWidgetOutline.verticalWidgetRange).translateX(-editorScrollLeft).translateY(-editorScrollTop);
|
|
152
|
+
const showAvailableSpace = false;
|
|
153
|
+
if (showAvailableSpace) {
|
|
154
|
+
debugView(debugLogRects({ rectAvailableSpace }, this._editor.getDomNode()), reader);
|
|
155
|
+
}
|
|
156
|
+
const maxWidgetWidth = Math.min(MAX_WIDGET_WIDTH, previewEditorContentLayout.maxEditorWidth + previewEditorMargin + widgetPadding);
|
|
157
|
+
const layout = distributeFlexBoxLayout(rectAvailableSpace.width, {
|
|
158
|
+
spaceBefore: { min: 0, max: 10, priority: 1 },
|
|
159
|
+
content: { min: 50, rules: [{ max: 150, priority: 2 }, { max: maxWidgetWidth, priority: 1 }] },
|
|
160
|
+
spaceAfter: { min: 20 },
|
|
161
|
+
});
|
|
162
|
+
if (!layout) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
const ranges = lengthsToOffsetRanges([layout.spaceBefore, layout.content, layout.spaceAfter], rectAvailableSpace.left);
|
|
166
|
+
const spaceBeforeRect = rectAvailableSpace.withHorizontalRange(ranges[0]);
|
|
167
|
+
const widgetRect = rectAvailableSpace.withHorizontalRange(ranges[1]);
|
|
168
|
+
const spaceAfterRect = rectAvailableSpace.withHorizontalRange(ranges[2]);
|
|
169
|
+
const showRects2 = false;
|
|
170
|
+
if (showRects2) {
|
|
171
|
+
debugView(debugLogRects({ spaceBeforeRect, widgetRect, spaceAfterRect }, this._editor.getDomNode()), reader);
|
|
172
|
+
}
|
|
173
|
+
const previewEditorRect = widgetRect.withMargin(-widgetPadding - widgetBorder - previewEditorMargin).withMargin(0, 0, -lowerBarHeight, 0);
|
|
174
|
+
const showEditorRect = false;
|
|
175
|
+
if (showEditorRect) {
|
|
176
|
+
debugView(debugLogRects({ previewEditorRect }, this._editor.getDomNode()), reader);
|
|
177
|
+
}
|
|
178
|
+
const previewEditorContentWidth = previewEditorRect.width - previewEditorContentLayout.nonContentWidth;
|
|
179
|
+
const maxPrefferedRangeLength = previewEditorContentWidth * 0.8;
|
|
180
|
+
const preferredRangeToReveal = previewEditorContentLayout.preferredRangeToReveal.intersect(OffsetRange.ofStartAndLength(previewEditorContentLayout.preferredRangeToReveal.start, maxPrefferedRangeLength)) ?? previewEditorContentLayout.preferredRangeToReveal;
|
|
181
|
+
const desiredPreviewEditorScrollLeft = scrollToReveal(previewEditorContentLayout.indentationEnd, previewEditorContentWidth, preferredRangeToReveal);
|
|
182
|
+
return {
|
|
183
|
+
codeEditorSize: previewEditorRect.getSize(),
|
|
184
|
+
codeScrollLeft: editorScrollLeft,
|
|
185
|
+
contentLeft: editorLayout.contentLeft,
|
|
186
|
+
widgetRect,
|
|
187
|
+
previewEditorMargin,
|
|
188
|
+
widgetPadding,
|
|
189
|
+
widgetBorder,
|
|
190
|
+
lowerBarHeight,
|
|
191
|
+
desiredPreviewEditorScrollLeft: desiredPreviewEditorScrollLeft.newScrollPosition,
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
this._view = n.div({
|
|
195
|
+
class: 'inline-edits-view',
|
|
196
|
+
style: {
|
|
197
|
+
position: 'absolute',
|
|
198
|
+
overflow: 'visible',
|
|
199
|
+
top: '0px',
|
|
200
|
+
left: '0px',
|
|
201
|
+
display: derived(this, reader => !!this._previewEditorLayoutInfo.read(reader) ? 'block' : 'none'),
|
|
202
|
+
},
|
|
203
|
+
}, [
|
|
204
|
+
derived(this, _reader => [this._widgetContent]),
|
|
205
|
+
]);
|
|
206
|
+
this._widgetContent = derived(this, reader => // TODO how to not use derived but not move into constructor?
|
|
207
|
+
n.div({
|
|
208
|
+
style: {
|
|
209
|
+
position: 'absolute',
|
|
210
|
+
overflow: 'hidden',
|
|
211
|
+
cursor: 'pointer',
|
|
212
|
+
background: 'var(--vscode-editorWidget-background)',
|
|
213
|
+
padding: this._previewEditorLayoutInfo.map(i => i?.widgetPadding),
|
|
214
|
+
boxSizing: 'border-box',
|
|
215
|
+
borderRadius: BORDER_RADIUS,
|
|
216
|
+
border: derived(reader => `${this._previewEditorLayoutInfo.read(reader)?.widgetBorder}px solid ${this._styles.read(reader).border}`),
|
|
217
|
+
display: 'flex',
|
|
218
|
+
flexDirection: 'column',
|
|
219
|
+
opacity: derived(reader => this._viewState.read(reader)?.hint.isVisible ? '1' : '0'),
|
|
220
|
+
transition: 'opacity 200ms ease-in-out',
|
|
221
|
+
...rectToProps(reader => this._previewEditorLayoutInfo.read(reader)?.widgetRect)
|
|
222
|
+
},
|
|
223
|
+
onmousedown: e => {
|
|
224
|
+
e.preventDefault(); // This prevents that the editor loses focus
|
|
225
|
+
},
|
|
226
|
+
onclick: () => {
|
|
227
|
+
this._viewState.read(undefined)?.model.jump();
|
|
228
|
+
}
|
|
229
|
+
}, [
|
|
230
|
+
n.div({
|
|
231
|
+
class: ['editorContainer'],
|
|
232
|
+
style: {
|
|
233
|
+
overflow: 'hidden',
|
|
234
|
+
padding: this._previewEditorLayoutInfo.map(i => i?.previewEditorMargin),
|
|
235
|
+
background: 'var(--vscode-editor-background)',
|
|
236
|
+
pointerEvents: 'none',
|
|
237
|
+
},
|
|
238
|
+
}, [
|
|
239
|
+
derived(this, r => this._previewEditor.element), // --
|
|
240
|
+
]),
|
|
241
|
+
n.div({ class: 'bar', style: { color: asCssVariable(descriptionForeground), pointerEvents: 'none', margin: '0 4px', height: this._previewEditorLayoutInfo.map(i => i?.lowerBarHeight), display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, [
|
|
242
|
+
derived(this, reader => {
|
|
243
|
+
const children = [];
|
|
244
|
+
const viewState = this._viewState.read(reader);
|
|
245
|
+
if (!viewState) {
|
|
246
|
+
return children;
|
|
247
|
+
}
|
|
248
|
+
// Outline Element
|
|
249
|
+
const source = this._originalOutlineSource.read(reader);
|
|
250
|
+
const outlineItems = source?.getAt(viewState.edit.lineEdit.lineRange.startLineNumber, reader).slice(0, 1) ?? [];
|
|
251
|
+
const outlineElements = [];
|
|
252
|
+
if (outlineItems.length > 0) {
|
|
253
|
+
for (let i = 0; i < outlineItems.length; i++) {
|
|
254
|
+
const item = outlineItems[i];
|
|
255
|
+
const icon = SymbolKinds.toIcon(item.kind);
|
|
256
|
+
outlineElements.push(n.div({
|
|
257
|
+
class: 'breadcrumb-item',
|
|
258
|
+
style: { display: 'flex', alignItems: 'center', flex: '1 1 auto', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },
|
|
259
|
+
}, [
|
|
260
|
+
renderIcon(icon),
|
|
261
|
+
'\u00a0',
|
|
262
|
+
item.name,
|
|
263
|
+
...(i === outlineItems.length - 1
|
|
264
|
+
? []
|
|
265
|
+
: [renderIcon(Codicon.chevronRight)])
|
|
266
|
+
]));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
children.push(n.div({ class: 'outline-elements' }, outlineElements));
|
|
270
|
+
// Show Edit Direction
|
|
271
|
+
const arrowIcon = isEditBelowHint(viewState) ? Codicon.arrowDown : Codicon.arrowUp;
|
|
272
|
+
children.push(n.div({
|
|
273
|
+
class: 'go-to-label',
|
|
274
|
+
style: { display: 'flex', alignItems: 'center', flex: '0 0 auto', marginLeft: '14px' },
|
|
275
|
+
}, [
|
|
276
|
+
'Go To Edit',
|
|
277
|
+
'\u00a0',
|
|
278
|
+
renderIcon(arrowIcon),
|
|
279
|
+
]));
|
|
280
|
+
return children;
|
|
281
|
+
})
|
|
282
|
+
]),
|
|
283
|
+
]));
|
|
284
|
+
this._originalOutlineSource = derivedDisposable(this, (reader) => {
|
|
285
|
+
const m = this._editorObs.model.read(reader);
|
|
286
|
+
const factory = HideUnchangedRegionsFeature._breadcrumbsSourceFactory.read(reader);
|
|
287
|
+
return (!m || !factory) ? undefined : factory(m, this._instantiationService);
|
|
288
|
+
});
|
|
289
|
+
this._styles = this._tabAction.map((v, reader) => {
|
|
290
|
+
let border;
|
|
291
|
+
switch (v) {
|
|
292
|
+
case InlineEditTabAction.Inactive:
|
|
293
|
+
border = inlineEditIndicatorSecondaryBackground;
|
|
294
|
+
break;
|
|
295
|
+
case InlineEditTabAction.Jump:
|
|
296
|
+
border = inlineEditIndicatorPrimaryBackground;
|
|
297
|
+
break;
|
|
298
|
+
case InlineEditTabAction.Accept:
|
|
299
|
+
border = inlineEditIndicatorsuccessfulBackground;
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
border: getEditorBlendedColor(border, this._themeService).read(reader).toString(),
|
|
304
|
+
background: asCssVariable(editorBackground)
|
|
305
|
+
};
|
|
306
|
+
});
|
|
307
|
+
this._editorObs = observableCodeEditor(this._editor);
|
|
308
|
+
this._previewEditor = this._register(this._instantiationService.createInstance(LongDistancePreviewEditor, this._previewTextModel, derived(reader => {
|
|
309
|
+
const viewState = this._viewState.read(reader);
|
|
310
|
+
if (!viewState) {
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
diff: viewState.diff,
|
|
315
|
+
model: viewState.model,
|
|
316
|
+
suggestInfo: viewState.suggestInfo,
|
|
317
|
+
};
|
|
318
|
+
}), this._editor, this._tabAction));
|
|
319
|
+
this._viewWithElement = this._view.keepUpdated(this._store);
|
|
320
|
+
this._register(this._editorObs.createOverlayWidget({
|
|
321
|
+
domNode: this._viewWithElement.element,
|
|
322
|
+
position: constObservable(null),
|
|
323
|
+
allowEditorOverflow: false,
|
|
324
|
+
minContentWidthInPx: constObservable(0),
|
|
325
|
+
}));
|
|
326
|
+
this._widgetContent.get().keepUpdated(this._store);
|
|
327
|
+
this._register(autorun(reader => {
|
|
328
|
+
const layoutInfo = this._previewEditorLayoutInfo.read(reader);
|
|
329
|
+
if (!layoutInfo) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
this._previewEditor.layout(layoutInfo.codeEditorSize.toDimension(), layoutInfo.desiredPreviewEditorScrollLeft);
|
|
333
|
+
}));
|
|
334
|
+
this._isVisibleDelayed.recomputeInitiallyAndOnChange(this._store);
|
|
335
|
+
}
|
|
336
|
+
get isHovered() { return this._widgetContent.get().didMouseMoveDuringHover; }
|
|
337
|
+
};
|
|
338
|
+
InlineEditsLongDistanceHint = __decorate([
|
|
339
|
+
__param(4, IInstantiationService),
|
|
340
|
+
__param(5, IThemeService)
|
|
341
|
+
], InlineEditsLongDistanceHint);
|
|
342
|
+
export { InlineEditsLongDistanceHint };
|
|
343
|
+
function lengthsToOffsetRanges(lengths, initialOffset = 0) {
|
|
344
|
+
const result = [];
|
|
345
|
+
let offset = initialOffset;
|
|
346
|
+
for (const length of lengths) {
|
|
347
|
+
result.push(new OffsetRange(offset, offset + length));
|
|
348
|
+
offset += length;
|
|
349
|
+
}
|
|
350
|
+
return result;
|
|
351
|
+
}
|
|
352
|
+
function stackSizesDown(at, sizes, alignment = 'left') {
|
|
353
|
+
const rects = [];
|
|
354
|
+
let offset = 0;
|
|
355
|
+
for (const s of sizes) {
|
|
356
|
+
rects.push(Rect.fromLeftTopWidthHeight(at.x + (alignment === 'left' ? 0 : -s.width), at.y + offset, s.width, s.height));
|
|
357
|
+
offset += s.height;
|
|
358
|
+
}
|
|
359
|
+
return rects;
|
|
360
|
+
}
|
|
361
|
+
function findFirstMinimzeDistance(range, targetLine, predicate) {
|
|
362
|
+
for (let offset = 0;; offset++) {
|
|
363
|
+
const down = targetLine + offset;
|
|
364
|
+
if (down <= range.endLineNumberExclusive) {
|
|
365
|
+
const result = predicate(down);
|
|
366
|
+
if (result !== undefined) {
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
const up = targetLine - offset;
|
|
371
|
+
if (up >= range.startLineNumber) {
|
|
372
|
+
const result = predicate(up);
|
|
373
|
+
if (result !== undefined) {
|
|
374
|
+
return result;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (up < range.startLineNumber && down > range.endLineNumberExclusive) {
|
|
378
|
+
return undefined;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function getSums(array, fn) {
|
|
383
|
+
const result = [0];
|
|
384
|
+
let sum = 0;
|
|
385
|
+
for (const item of array) {
|
|
386
|
+
sum += fn(item);
|
|
387
|
+
result.push(sum);
|
|
388
|
+
}
|
|
389
|
+
return result;
|
|
390
|
+
}
|
|
391
|
+
function isEditBelowHint(viewState) {
|
|
392
|
+
const hintLineNumber = viewState.hint.lineNumber;
|
|
393
|
+
const editStartLineNumber = viewState.diff[0]?.original.startLineNumber;
|
|
394
|
+
return hintLineNumber < editStartLineNumber;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Changes the scroll position as little as possible just to reveal the given range in the window.
|
|
398
|
+
*/
|
|
399
|
+
export function scrollToReveal(currentScrollPosition, windowWidth, contentRangeToReveal) {
|
|
400
|
+
const visibleRange = new OffsetRange(currentScrollPosition, currentScrollPosition + windowWidth);
|
|
401
|
+
if (visibleRange.containsRange(contentRangeToReveal)) {
|
|
402
|
+
return { newScrollPosition: currentScrollPosition };
|
|
403
|
+
}
|
|
404
|
+
if (contentRangeToReveal.length > windowWidth) {
|
|
405
|
+
return { newScrollPosition: contentRangeToReveal.start };
|
|
406
|
+
}
|
|
407
|
+
if (contentRangeToReveal.endExclusive > visibleRange.endExclusive) {
|
|
408
|
+
return { newScrollPosition: contentRangeToReveal.endExclusive - windowWidth };
|
|
409
|
+
}
|
|
410
|
+
if (contentRangeToReveal.start < visibleRange.start) {
|
|
411
|
+
return { newScrollPosition: contentRangeToReveal.start };
|
|
412
|
+
}
|
|
413
|
+
return { newScrollPosition: currentScrollPosition };
|
|
414
|
+
}
|
|
415
|
+
//# sourceMappingURL=inlineEditsLongDistanceHint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.ts"],"names":[],"mappings":";;;;;;;;;AAA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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 { ChildNode, n, ObserverNode, ObserverNodeWithElement } from '../../../../../../../../base/browser/dom.js';\nimport { Event } from '../../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, constObservable, debouncedObservable2, derived, derivedDisposable } from '../../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../../common/core/position.js';\nimport { ITextModel } from '../../../../../../../common/model.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../../inlineEditWithChanges.js';\nimport { getContentSizeOfLines, rectToProps } from '../../utils/utils.js';\nimport { DetailedLineRangeMapping } from '../../../../../../../common/diff/rangeMapping.js';\nimport { OffsetRange } from '../../../../../../../common/core/ranges/offsetRange.js';\nimport { LineRange } from '../../../../../../../common/core/ranges/lineRange.js';\nimport { HideUnchangedRegionsFeature } from '../../../../../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js';\nimport { Codicon } from '../../../../../../../../base/common/codicons.js';\nimport { renderIcon } from '../../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { SymbolKinds } from '../../../../../../../common/languages.js';\nimport { debugLogRects, debugView } from '../debugVisualization.js';\nimport { distributeFlexBoxLayout } from '../../utils/flexBoxLayout.js';\nimport { Point } from '../../../../../../../common/core/2d/point.js';\nimport { Size2D } from '../../../../../../../common/core/2d/size.js';\nimport { getMaxTowerHeightInAvailableArea } from '../../utils/towersLayout.js';\nimport { IThemeService } from '../../../../../../../../platform/theme/common/themeService.js';\nimport { getEditorBlendedColor, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorsuccessfulBackground } from '../../theme.js';\nimport { asCssVariable, descriptionForeground, editorBackground } from '../../../../../../../../platform/theme/common/colorRegistry.js';\nimport { ILongDistancePreviewProps, LongDistancePreviewEditor } from './longDistancePreviewEditor.js';\nimport { InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from '../../components/gutterIndicatorView.js';\n\nconst BORDER_RADIUS = 4;\nconst MAX_WIDGET_WIDTH = 400;\nconst MIN_WIDGET_WIDTH = 200;\n\nexport class InlineEditsLongDistanceHint extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _editorObs;\n\treadonly onDidClick = Event.None;\n\tprivate _viewWithElement: ObserverNodeWithElement<HTMLDivElement> | undefined = undefined;\n\n\tprivate readonly _previewEditor;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _viewState: IObservable<ILongDistanceViewState | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\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\n\t\tthis._styles = this._tabAction.map((v, reader) => {\n\t\t\tlet border;\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: border = inlineEditIndicatorSecondaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Jump: border = inlineEditIndicatorPrimaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Accept: border = inlineEditIndicatorsuccessfulBackground; break;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tborder: getEditorBlendedColor(border, this._themeService).read(reader).toString(),\n\t\t\t\tbackground: asCssVariable(editorBackground)\n\t\t\t};\n\t\t});\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._previewEditor = this._register(\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\tLongDistancePreviewEditor,\n\t\t\t\tthis._previewTextModel,\n\t\t\t\tderived(reader => {\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdiff: viewState.diff,\n\t\t\t\t\t\tmodel: viewState.model,\n\t\t\t\t\t\tsuggestInfo: viewState.suggestInfo,\n\t\t\t\t\t} satisfies ILongDistancePreviewProps;\n\t\t\t\t}),\n\t\t\t\tthis._editor,\n\t\t\t\tthis._tabAction,\n\t\t\t)\n\t\t);\n\n\t\tthis._viewWithElement = this._view.keepUpdated(this._store);\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._viewWithElement.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._widgetContent.get().keepUpdated(this._store);\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\tthis._previewEditor.layout(layoutInfo.codeEditorSize.toDimension(), layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._isVisibleDelayed.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _styles;\n\n\tpublic get isHovered() { return this._widgetContent.get().didMouseMoveDuringHover; }\n\n\tprivate readonly _hintTextPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\treturn viewState ? new Position(viewState.hint.lineNumber, Number.MAX_SAFE_INTEGER) : null;\n\t});\n\n\tprivate readonly _lineSizesAroundHintPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\tconst p = this._hintTextPosition.read(reader);\n\t\tif (!viewState || !p) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst model = this._editorObs.model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst range = LineRange.ofLength(p.lineNumber, 1).addMargin(5, 5).intersect(LineRange.ofLength(1, model.getLineCount()));\n\n\t\tif (!range) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst sizes = getContentSizeOfLines(this._editorObs, range, reader);\n\t\tconst top = this._editorObs.observeTopForLineNumber(range.startLineNumber).read(reader);\n\n\t\treturn {\n\t\t\tlineRange: range,\n\t\t\ttop: top,\n\t\t\tsizes: sizes,\n\t\t};\n\t});\n\n\tprivate readonly _isVisibleDelayed = debouncedObservable2(\n\t\tderived(this, reader => this._viewState.read(reader)?.hint.isVisible),\n\t\t(lastValue, newValue) => lastValue === true && newValue === false ? 200 : 0,\n\t);\n\n\tprivate readonly _previewEditorLayoutInfo = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\n\t\tif (!viewState || !this._isVisibleDelayed.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineSizes = this._lineSizesAroundHintPosition.read(reader);\n\t\tif (!lineSizes) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst editorScrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst editorScrollLeft = this._editorObs.scrollLeft.read(reader);\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\n\t\tconst previewContentHeight = this._previewEditor.contentHeight.read(reader);\n\t\tconst previewEditorContentLayout = this._previewEditor.horizontalContentRangeInPreviewEditorToShow.read(reader);\n\n\t\tif (!previewContentHeight || !previewEditorContentLayout) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// const debugRects = stackSizesDown(new Point(editorLayout.contentLeft, lineSizes.top - scrollTop), lineSizes.sizes);\n\n\t\tconst editorTrueContentWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\tconst editorTrueContentRight = editorLayout.contentLeft + editorTrueContentWidth;\n\n\t\t// drawEditorWidths(this._editor, reader);\n\n\t\tconst c = this._editorObs.cursorLineNumber.read(reader);\n\t\tif (!c) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst availableSpaceSizes = lineSizes.sizes.map((s, idx) => {\n\t\t\tconst lineNumber = lineSizes.lineRange.startLineNumber + idx;\n\t\t\tlet linePaddingLeft = 20;\n\t\t\tif (lineNumber === viewState.hint.lineNumber) {\n\t\t\t\tlinePaddingLeft = 100;\n\t\t\t}\n\t\t\treturn new Size2D(Math.max(0, editorTrueContentWidth - s.width - linePaddingLeft), s.height);\n\t\t});\n\n\t\tconst showRects = false;\n\t\tif (showRects) {\n\t\t\tconst rects2 = stackSizesDown(new Point(editorTrueContentRight, lineSizes.top - editorScrollTop), availableSpaceSizes, 'right');\n\t\t\tdebugView(debugLogRects({ ...rects2 }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst availableSpaceHeightPrefixSums = getSums(availableSpaceSizes, s => s.height);\n\t\tconst availableSpaceSizesTransposed = availableSpaceSizes.map(s => s.transpose());\n\n\t\tconst previewEditorMargin = 2;\n\t\tconst widgetPadding = 2;\n\t\tconst lowerBarHeight = 20;\n\t\tconst widgetBorder = 1;\n\n\t\tconst extraGutterMarginToAvoidScrollBar = 2;\n\t\tconst previewEditorHeight = previewContentHeight! + extraGutterMarginToAvoidScrollBar;\n\n\t\tfunction getWidgetVerticalOutline(lineNumber: number): OffsetRange {\n\t\t\tconst sizeIdx = lineNumber - lineSizes!.lineRange.startLineNumber;\n\t\t\tconst top = lineSizes!.top + availableSpaceHeightPrefixSums[sizeIdx];\n\t\t\tconst editorRange = OffsetRange.ofStartAndLength(top, previewEditorHeight);\n\t\t\tconst verticalWidgetRange = editorRange.withMargin(previewEditorMargin + widgetPadding + widgetBorder).withMargin(0, lowerBarHeight);\n\t\t\treturn verticalWidgetRange;\n\t\t}\n\n\t\tlet possibleWidgetOutline = findFirstMinimzeDistance(lineSizes.lineRange.addMargin(-1, -1), viewState.hint.lineNumber, lineNumber => {\n\t\t\tconst verticalWidgetRange = getWidgetVerticalOutline(lineNumber);\n\t\t\tconst maxWidth = getMaxTowerHeightInAvailableArea(verticalWidgetRange.delta(-lineSizes.top), availableSpaceSizesTransposed);\n\t\t\tif (maxWidth < MIN_WIDGET_WIDTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst horizontalWidgetRange = OffsetRange.ofStartAndLength(editorTrueContentRight - maxWidth, maxWidth);\n\t\t\treturn { horizontalWidgetRange, verticalWidgetRange };\n\t\t});\n\t\tif (!possibleWidgetOutline) {\n\t\t\tpossibleWidgetOutline = {\n\t\t\t\thorizontalWidgetRange: OffsetRange.ofStartAndLength(editorTrueContentRight - MAX_WIDGET_WIDTH, MAX_WIDGET_WIDTH),\n\t\t\t\tverticalWidgetRange: getWidgetVerticalOutline(viewState.hint.lineNumber + 2).delta(10),\n\t\t\t};\n\t\t}\n\n\t\tif (!possibleWidgetOutline) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst rectAvailableSpace = Rect.fromRanges(\n\t\t\tpossibleWidgetOutline.horizontalWidgetRange,\n\t\t\tpossibleWidgetOutline.verticalWidgetRange\n\t\t).translateX(-editorScrollLeft).translateY(-editorScrollTop);\n\n\t\tconst showAvailableSpace = false;\n\t\tif (showAvailableSpace) {\n\t\t\tdebugView(debugLogRects({ rectAvailableSpace }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst maxWidgetWidth = Math.min(MAX_WIDGET_WIDTH, previewEditorContentLayout.maxEditorWidth + previewEditorMargin + widgetPadding);\n\n\t\tconst layout = distributeFlexBoxLayout(rectAvailableSpace.width, {\n\t\t\tspaceBefore: { min: 0, max: 10, priority: 1 },\n\t\t\tcontent: { min: 50, rules: [{ max: 150, priority: 2 }, { max: maxWidgetWidth, priority: 1 }] },\n\t\t\tspaceAfter: { min: 20 },\n\t\t});\n\n\t\tif (!layout) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ranges = lengthsToOffsetRanges([layout.spaceBefore, layout.content, layout.spaceAfter], rectAvailableSpace.left);\n\t\tconst spaceBeforeRect = rectAvailableSpace.withHorizontalRange(ranges[0]);\n\t\tconst widgetRect = rectAvailableSpace.withHorizontalRange(ranges[1]);\n\t\tconst spaceAfterRect = rectAvailableSpace.withHorizontalRange(ranges[2]);\n\n\t\tconst showRects2 = false;\n\t\tif (showRects2) {\n\t\t\tdebugView(debugLogRects({ spaceBeforeRect, widgetRect, spaceAfterRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorRect = widgetRect.withMargin(-widgetPadding - widgetBorder - previewEditorMargin).withMargin(0, 0, -lowerBarHeight, 0);\n\n\t\tconst showEditorRect = false;\n\t\tif (showEditorRect) {\n\t\t\tdebugView(debugLogRects({ previewEditorRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorContentWidth = previewEditorRect.width - previewEditorContentLayout.nonContentWidth;\n\t\tconst maxPrefferedRangeLength = previewEditorContentWidth * 0.8;\n\t\tconst preferredRangeToReveal = previewEditorContentLayout.preferredRangeToReveal.intersect(OffsetRange.ofStartAndLength(\n\t\t\tpreviewEditorContentLayout.preferredRangeToReveal.start,\n\t\t\tmaxPrefferedRangeLength\n\t\t)) ?? previewEditorContentLayout.preferredRangeToReveal;\n\t\tconst desiredPreviewEditorScrollLeft = scrollToReveal(previewEditorContentLayout.indentationEnd, previewEditorContentWidth, preferredRangeToReveal);\n\n\t\treturn {\n\t\t\tcodeEditorSize: previewEditorRect.getSize(),\n\t\t\tcodeScrollLeft: editorScrollLeft,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\twidgetRect,\n\n\t\t\tpreviewEditorMargin,\n\t\t\twidgetPadding,\n\t\t\twidgetBorder,\n\n\t\t\tlowerBarHeight,\n\n\t\t\tdesiredPreviewEditorScrollLeft: desiredPreviewEditorScrollLeft.newScrollPosition,\n\t\t};\n\t});\n\n\tprivate readonly _view = n.div({\n\t\tclass: 'inline-edits-view',\n\t\tstyle: {\n\t\t\tposition: 'absolute',\n\t\t\toverflow: 'visible',\n\t\t\ttop: '0px',\n\t\t\tleft: '0px',\n\t\t\tdisplay: derived(this, reader => !!this._previewEditorLayoutInfo.read(reader) ? 'block' : 'none'),\n\t\t},\n\t}, [\n\t\tderived(this, _reader => [this._widgetContent]),\n\t]);\n\n\tprivate readonly _widgetContent = derived(this, reader => // TODO how to not use derived but not move into constructor?\n\t\tn.div({\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tbackground: 'var(--vscode-editorWidget-background)',\n\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.widgetPadding),\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\tborder: derived(reader => `${this._previewEditorLayoutInfo.read(reader)?.widgetBorder}px solid ${this._styles.read(reader).border}`),\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\topacity: derived(reader => this._viewState.read(reader)?.hint.isVisible ? '1' : '0'),\n\t\t\t\ttransition: 'opacity 200ms ease-in-out',\n\t\t\t\t...rectToProps(reader => this._previewEditorLayoutInfo.read(reader)?.widgetRect)\n\t\t\t},\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: () => {\n\t\t\t\tthis._viewState.read(undefined)?.model.jump();\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({\n\t\t\t\tclass: ['editorContainer'],\n\t\t\t\tstyle: {\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.previewEditorMargin),\n\t\t\t\t\tbackground: 'var(--vscode-editor-background)',\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\tderived(this, r => this._previewEditor.element), // --\n\t\t\t]),\n\t\t\tn.div({ class: 'bar', style: { color: asCssVariable(descriptionForeground), pointerEvents: 'none', margin: '0 4px', height: this._previewEditorLayoutInfo.map(i => i?.lowerBarHeight), display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, [\n\t\t\t\tderived(this, reader => {\n\t\t\t\t\tconst children: (HTMLElement | ObserverNode<HTMLDivElement>)[] = [];\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn children;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Outline Element\n\t\t\t\t\tconst source = this._originalOutlineSource.read(reader);\n\t\t\t\t\tconst outlineItems = source?.getAt(viewState.edit.lineEdit.lineRange.startLineNumber, reader).slice(0, 1) ?? [];\n\t\t\t\t\tconst outlineElements: ChildNode[] = [];\n\t\t\t\t\tif (outlineItems.length > 0) {\n\t\t\t\t\t\tfor (let i = 0; i < outlineItems.length; i++) {\n\t\t\t\t\t\t\tconst item = outlineItems[i];\n\t\t\t\t\t\t\tconst icon = SymbolKinds.toIcon(item.kind);\n\t\t\t\t\t\t\toutlineElements.push(n.div({\n\t\t\t\t\t\t\t\tclass: 'breadcrumb-item',\n\t\t\t\t\t\t\t\tstyle: { display: 'flex', alignItems: 'center', flex: '1 1 auto', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },\n\t\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\t\trenderIcon(icon),\n\t\t\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\t\t\titem.name,\n\t\t\t\t\t\t\t\t...(i === outlineItems.length - 1\n\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t: [renderIcon(Codicon.chevronRight)]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(n.div({ class: 'outline-elements' }, outlineElements));\n\n\t\t\t\t\t// Show Edit Direction\n\t\t\t\t\tconst arrowIcon = isEditBelowHint(viewState) ? Codicon.arrowDown : Codicon.arrowUp;\n\t\t\t\t\tchildren.push(n.div({\n\t\t\t\t\t\tclass: 'go-to-label',\n\t\t\t\t\t\tstyle: { display: 'flex', alignItems: 'center', flex: '0 0 auto', marginLeft: '14px' },\n\t\t\t\t\t}, [\n\t\t\t\t\t\t'Go To Edit',\n\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\trenderIcon(arrowIcon),\n\t\t\t\t\t]));\n\n\t\t\t\t\treturn children;\n\t\t\t\t})\n\t\t\t]),\n\t\t])\n\t);\n\n\tprivate readonly _originalOutlineSource = derivedDisposable(this, (reader) => {\n\t\tconst m = this._editorObs.model.read(reader);\n\t\tconst factory = HideUnchangedRegionsFeature._breadcrumbsSourceFactory.read(reader);\n\t\treturn (!m || !factory) ? undefined : factory(m, this._instantiationService);\n\t});\n}\n\nexport interface ILongDistanceHint {\n\tlineNumber: number;\n\tisVisible: boolean;\n}\n\nexport interface ILongDistanceViewState {\n\thint: ILongDistanceHint;\n\tnewTextLineCount: number;\n\tedit: InlineEditWithChanges;\n\tdiff: DetailedLineRangeMapping[];\n\n\tmodel: SimpleInlineSuggestModel;\n\tsuggestInfo: InlineSuggestionGutterMenuData;\n}\n\nfunction lengthsToOffsetRanges(lengths: number[], initialOffset = 0): OffsetRange[] {\n\tconst result: OffsetRange[] = [];\n\tlet offset = initialOffset;\n\tfor (const length of lengths) {\n\t\tresult.push(new OffsetRange(offset, offset + length));\n\t\toffset += length;\n\t}\n\treturn result;\n}\n\nfunction stackSizesDown(at: Point, sizes: Size2D[], alignment: 'left' | 'right' = 'left'): Rect[] {\n\tconst rects: Rect[] = [];\n\tlet offset = 0;\n\tfor (const s of sizes) {\n\t\trects.push(\n\t\t\tRect.fromLeftTopWidthHeight(\n\t\t\t\tat.x + (alignment === 'left' ? 0 : -s.width),\n\t\t\t\tat.y + offset,\n\t\t\t\ts.width,\n\t\t\t\ts.height\n\t\t\t)\n\t\t);\n\t\toffset += s.height;\n\t}\n\treturn rects;\n}\n\nfunction findFirstMinimzeDistance<T>(range: LineRange, targetLine: number, predicate: (lineNumber: number) => T | undefined): T | undefined {\n\tfor (let offset = 0; ; offset++) {\n\t\tconst down = targetLine + offset;\n\t\tif (down <= range.endLineNumberExclusive) {\n\t\t\tconst result = predicate(down);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tconst up = targetLine - offset;\n\t\tif (up >= range.startLineNumber) {\n\t\t\tconst result = predicate(up);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tif (up < range.startLineNumber && down > range.endLineNumberExclusive) {\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n\nfunction getSums<T>(array: T[], fn: (item: T) => number): number[] {\n\tconst result: number[] = [0];\n\tlet sum = 0;\n\tfor (const item of array) {\n\t\tsum += fn(item);\n\t\tresult.push(sum);\n\t}\n\treturn result;\n}\n\nfunction isEditBelowHint(viewState: ILongDistanceViewState): boolean {\n\tconst hintLineNumber = viewState.hint.lineNumber;\n\tconst editStartLineNumber = viewState.diff[0]?.original.startLineNumber;\n\treturn hintLineNumber < editStartLineNumber;\n}\n\n\n/**\n * Changes the scroll position as little as possible just to reveal the given range in the window.\n*/\nexport function scrollToReveal(currentScrollPosition: number, windowWidth: number, contentRangeToReveal: OffsetRange): { newScrollPosition: number } {\n\tconst visibleRange = new OffsetRange(currentScrollPosition, currentScrollPosition + windowWidth);\n\tif (visibleRange.containsRange(contentRangeToReveal)) {\n\t\treturn { newScrollPosition: currentScrollPosition };\n\t}\n\tif (contentRangeToReveal.length > windowWidth) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\tif (contentRangeToReveal.endExclusive > visibleRange.endExclusive) {\n\t\treturn { newScrollPosition: contentRangeToReveal.endExclusive - windowWidth };\n\t}\n\tif (contentRangeToReveal.start < visibleRange.start) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\treturn { newScrollPosition: currentScrollPosition };\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 { ChildNode, n, ObserverNode, ObserverNodeWithElement } from '../../../../../../../../base/browser/dom.js';\nimport { Event } from '../../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, constObservable, debouncedObservable2, derived, derivedDisposable } from '../../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../../common/core/position.js';\nimport { ITextModel } from '../../../../../../../common/model.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../../inlineEditWithChanges.js';\nimport { getContentSizeOfLines, rectToProps } from '../../utils/utils.js';\nimport { DetailedLineRangeMapping } from '../../../../../../../common/diff/rangeMapping.js';\nimport { OffsetRange } from '../../../../../../../common/core/ranges/offsetRange.js';\nimport { LineRange } from '../../../../../../../common/core/ranges/lineRange.js';\nimport { HideUnchangedRegionsFeature } from '../../../../../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js';\nimport { Codicon } from '../../../../../../../../base/common/codicons.js';\nimport { renderIcon } from '../../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { SymbolKinds } from '../../../../../../../common/languages.js';\nimport { debugLogRects, debugView } from '../debugVisualization.js';\nimport { distributeFlexBoxLayout } from '../../utils/flexBoxLayout.js';\nimport { Point } from '../../../../../../../common/core/2d/point.js';\nimport { Size2D } from '../../../../../../../common/core/2d/size.js';\nimport { getMaxTowerHeightInAvailableArea } from '../../utils/towersLayout.js';\nimport { IThemeService } from '../../../../../../../../platform/theme/common/themeService.js';\nimport { getEditorBlendedColor, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorsuccessfulBackground } from '../../theme.js';\nimport { asCssVariable, descriptionForeground, editorBackground } from '../../../../../../../../platform/theme/common/colorRegistry.js';\nimport { ILongDistancePreviewProps, LongDistancePreviewEditor } from './longDistancePreviewEditor.js';\nimport { InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from '../../components/gutterIndicatorView.js';\n\nconst BORDER_RADIUS = 4;\nconst MAX_WIDGET_WIDTH = 400;\nconst MIN_WIDGET_WIDTH = 200;\n\nexport class InlineEditsLongDistanceHint extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _editorObs;\n\treadonly onDidClick = Event.None;\n\tprivate _viewWithElement: ObserverNodeWithElement<HTMLDivElement> | undefined = undefined;\n\n\tprivate readonly _previewEditor;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _viewState: IObservable<ILongDistanceViewState | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\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\n\t\tthis._styles = this._tabAction.map((v, reader) => {\n\t\t\tlet border;\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: border = inlineEditIndicatorSecondaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Jump: border = inlineEditIndicatorPrimaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Accept: border = inlineEditIndicatorsuccessfulBackground; break;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tborder: getEditorBlendedColor(border, this._themeService).read(reader).toString(),\n\t\t\t\tbackground: asCssVariable(editorBackground)\n\t\t\t};\n\t\t});\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._previewEditor = this._register(\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\tLongDistancePreviewEditor,\n\t\t\t\tthis._previewTextModel,\n\t\t\t\tderived(reader => {\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdiff: viewState.diff,\n\t\t\t\t\t\tmodel: viewState.model,\n\t\t\t\t\t\tsuggestInfo: viewState.suggestInfo,\n\t\t\t\t\t} satisfies ILongDistancePreviewProps;\n\t\t\t\t}),\n\t\t\t\tthis._editor,\n\t\t\t\tthis._tabAction,\n\t\t\t)\n\t\t);\n\n\t\tthis._viewWithElement = this._view.keepUpdated(this._store);\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._viewWithElement.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._widgetContent.get().keepUpdated(this._store);\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\tthis._previewEditor.layout(layoutInfo.codeEditorSize.toDimension(), layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._isVisibleDelayed.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _styles;\n\n\tpublic get isHovered() { return this._widgetContent.get().didMouseMoveDuringHover; }\n\n\tprivate readonly _hintTextPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\treturn viewState ? new Position(viewState.hint.lineNumber, Number.MAX_SAFE_INTEGER) : null;\n\t});\n\n\tprivate readonly _lineSizesAroundHintPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\tconst p = this._hintTextPosition.read(reader);\n\t\tif (!viewState || !p) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst model = this._editorObs.model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst range = LineRange.ofLength(p.lineNumber, 1).addMargin(5, 5).intersect(LineRange.ofLength(1, model.getLineCount()));\n\n\t\tif (!range) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst sizes = getContentSizeOfLines(this._editorObs, range, reader);\n\t\tconst top = this._editorObs.observeTopForLineNumber(range.startLineNumber).read(reader);\n\n\t\treturn {\n\t\t\tlineRange: range,\n\t\t\ttop: top,\n\t\t\tsizes: sizes,\n\t\t};\n\t});\n\n\tprivate readonly _isVisibleDelayed = debouncedObservable2(\n\t\tderived(this, reader => this._viewState.read(reader)?.hint.isVisible),\n\t\t(lastValue, newValue) => lastValue === true && newValue === false ? 200 : 0,\n\t);\n\n\tprivate readonly _previewEditorLayoutInfo = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\n\t\tif (!viewState || !this._isVisibleDelayed.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineSizes = this._lineSizesAroundHintPosition.read(reader);\n\t\tif (!lineSizes) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst editorScrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst editorScrollLeft = this._editorObs.scrollLeft.read(reader);\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\n\t\tconst previewContentHeight = this._previewEditor.contentHeight.read(reader);\n\t\tconst previewEditorContentLayout = this._previewEditor.horizontalContentRangeInPreviewEditorToShow.read(reader);\n\n\t\tif (!previewContentHeight || !previewEditorContentLayout) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// const debugRects = stackSizesDown(new Point(editorLayout.contentLeft, lineSizes.top - scrollTop), lineSizes.sizes);\n\n\t\tconst editorTrueContentWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\tconst editorTrueContentRight = editorLayout.contentLeft + editorTrueContentWidth;\n\n\t\t// drawEditorWidths(this._editor, reader);\n\n\t\tconst c = this._editorObs.cursorLineNumber.read(reader);\n\t\tif (!c) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst availableSpaceSizes = lineSizes.sizes.map((s, idx) => {\n\t\t\tconst lineNumber = lineSizes.lineRange.startLineNumber + idx;\n\t\t\tlet linePaddingLeft = 20;\n\t\t\tif (lineNumber === viewState.hint.lineNumber) {\n\t\t\t\tlinePaddingLeft = 100;\n\t\t\t}\n\t\t\treturn new Size2D(Math.max(0, editorTrueContentWidth - s.width - linePaddingLeft), s.height);\n\t\t});\n\n\t\tconst showRects = false;\n\t\tif (showRects) {\n\t\t\tconst rects2 = stackSizesDown(new Point(editorTrueContentRight, lineSizes.top - editorScrollTop), availableSpaceSizes, 'right');\n\t\t\tdebugView(debugLogRects({ ...rects2 }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst availableSpaceHeightPrefixSums = getSums(availableSpaceSizes, s => s.height);\n\t\tconst availableSpaceSizesTransposed = availableSpaceSizes.map(s => s.transpose());\n\n\t\tconst previewEditorMargin = 2;\n\t\tconst widgetPadding = 2;\n\t\tconst lowerBarHeight = 20;\n\t\tconst widgetBorder = 1;\n\n\t\tconst extraGutterMarginToAvoidScrollBar = 2;\n\t\tconst previewEditorHeight = previewContentHeight! + extraGutterMarginToAvoidScrollBar;\n\n\t\tfunction getWidgetVerticalOutline(lineNumber: number): OffsetRange {\n\t\t\tconst sizeIdx = lineNumber - lineSizes!.lineRange.startLineNumber;\n\t\t\tconst top = lineSizes!.top + availableSpaceHeightPrefixSums[sizeIdx];\n\t\t\tconst editorRange = OffsetRange.ofStartAndLength(top, previewEditorHeight);\n\t\t\tconst verticalWidgetRange = editorRange.withMargin(previewEditorMargin + widgetPadding + widgetBorder).withMargin(0, lowerBarHeight);\n\t\t\treturn verticalWidgetRange;\n\t\t}\n\n\t\tlet possibleWidgetOutline = findFirstMinimzeDistance(lineSizes.lineRange.addMargin(-1, -1), viewState.hint.lineNumber, lineNumber => {\n\t\t\tconst verticalWidgetRange = getWidgetVerticalOutline(lineNumber);\n\t\t\tconst maxWidth = getMaxTowerHeightInAvailableArea(verticalWidgetRange.delta(-lineSizes.top), availableSpaceSizesTransposed);\n\t\t\tif (maxWidth < MIN_WIDGET_WIDTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst horizontalWidgetRange = OffsetRange.ofStartAndLength(editorTrueContentRight - maxWidth, maxWidth);\n\t\t\treturn { horizontalWidgetRange, verticalWidgetRange };\n\t\t});\n\t\tif (!possibleWidgetOutline) {\n\t\t\tpossibleWidgetOutline = {\n\t\t\t\thorizontalWidgetRange: OffsetRange.ofStartAndLength(editorTrueContentRight - MAX_WIDGET_WIDTH, MAX_WIDGET_WIDTH),\n\t\t\t\tverticalWidgetRange: getWidgetVerticalOutline(viewState.hint.lineNumber + 2).delta(10),\n\t\t\t};\n\t\t}\n\n\t\tif (!possibleWidgetOutline) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst rectAvailableSpace = Rect.fromRanges(\n\t\t\tpossibleWidgetOutline.horizontalWidgetRange,\n\t\t\tpossibleWidgetOutline.verticalWidgetRange\n\t\t).translateX(-editorScrollLeft).translateY(-editorScrollTop);\n\n\t\tconst showAvailableSpace = false;\n\t\tif (showAvailableSpace) {\n\t\t\tdebugView(debugLogRects({ rectAvailableSpace }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst maxWidgetWidth = Math.min(MAX_WIDGET_WIDTH, previewEditorContentLayout.maxEditorWidth + previewEditorMargin + widgetPadding);\n\n\t\tconst layout = distributeFlexBoxLayout(rectAvailableSpace.width, {\n\t\t\tspaceBefore: { min: 0, max: 10, priority: 1 },\n\t\t\tcontent: { min: 50, rules: [{ max: 150, priority: 2 }, { max: maxWidgetWidth, priority: 1 }] },\n\t\t\tspaceAfter: { min: 20 },\n\t\t});\n\n\t\tif (!layout) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ranges = lengthsToOffsetRanges([layout.spaceBefore, layout.content, layout.spaceAfter], rectAvailableSpace.left);\n\t\tconst spaceBeforeRect = rectAvailableSpace.withHorizontalRange(ranges[0]);\n\t\tconst widgetRect = rectAvailableSpace.withHorizontalRange(ranges[1]);\n\t\tconst spaceAfterRect = rectAvailableSpace.withHorizontalRange(ranges[2]);\n\n\t\tconst showRects2 = false;\n\t\tif (showRects2) {\n\t\t\tdebugView(debugLogRects({ spaceBeforeRect, widgetRect, spaceAfterRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorRect = widgetRect.withMargin(-widgetPadding - widgetBorder - previewEditorMargin).withMargin(0, 0, -lowerBarHeight, 0);\n\n\t\tconst showEditorRect = false;\n\t\tif (showEditorRect) {\n\t\t\tdebugView(debugLogRects({ previewEditorRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorContentWidth = previewEditorRect.width - previewEditorContentLayout.nonContentWidth;\n\t\tconst maxPrefferedRangeLength = previewEditorContentWidth * 0.8;\n\t\tconst preferredRangeToReveal = previewEditorContentLayout.preferredRangeToReveal.intersect(OffsetRange.ofStartAndLength(\n\t\t\tpreviewEditorContentLayout.preferredRangeToReveal.start,\n\t\t\tmaxPrefferedRangeLength\n\t\t)) ?? previewEditorContentLayout.preferredRangeToReveal;\n\t\tconst desiredPreviewEditorScrollLeft = scrollToReveal(previewEditorContentLayout.indentationEnd, previewEditorContentWidth, preferredRangeToReveal);\n\n\t\treturn {\n\t\t\tcodeEditorSize: previewEditorRect.getSize(),\n\t\t\tcodeScrollLeft: editorScrollLeft,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\twidgetRect,\n\n\t\t\tpreviewEditorMargin,\n\t\t\twidgetPadding,\n\t\t\twidgetBorder,\n\n\t\t\tlowerBarHeight,\n\n\t\t\tdesiredPreviewEditorScrollLeft: desiredPreviewEditorScrollLeft.newScrollPosition,\n\t\t};\n\t});\n\n\tprivate readonly _view = n.div({\n\t\tclass: 'inline-edits-view',\n\t\tstyle: {\n\t\t\tposition: 'absolute',\n\t\t\toverflow: 'visible',\n\t\t\ttop: '0px',\n\t\t\tleft: '0px',\n\t\t\tdisplay: derived(this, reader => !!this._previewEditorLayoutInfo.read(reader) ? 'block' : 'none'),\n\t\t},\n\t}, [\n\t\tderived(this, _reader => [this._widgetContent]),\n\t]);\n\n\tprivate readonly _widgetContent = derived(this, reader => // TODO how to not use derived but not move into constructor?\n\t\tn.div({\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tbackground: 'var(--vscode-editorWidget-background)',\n\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.widgetPadding),\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\tborder: derived(reader => `${this._previewEditorLayoutInfo.read(reader)?.widgetBorder}px solid ${this._styles.read(reader).border}`),\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\topacity: derived(reader => this._viewState.read(reader)?.hint.isVisible ? '1' : '0'),\n\t\t\t\ttransition: 'opacity 200ms ease-in-out',\n\t\t\t\t...rectToProps(reader => this._previewEditorLayoutInfo.read(reader)?.widgetRect)\n\t\t\t},\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: () => {\n\t\t\t\tthis._viewState.read(undefined)?.model.jump();\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({\n\t\t\t\tclass: ['editorContainer'],\n\t\t\t\tstyle: {\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.previewEditorMargin),\n\t\t\t\t\tbackground: 'var(--vscode-editor-background)',\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\tderived(this, r => this._previewEditor.element), // --\n\t\t\t]),\n\t\t\tn.div({ class: 'bar', style: { color: asCssVariable(descriptionForeground), pointerEvents: 'none', margin: '0 4px', height: this._previewEditorLayoutInfo.map(i => i?.lowerBarHeight), display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, [\n\t\t\t\tderived(this, reader => {\n\t\t\t\t\tconst children: (HTMLElement | ObserverNode<HTMLDivElement>)[] = [];\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn children;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Outline Element\n\t\t\t\t\tconst source = this._originalOutlineSource.read(reader);\n\t\t\t\t\tconst outlineItems = source?.getAt(viewState.edit.lineEdit.lineRange.startLineNumber, reader).slice(0, 1) ?? [];\n\t\t\t\t\tconst outlineElements: ChildNode[] = [];\n\t\t\t\t\tif (outlineItems.length > 0) {\n\t\t\t\t\t\tfor (let i = 0; i < outlineItems.length; i++) {\n\t\t\t\t\t\t\tconst item = outlineItems[i];\n\t\t\t\t\t\t\tconst icon = SymbolKinds.toIcon(item.kind);\n\t\t\t\t\t\t\toutlineElements.push(n.div({\n\t\t\t\t\t\t\t\tclass: 'breadcrumb-item',\n\t\t\t\t\t\t\t\tstyle: { display: 'flex', alignItems: 'center', flex: '1 1 auto', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },\n\t\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\t\trenderIcon(icon),\n\t\t\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\t\t\titem.name,\n\t\t\t\t\t\t\t\t...(i === outlineItems.length - 1\n\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t: [renderIcon(Codicon.chevronRight)]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(n.div({ class: 'outline-elements' }, outlineElements));\n\n\t\t\t\t\t// Show Edit Direction\n\t\t\t\t\tconst arrowIcon = isEditBelowHint(viewState) ? Codicon.arrowDown : Codicon.arrowUp;\n\t\t\t\t\tchildren.push(n.div({\n\t\t\t\t\t\tclass: 'go-to-label',\n\t\t\t\t\t\tstyle: { display: 'flex', alignItems: 'center', flex: '0 0 auto', marginLeft: '14px' },\n\t\t\t\t\t}, [\n\t\t\t\t\t\t'Go To Edit',\n\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\trenderIcon(arrowIcon),\n\t\t\t\t\t]));\n\n\t\t\t\t\treturn children;\n\t\t\t\t})\n\t\t\t]),\n\t\t])\n\t);\n\n\tprivate readonly _originalOutlineSource = derivedDisposable(this, (reader) => {\n\t\tconst m = this._editorObs.model.read(reader);\n\t\tconst factory = HideUnchangedRegionsFeature._breadcrumbsSourceFactory.read(reader);\n\t\treturn (!m || !factory) ? undefined : factory(m, this._instantiationService);\n\t});\n}\n\nexport interface ILongDistanceHint {\n\tlineNumber: number;\n\tisVisible: boolean;\n}\n\nexport interface ILongDistanceViewState {\n\thint: ILongDistanceHint;\n\tnewTextLineCount: number;\n\tedit: InlineEditWithChanges;\n\tdiff: DetailedLineRangeMapping[];\n\n\tmodel: SimpleInlineSuggestModel;\n\tsuggestInfo: InlineSuggestionGutterMenuData;\n}\n\nfunction lengthsToOffsetRanges(lengths: number[], initialOffset = 0): OffsetRange[] {\n\tconst result: OffsetRange[] = [];\n\tlet offset = initialOffset;\n\tfor (const length of lengths) {\n\t\tresult.push(new OffsetRange(offset, offset + length));\n\t\toffset += length;\n\t}\n\treturn result;\n}\n\nfunction stackSizesDown(at: Point, sizes: Size2D[], alignment: 'left' | 'right' = 'left'): Rect[] {\n\tconst rects: Rect[] = [];\n\tlet offset = 0;\n\tfor (const s of sizes) {\n\t\trects.push(\n\t\t\tRect.fromLeftTopWidthHeight(\n\t\t\t\tat.x + (alignment === 'left' ? 0 : -s.width),\n\t\t\t\tat.y + offset,\n\t\t\t\ts.width,\n\t\t\t\ts.height\n\t\t\t)\n\t\t);\n\t\toffset += s.height;\n\t}\n\treturn rects;\n}\n\nfunction findFirstMinimzeDistance<T>(range: LineRange, targetLine: number, predicate: (lineNumber: number) => T | undefined): T | undefined {\n\tfor (let offset = 0; ; offset++) {\n\t\tconst down = targetLine + offset;\n\t\tif (down <= range.endLineNumberExclusive) {\n\t\t\tconst result = predicate(down);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tconst up = targetLine - offset;\n\t\tif (up >= range.startLineNumber) {\n\t\t\tconst result = predicate(up);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tif (up < range.startLineNumber && down > range.endLineNumberExclusive) {\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n\nfunction getSums<T>(array: T[], fn: (item: T) => number): number[] {\n\tconst result: number[] = [0];\n\tlet sum = 0;\n\tfor (const item of array) {\n\t\tsum += fn(item);\n\t\tresult.push(sum);\n\t}\n\treturn result;\n}\n\nfunction isEditBelowHint(viewState: ILongDistanceViewState): boolean {\n\tconst hintLineNumber = viewState.hint.lineNumber;\n\tconst editStartLineNumber = viewState.diff[0]?.original.startLineNumber;\n\treturn hintLineNumber < editStartLineNumber;\n}\n\n\n/**\n * Changes the scroll position as little as possible just to reveal the given range in the window.\n*/\nexport function scrollToReveal(currentScrollPosition: number, windowWidth: number, contentRangeToReveal: OffsetRange): { newScrollPosition: number } {\n\tconst visibleRange = new OffsetRange(currentScrollPosition, currentScrollPosition + windowWidth);\n\tif (visibleRange.containsRange(contentRangeToReveal)) {\n\t\treturn { newScrollPosition: currentScrollPosition };\n\t}\n\tif (contentRangeToReveal.length > windowWidth) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\tif (contentRangeToReveal.endExclusive > visibleRange.endExclusive) {\n\t\treturn { newScrollPosition: contentRangeToReveal.endExclusive - windowWidth };\n\t}\n\tif (contentRangeToReveal.start < visibleRange.start) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\treturn { newScrollPosition: currentScrollPosition };\n}\n"]}
|