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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,OAAO,EAAoC,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AAEzG,OAAO,EAAwB,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC5G,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAG7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE7D,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,UAAU;aACtC,QAAG,GAAG,cAAc,CAAC,IAAI,CAAtB,AAAuB,CAAC;IAsElD,YACkB,OAAoB,EACpB,KAA0C,EAC1C,MAAuD,EACvD,cAA4C,EACtC,oBAA2C;QAElE,KAAK,EAAE,CAAC;QANS,YAAO,GAAP,OAAO,CAAa;QACpB,UAAK,GAAL,KAAK,CAAqC;QAC1C,WAAM,GAAN,MAAM,CAAiD;QACvD,mBAAc,GAAd,cAAc,CAA8B;QAtE7C,gBAAW,GAAG,OAAO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B,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAChL,CAAC;;AAnFW,8BAA8B;IA4ExC,WAAA,qBAAqB,CAAA;GA5EX,8BAA8B,CAoF1C","file":"inlineEditsViewProducer.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 *--------------------------------------------------------------------------------------------*/\n\nimport { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, ISettableObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { GhostTextIndicator, InlineEditHost, InlineEditModel } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tpublic static readonly hot = createHotClass(this);\n\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineCompletion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), model.allPositions.read(undefined), inlineEdit.commands, inlineEdit.inlineCompletion);\n\t});\n\n\tprivate readonly _inlineEditModel = derived<InlineEditModel | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new InlineEditModel(model, edit, tabAction);\n\t});\n\n\tprivate readonly _inlineEditHost = derived<InlineEditHost | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\treturn new InlineEditHost(model);\n\t});\n\n\tprivate readonly _ghostTextIndicator = derived<GhostTextIndicator | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst state = model.inlineCompletionState.read(reader);\n\t\tif (!state) { return undefined; }\n\t\tconst inlineCompletion = state.inlineCompletion;\n\t\tif (!inlineCompletion) { return undefined; }\n\n\t\tif (!inlineCompletion.showInlineEditMenu) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1);\n\n\t\treturn new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion);\n\t});\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, ISettableObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { GhostTextIndicator, InlineEditHost, InlineEditModel } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tpublic static readonly hot = createHotClass(this);\n\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineCompletion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), model.allPositions.read(undefined), inlineEdit.commands, inlineEdit.inlineCompletion);\n\t});\n\n\tprivate readonly _inlineEditModel = derived<InlineEditModel | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new InlineEditModel(model, edit, tabAction);\n\t});\n\n\tprivate readonly _inlineEditHost = derived<InlineEditHost | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\treturn new InlineEditHost(model);\n\t});\n\n\tprivate readonly _ghostTextIndicator = derived<GhostTextIndicator | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst state = model.inlineCompletionState.read(reader);\n\t\tif (!state) { return undefined; }\n\t\tconst inlineCompletion = state.inlineCompletion;\n\t\tif (!inlineCompletion) { return undefined; }\n\n\t\tif (!inlineCompletion.showInlineEditMenu) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1);\n\n\t\treturn new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion);\n\t});\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsVi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C,wBAAwB,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EACvG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,oBAAoB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAClH,IAAI,CAAC,cAAc,CACnB,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AAjEY,8BAA8B;IAqDxC,WAAA,qBAAqB,CAAA;GArDX,8BAA8B,CAiE1C","file":"inlineEditsViewProducer.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 *--------------------------------------------------------------------------------------------*/\n\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { ModelPerInlineEdit } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\nimport { InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from './components/gutterIndicatorView.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineSuggestion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), model.allPositions.read(undefined), inlineEdit.commands, inlineEdit.inlineSuggestion);\n\t});\n\n\tpublic readonly _inlineEditModel = derived<ModelPerInlineEdit | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new ModelPerInlineEdit(model, edit, tabAction);\n\t});\n\n\tpublic readonly view: InlineEditsView;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _showCollapsed: IObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis.view = this._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditModel,\n\t\t\tthis._model.map(model => model ? SimpleInlineSuggestModel.fromInlineCompletionModel(model) : undefined),\n\t\t\tthis._inlineEdit.map(e => e ? InlineSuggestionGutterMenuData.fromInlineSuggestion(e.inlineCompletion) : undefined),\n\t\t\tthis._showCollapsed,\n\t\t));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { ModelPerInlineEdit } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\nimport { InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from './components/gutterIndicatorView.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineSuggestion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), model.allPositions.read(undefined), inlineEdit.commands, inlineEdit.inlineSuggestion);\n\t});\n\n\tpublic readonly _inlineEditModel = derived<ModelPerInlineEdit | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new ModelPerInlineEdit(model, edit, tabAction);\n\t});\n\n\tpublic readonly view: InlineEditsView;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _showCollapsed: IObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis.view = this._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditModel,\n\t\t\tthis._model.map(model => model ? SimpleInlineSuggestModel.fromInlineCompletionModel(model) : undefined),\n\t\t\tthis._inlineEdit.map(e => e ? InlineSuggestionGutterMenuData.fromInlineSuggestion(e.inlineCompletion) : undefined),\n\t\t\tthis._showCollapsed,\n\t\t));\n\t}\n}\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { derived } from '../../../../../../../base/common/observable.js';
|
|
6
|
+
export function setVisualization(data, visualization) {
|
|
7
|
+
// eslint-disable-next-line local/code-no-any-casts
|
|
8
|
+
data['$$visualization'] = visualization;
|
|
9
|
+
}
|
|
10
|
+
export function debugLogRects(rects, elem) {
|
|
11
|
+
if (Array.isArray(rects)) {
|
|
12
|
+
const record = {};
|
|
13
|
+
rects.forEach((rect, index) => {
|
|
14
|
+
record[index.toString()] = rect;
|
|
15
|
+
});
|
|
16
|
+
rects = record;
|
|
17
|
+
}
|
|
18
|
+
setVisualization(rects, new ManyRectVisualizer(rects, elem));
|
|
19
|
+
return rects;
|
|
20
|
+
}
|
|
21
|
+
class ManyRectVisualizer {
|
|
22
|
+
constructor(_rects, _elem) {
|
|
23
|
+
this._rects = _rects;
|
|
24
|
+
this._elem = _elem;
|
|
25
|
+
}
|
|
26
|
+
visualize() {
|
|
27
|
+
const d = [];
|
|
28
|
+
for (const key in this._rects) {
|
|
29
|
+
const v = new HtmlRectVisualizer(this._rects[key], this._elem, key);
|
|
30
|
+
d.push(v.visualize());
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
dispose: () => {
|
|
34
|
+
d.forEach(d => d.dispose());
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class HtmlRectVisualizer {
|
|
40
|
+
constructor(_rect, _elem, _name) {
|
|
41
|
+
this._rect = _rect;
|
|
42
|
+
this._elem = _elem;
|
|
43
|
+
this._name = _name;
|
|
44
|
+
}
|
|
45
|
+
visualize() {
|
|
46
|
+
const div = document.createElement('div');
|
|
47
|
+
div.style.position = 'fixed';
|
|
48
|
+
div.style.border = '1px solid red';
|
|
49
|
+
div.style.boxSizing = 'border-box';
|
|
50
|
+
div.style.pointerEvents = 'none';
|
|
51
|
+
div.style.zIndex = '100000';
|
|
52
|
+
const label = document.createElement('div');
|
|
53
|
+
label.textContent = this._name;
|
|
54
|
+
label.style.position = 'absolute';
|
|
55
|
+
label.style.top = '-20px';
|
|
56
|
+
label.style.left = '0';
|
|
57
|
+
label.style.color = 'red';
|
|
58
|
+
label.style.fontSize = '12px';
|
|
59
|
+
label.style.backgroundColor = 'rgba(255, 255, 255, 0.7)';
|
|
60
|
+
div.appendChild(label);
|
|
61
|
+
const updatePosition = () => {
|
|
62
|
+
const elemRect = this._elem.getBoundingClientRect();
|
|
63
|
+
console.log(elemRect);
|
|
64
|
+
div.style.left = (elemRect.left + this._rect.left) + 'px';
|
|
65
|
+
div.style.top = (elemRect.top + this._rect.top) + 'px';
|
|
66
|
+
div.style.width = this._rect.width + 'px';
|
|
67
|
+
div.style.height = this._rect.height + 'px';
|
|
68
|
+
};
|
|
69
|
+
// This is for debugging only
|
|
70
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
71
|
+
document.body.appendChild(div);
|
|
72
|
+
updatePosition();
|
|
73
|
+
const observer = new ResizeObserver(updatePosition);
|
|
74
|
+
observer.observe(this._elem);
|
|
75
|
+
return {
|
|
76
|
+
dispose: () => {
|
|
77
|
+
observer.disconnect();
|
|
78
|
+
div.remove();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export function debugView(value, reader) {
|
|
84
|
+
if (typeof value === 'object' && value && '$$visualization' in value) {
|
|
85
|
+
const vis = value['$$visualization'];
|
|
86
|
+
debugReadDisposable(vis.visualize(), reader);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function debugReadDisposable(d, reader) {
|
|
90
|
+
derived({ name: 'debugReadDisposable' }, (_reader) => {
|
|
91
|
+
_reader.store.add(d);
|
|
92
|
+
return undefined;
|
|
93
|
+
}).read(reader);
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=debugVisualization.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/debugVisualization.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAW,OAAO,EAAE,MAAM,gDAAgD,CAAC;AAOlF,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,aAAmC;IACjF,mDAAmD;IAClD,IAAY,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAoC,EAAE,IAAiB;IACpF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAyB,EAAE,CAAC;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC7B,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,I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A6B;QAC7B,gDAAgD;QAChD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,cAAc,EAAE,CAAC;QAEjB,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,cAAc,CAAC,CAAC;QACpD,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE7B,OAAO;YACN,OAAO,EAAE,GAAG,EAAE;gBACb,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACtB,GAAG,CAAC,MAAM,EAAE,CAAC;YACd,CAAC;SACD,CAAC;IACH,CAAC;CACD;AAED,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,MAAe;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,iBAAiB,IAAI,KAAK,EAAE,CAAC;QACtE,MAAM,GAAG,GAAG,KAAK,CAAC,iBAAiB,CAAyB,CAAC;QAC7D,mBAAmB,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAAC,CAAc,EAAE,MAAe;IAC3D,OAAO,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE;QACpD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjB,CAAC","file":"debugVisualization.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 *--------------------------------------------------------------------------------------------*/\n\nimport { IDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IReader, derived } from '../../../../../../../base/common/observable.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\n\nexport interface IVisualizationEffect {\n\tvisualize(): IDisposable;\n}\n\nexport function setVisualization(data: object, visualization: IVisualizationEffect): void {\n\t// eslint-disable-next-line local/code-no-any-casts\n\t(data as any)['$$visualization'] = visualization;\n}\n\nexport function debugLogRects(rects: Record<string, Rect> | Rect[], elem: HTMLElement): object {\n\tif (Array.isArray(rects)) {\n\t\tconst record: Record<string, Rect> = {};\n\t\trects.forEach((rect, index) => {\n\t\t\trecord[index.toString()] = rect;\n\t\t});\n\t\trects = record;\n\t}\n\n\tsetVisualization(rects, new ManyRectVisualizer(rects, elem));\n\treturn rects;\n}\n\nclass ManyRectVisualizer implements IVisualizationEffect {\n\tconstructor(\n\t\tprivate readonly _rects: Record<string, Rect>,\n\t\tprivate readonly _elem: HTMLElement\n\t) { }\n\n\tvisualize(): IDisposable {\n\t\tconst d: IDisposable[] = [];\n\t\tfor (const key in this._rects) {\n\t\t\tconst v = new HtmlRectVisualizer(this._rects[key], this._elem, key);\n\t\t\td.push(v.visualize());\n\t\t}\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\td.forEach(d => d.dispose());\n\t\t\t}\n\t\t};\n\t}\n}\n\nclass HtmlRectVisualizer implements IVisualizationEffect {\n\tconstructor(\n\t\tprivate readonly _rect: Rect,\n\t\tprivate readonly _elem: HTMLElement,\n\t\tprivate readonly _name: string\n\t) { }\n\n\tvisualize(): IDisposable {\n\t\tconst div = document.createElement('div');\n\t\tdiv.style.position = 'fixed';\n\t\tdiv.style.border = '1px solid red';\n\t\tdiv.style.boxSizing = 'border-box';\n\t\tdiv.style.pointerEvents = 'none';\n\t\tdiv.style.zIndex = '100000';\n\n\t\tconst label = document.createElement('div');\n\t\tlabel.textContent = this._name;\n\t\tlabel.style.position = 'absolute';\n\t\tlabel.style.top = '-20px';\n\t\tlabel.style.left = '0';\n\t\tlabel.style.color = 'red';\n\t\tlabel.style.fontSize = '12px';\n\t\tlabel.style.backgroundColor = 'rgba(255, 255, 255, 0.7)';\n\t\tdiv.appendChild(label);\n\n\t\tconst updatePosition = () => {\n\t\t\tconst elemRect = this._elem.getBoundingClientRect();\n\t\t\tconsole.log(elemRect);\n\t\t\tdiv.style.left = (elemRect.left + this._rect.left) + 'px';\n\t\t\tdiv.style.top = (elemRect.top + this._rect.top) + 'px';\n\t\t\tdiv.style.width = this._rect.width + 'px';\n\t\t\tdiv.style.height = this._rect.height + 'px';\n\t\t};\n\n\t\t// This is for debugging only\n\t\t// eslint-disable-next-line no-restricted-syntax\n\t\tdocument.body.appendChild(div);\n\t\tupdatePosition();\n\n\t\tconst observer = new ResizeObserver(updatePosition);\n\t\tobserver.observe(this._elem);\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tobserver.disconnect();\n\t\t\t\tdiv.remove();\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport function debugView(value: unknown, reader: IReader): void {\n\tif (typeof value === 'object' && value && '$$visualization' in value) {\n\t\tconst vis = value['$$visualization'] as IVisualizationEffect;\n\t\tdebugReadDisposable(vis.visualize(), reader);\n\t}\n}\n\nfunction debugReadDisposable(d: IDisposable, reader: IReader): void {\n\tderived({ name: 'debugReadDisposable' }, (_reader) => {\n\t\t_reader.store.add(d);\n\t\treturn undefined;\n\t}).read(reader);\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 *--------------------------------------------------------------------------------------------*/\n\nimport { IDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IReader, derived } from '../../../../../../../base/common/observable.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\n\nexport interface IVisualizationEffect {\n\tvisualize(): IDisposable;\n}\n\nexport function setVisualization(data: object, visualization: IVisualizationEffect): void {\n\t// eslint-disable-next-line local/code-no-any-casts\n\t(data as any)['$$visualization'] = visualization;\n}\n\nexport function debugLogRects(rects: Record<string, Rect> | Rect[], elem: HTMLElement): object {\n\tif (Array.isArray(rects)) {\n\t\tconst record: Record<string, Rect> = {};\n\t\trects.forEach((rect, index) => {\n\t\t\trecord[index.toString()] = rect;\n\t\t});\n\t\trects = record;\n\t}\n\n\tsetVisualization(rects, new ManyRectVisualizer(rects, elem));\n\treturn rects;\n}\n\nclass ManyRectVisualizer implements IVisualizationEffect {\n\tconstructor(\n\t\tprivate readonly _rects: Record<string, Rect>,\n\t\tprivate readonly _elem: HTMLElement\n\t) { }\n\n\tvisualize(): IDisposable {\n\t\tconst d: IDisposable[] = [];\n\t\tfor (const key in this._rects) {\n\t\t\tconst v = new HtmlRectVisualizer(this._rects[key], this._elem, key);\n\t\t\td.push(v.visualize());\n\t\t}\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\td.forEach(d => d.dispose());\n\t\t\t}\n\t\t};\n\t}\n}\n\nclass HtmlRectVisualizer implements IVisualizationEffect {\n\tconstructor(\n\t\tprivate readonly _rect: Rect,\n\t\tprivate readonly _elem: HTMLElement,\n\t\tprivate readonly _name: string\n\t) { }\n\n\tvisualize(): IDisposable {\n\t\tconst div = document.createElement('div');\n\t\tdiv.style.position = 'fixed';\n\t\tdiv.style.border = '1px solid red';\n\t\tdiv.style.boxSizing = 'border-box';\n\t\tdiv.style.pointerEvents = 'none';\n\t\tdiv.style.zIndex = '100000';\n\n\t\tconst label = document.createElement('div');\n\t\tlabel.textContent = this._name;\n\t\tlabel.style.position = 'absolute';\n\t\tlabel.style.top = '-20px';\n\t\tlabel.style.left = '0';\n\t\tlabel.style.color = 'red';\n\t\tlabel.style.fontSize = '12px';\n\t\tlabel.style.backgroundColor = 'rgba(255, 255, 255, 0.7)';\n\t\tdiv.appendChild(label);\n\n\t\tconst updatePosition = () => {\n\t\t\tconst elemRect = this._elem.getBoundingClientRect();\n\t\t\tconsole.log(elemRect);\n\t\t\tdiv.style.left = (elemRect.left + this._rect.left) + 'px';\n\t\t\tdiv.style.top = (elemRect.top + this._rect.top) + 'px';\n\t\t\tdiv.style.width = this._rect.width + 'px';\n\t\t\tdiv.style.height = this._rect.height + 'px';\n\t\t};\n\n\t\t// This is for debugging only\n\t\t// eslint-disable-next-line no-restricted-syntax\n\t\tdocument.body.appendChild(div);\n\t\tupdatePosition();\n\n\t\tconst observer = new ResizeObserver(updatePosition);\n\t\tobserver.observe(this._elem);\n\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tobserver.disconnect();\n\t\t\t\tdiv.remove();\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport function debugView(value: unknown, reader: IReader): void {\n\tif (typeof value === 'object' && value && '$$visualization' in value) {\n\t\tconst vis = value['$$visualization'] as IVisualizationEffect;\n\t\tdebugReadDisposable(vis.visualize(), reader);\n\t}\n}\n\nfunction debugReadDisposable(d: IDisposable, reader: IReader): void {\n\tderived({ name: 'debugReadDisposable' }, (_reader) => {\n\t\t_reader.store.add(d);\n\t\treturn undefined;\n\t}).read(reader);\n}\n"]}
|
|
@@ -223,15 +223,23 @@ let InlineEditsInsertionView = class InlineEditsInsertionView extends Disposable
|
|
|
223
223
|
[this._modifiedOverlay],
|
|
224
224
|
]).keepUpdated(this._store);
|
|
225
225
|
this._editorObs = observableCodeEditor(this._editor);
|
|
226
|
-
this._ghostTextView = this._register(instantiationService.createInstance(GhostTextView, this._editor, {
|
|
227
|
-
ghostText
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
226
|
+
this._ghostTextView = this._register(instantiationService.createInstance(GhostTextView, this._editor, derived(reader => {
|
|
227
|
+
const ghostText = this._ghostText.read(reader);
|
|
228
|
+
if (!ghostText) {
|
|
229
|
+
return undefined;
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
ghostText: ghostText,
|
|
233
|
+
handleInlineCompletionShown: (data) => {
|
|
234
|
+
// This is a no-op for the insertion view, as it is handled by the InlineEditsView.
|
|
235
|
+
},
|
|
236
|
+
warning: undefined,
|
|
237
|
+
};
|
|
238
|
+
}), {
|
|
239
|
+
extraClasses: ['inline-edit'],
|
|
240
|
+
isClickable: true,
|
|
241
|
+
shouldKeepCursorStable: true,
|
|
242
|
+
}));
|
|
235
243
|
this.isHovered = this._ghostTextView.isHovered;
|
|
236
244
|
this._register(this._ghostTextView.onDidClick((e) => {
|
|
237
245
|
this._onDidClick.fire(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,0CAA0C,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,OAAO,EAAe,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AAEzF,OAAO,EAAwB,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2FAA2F,CAAC;AACnJ,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MA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,SAAS,CAAC;QAE/C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE;YACnD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;YAClD,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAC3B,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC;YAC/B,mBAAmB,EAAE,KAAK;YAC1B,mBAAmB,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC9C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBAAC,OAAO,CAAC,CAAC;gBAAC,CAAC;gBAChC,OAAO,IAAI,CAAC,uBAAuB,CAAC;YACrC,CAAC,CAAC;SACF,CAAC,CAAC,CAAC;IACL,CAAC;CA+ID,CAAA;AAxRY,wBAAwB;IAkGlC,WAAA,qBAAqB,CAAA;IACrB,WAAA,gBAAgB,CAAA;GAnGN,wBAAwB,CAwRpC","file":"inlineEditsInsertionView.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 { $, n } from '../../../../../../../base/browser/dom.js';\nimport { IMouseEvent } from '../../../../../../../base/browser/mouseEvent.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { constObservable, derived, IObservable, observableValue } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { LineSource, renderLines, RenderOptions } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { ILanguageService } from '../../../../../../common/languages/language.js';\nimport { LineTokens, TokenArray } from '../../../../../../common/tokens/lineTokens.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../../common/viewModel/inlineDecorations.js';\nimport { GhostText, GhostTextPart } from '../../../model/ghostText.js';\nimport { GhostTextView } from '../../ghostText/ghostTextView.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getModifiedBorderColor, modifiedBackgroundColor } from '../theme.js';\nimport { getPrefixTrim, mapOutFalsy } from '../utils/utils.js';\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = 4;\n\nexport class InlineEditsInsertionView extends Disposable implements IInlineEditsView {\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tconst state = this._input.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tif (state.startColumn === 1 && state.lineNumber > 1 && textModel.getLineLength(state.lineNumber) !== 0 && state.text.endsWith(eol) && !state.text.startsWith(eol)) {\n\t\t\tconst endOfLineColumn = textModel.getLineLength(state.lineNumber - 1) + 1;\n\t\t\treturn { lineNumber: state.lineNumber - 1, column: endOfLineColumn, text: eol + state.text.slice(0, -eol.length) };\n\t\t}\n\n\t\treturn { lineNumber: state.lineNumber, column: state.startColumn, text: state.text };\n\t});\n\n\tprivate readonly _trimVertically = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst text = state?.text;\n\t\tif (!text || text.trim() === '') {\n\t\t\treturn { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };\n\t\t}\n\n\t\t// Adjust for leading/trailing newlines\n\t\tconst lineHeight = this._editor.getLineHeightForPosition(new Position(state.lineNumber, 1));\n\t\tconst eol = this._editor.getModel()!.getEOL();\n\t\tlet linesTop = 0;\n\t\tlet linesBottom = 0;\n\n\t\tlet i = 0;\n\t\tfor (; i < text.length && text.startsWith(eol, i); i += eol.length) {\n\t\t\tlinesTop += 1;\n\t\t}\n\n\t\tfor (let j = text.length; j > i && text.endsWith(eol, j); j -= eol.length) {\n\t\t\tlinesBottom += 1;\n\t\t}\n\n\t\treturn { topOffset: linesTop * lineHeight, bottomOffset: linesBottom * lineHeight, linesTop, linesBottom };\n\t});\n\n\tprivate readonly _maxPrefixTrim = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn { prefixLeftOffset: 0, prefixTrim: 0 };\n\t\t}\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst trimVertically = this._trimVertically.read(reader);\n\n\t\tconst lines = state.text.split(eol);\n\t\tconst modifiedLines = lines.slice(trimVertically.linesTop, lines.length - trimVertically.linesBottom);\n\t\tif (trimVertically.linesTop === 0) {\n\t\t\tmodifiedLines[0] = textModel.getLineContent(state.lineNumber) + modifiedLines[0];\n\t\t}\n\n\t\tconst originalRange = new LineRange(state.lineNumber, state.lineNumber + (trimVertically.linesTop > 0 ? 0 : 1));\n\n\t\treturn getPrefixTrim([], originalRange, modifiedLines, this._editor);\n\t});\n\n\tprivate readonly _ghostText = derived<GhostText | undefined>(reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst prefixTrim = this._maxPrefixTrim.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\t\tconst modifiedLines = state.text.split(eol);\n\n\t\tconst inlineDecorations = modifiedLines.map((line, i) => new InlineDecoration(\n\t\t\tnew Range(i + 1, i === 0 ? 1 : prefixTrim.prefixTrim + 1, i + 1, line.length + 1),\n\t\t\t'modified-background',\n\t\t\tInlineDecorationType.Regular\n\t\t));\n\n\t\treturn new GhostText(state.lineNumber, [new GhostTextPart(state.column, state.text, false, inlineDecorations)]);\n\t});\n\n\tprotected readonly _ghostTextView: GhostTextView;\n\treadonly isHovered: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _input: IObservable<{\n\t\t\tlineNumber: number;\n\t\t\tstartColumn: number;\n\t\t\ttext: string;\n\t\t\tinDiffEditor: boolean;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextView = this._register(instantiationService.createInstance(GhostTextView,\n\t\t\tthis._editor,\n\t\t\t{\n\t\t\t\tghostText: this._ghostText,\n\t\t\t\tminReservedLineCount: constObservable(0),\n\t\t\t\ttargetTextModel: this._editorObs.model.map(model => model ?? undefined),\n\t\t\t\twarning: constObservable(undefined),\n\t\t\t\thandleInlineCompletionShown: constObservable(() => {\n\t\t\t\t\t// This is a no-op for the insertion view, as it is handled by the InlineEditsView.\n\t\t\t\t}),\n\t\t\t},\n\t\t\tobservableValue(this, { syntaxHighlightingEnabled: true, extraClasses: ['inline-edit'] }),\n\t\t\ttrue,\n\t\t\ttrue\n\t\t));\n\n\t\tthis.isHovered = this._ghostTextView.isHovered;\n\n\t\tthis._register(this._ghostTextView.onDidClick((e) => {\n\t\t\tthis._onDidClick.fire(e);\n\t\t}));\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._view.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst info = this._overlayLayout.read(reader);\n\t\t\t\tif (info === null) { return 0; }\n\t\t\t\treturn info.minContentWidthRequired;\n\t\t\t}),\n\t\t}));\n\t}\n\n\tprivate readonly _display = derived(this, reader => !!this._state.read(reader) ? 'block' : 'none');\n\n\tprivate readonly _editorMaxContentWidthInRange = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn 0;\n\t\t}\n\t\tthis._editorObs.versionId.read(reader);\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst textBeforeInsertion = state.text.startsWith(eol) ? '' : textModel.getValueInRange(new Range(state.lineNumber, 1, state.lineNumber, state.column));\n\t\tconst textAfterInsertion = textModel.getValueInRange(new Range(state.lineNumber, state.column, state.lineNumber, textModel.getLineLength(state.lineNumber) + 1));\n\t\tconst text = textBeforeInsertion + state.text + textAfterInsertion;\n\t\tconst lines = text.split(eol);\n\n\t\tconst renderOptions = RenderOptions.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0);\n\t\tconst lineWidths = lines.map(line => {\n\t\t\tconst t = textModel.tokenization.tokenizeLinesAt(state.lineNumber, [line])?.[0];\n\t\t\tlet tokens: LineTokens;\n\t\t\tif (t) {\n\t\t\t\ttokens = TokenArray.fromLineTokens(t).toLineTokens(line, this._languageService.languageIdCodec);\n\t\t\t} else {\n\t\t\t\ttokens = LineTokens.createEmpty(line, this._languageService.languageIdCodec);\n\t\t\t}\n\n\t\t\treturn renderLines(new LineSource([tokens]), renderOptions, [], $('div'), true).minWidthInPx;\n\t\t});\n\n\t\t// Take the max value that we observed.\n\t\t// Reset when either the edit changes or the editor text version.\n\t\treturn Math.max(...lineWidths);\n\t});\n\n\tpublic readonly startLineOffset = this._trimVertically.map(v => v.topOffset);\n\tpublic readonly originalLines = this._state.map(s => s ?\n\t\tnew LineRange(\n\t\t\ts.lineNumber,\n\t\t\tMath.min(s.lineNumber + 2, this._editor.getModel()!.getLineCount() + 1)\n\t\t) : undefined\n\t);\n\n\tprivate readonly _overlayLayout = derived(this, (reader) => {\n\t\tthis._ghostText.read(reader);\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Update the overlay when the position changes\n\t\tthis._editorObs.observePosition(observableValue(this, new Position(state.lineNumber, state.column)), reader.store).read(reader);\n\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\t\tconst verticalScrollbarWidth = this._editorObs.layoutInfoVerticalScrollbarWidth.read(reader);\n\n\t\tconst right = editorLayout.contentLeft + this._editorMaxContentWidthInRange.read(reader) - horizontalScrollOffset;\n\t\tconst prefixLeftOffset = this._maxPrefixTrim.read(reader).prefixLeftOffset ?? 0 /* fix due to observable bug? */;\n\t\tconst left = editorLayout.contentLeft + prefixLeftOffset - horizontalScrollOffset;\n\t\tif (right <= left) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { topOffset: topTrim, bottomOffset: bottomTrim } = this._trimVertically.read(reader);\n\n\t\tconst scrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst height = this._ghostTextView.height.read(reader) - topTrim - bottomTrim;\n\t\tconst top = this._editor.getTopForLineNumber(state.lineNumber) - scrollTop + topTrim;\n\t\tconst bottom = top + height;\n\n\t\tconst overlay = new Rect(left, top, right, bottom);\n\n\t\treturn {\n\t\t\toverlay,\n\t\t\tstartsAtContentLeft: prefixLeftOffset === 0,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\t\t\tminContentWidthRequired: prefixLeftOffset + overlay.width + verticalScrollbarWidth,\n\t\t};\n\t}).recomputeInitiallyAndOnChange(this._store);\n\n\tprivate readonly _modifiedOverlay = n.div({\n\t\tstyle: { pointerEvents: 'none', }\n\t}, derived(this, reader => {\n\t\tconst overlayLayoutObs = mapOutFalsy(this._overlayLayout).read(reader);\n\t\tif (!overlayLayoutObs) { return undefined; }\n\n\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t// such that there is a smooth transition at the edge of content left\n\t\tconst overlayHider = overlayLayoutObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\tlayoutInfo.overlay.top,\n\t\t\tlayoutInfo.contentLeft,\n\t\t\tlayoutInfo.overlay.bottom\n\t\t)).read(reader);\n\n\t\tconst separatorWidth = this._input.map(i => i?.inDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH).read(reader);\n\t\tconst overlayRect = overlayLayoutObs.map(l => l.overlay.withMargin(0, BORDER_WIDTH, 0, l.startsAtContentLeft ? 0 : BORDER_WIDTH).intersectHorizontal(new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER)));\n\t\tconst underlayRect = overlayRect.map(rect => rect.withMargin(separatorWidth, separatorWidth));\n\n\t\treturn [\n\t\t\tn.div({\n\t\t\t\tclass: 'originalUnderlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...underlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`,\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: getModifiedBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayHiderInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground),\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\t})).keepUpdated(this._store);\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: this._display,\n\t\t},\n\t}, [\n\t\t[this._modifiedOverlay],\n\t]).keepUpdated(this._store);\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 { $, n } from '../../../../../../../base/browser/dom.js';\nimport { IMouseEvent } from '../../../../../../../base/browser/mouseEvent.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { constObservable, derived, IObservable, observableValue } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { LineSource, renderLines, RenderOptions } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { ILanguageService } from '../../../../../../common/languages/language.js';\nimport { LineTokens, TokenArray } from '../../../../../../common/tokens/lineTokens.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../../common/viewModel/inlineDecorations.js';\nimport { GhostText, GhostTextPart } from '../../../model/ghostText.js';\nimport { GhostTextView } from '../../ghostText/ghostTextView.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getModifiedBorderColor, modifiedBackgroundColor } from '../theme.js';\nimport { getPrefixTrim, mapOutFalsy } from '../utils/utils.js';\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = 4;\n\nexport class InlineEditsInsertionView extends Disposable implements IInlineEditsView {\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tconst state = this._input.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tif (state.startColumn === 1 && state.lineNumber > 1 && textModel.getLineLength(state.lineNumber) !== 0 && state.text.endsWith(eol) && !state.text.startsWith(eol)) {\n\t\t\tconst endOfLineColumn = textModel.getLineLength(state.lineNumber - 1) + 1;\n\t\t\treturn { lineNumber: state.lineNumber - 1, column: endOfLineColumn, text: eol + state.text.slice(0, -eol.length) };\n\t\t}\n\n\t\treturn { lineNumber: state.lineNumber, column: state.startColumn, text: state.text };\n\t});\n\n\tprivate readonly _trimVertically = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst text = state?.text;\n\t\tif (!text || text.trim() === '') {\n\t\t\treturn { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };\n\t\t}\n\n\t\t// Adjust for leading/trailing newlines\n\t\tconst lineHeight = this._editor.getLineHeightForPosition(new Position(state.lineNumber, 1));\n\t\tconst eol = this._editor.getModel()!.getEOL();\n\t\tlet linesTop = 0;\n\t\tlet linesBottom = 0;\n\n\t\tlet i = 0;\n\t\tfor (; i < text.length && text.startsWith(eol, i); i += eol.length) {\n\t\t\tlinesTop += 1;\n\t\t}\n\n\t\tfor (let j = text.length; j > i && text.endsWith(eol, j); j -= eol.length) {\n\t\t\tlinesBottom += 1;\n\t\t}\n\n\t\treturn { topOffset: linesTop * lineHeight, bottomOffset: linesBottom * lineHeight, linesTop, linesBottom };\n\t});\n\n\tprivate readonly _maxPrefixTrim = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn { prefixLeftOffset: 0, prefixTrim: 0 };\n\t\t}\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst trimVertically = this._trimVertically.read(reader);\n\n\t\tconst lines = state.text.split(eol);\n\t\tconst modifiedLines = lines.slice(trimVertically.linesTop, lines.length - trimVertically.linesBottom);\n\t\tif (trimVertically.linesTop === 0) {\n\t\t\tmodifiedLines[0] = textModel.getLineContent(state.lineNumber) + modifiedLines[0];\n\t\t}\n\n\t\tconst originalRange = new LineRange(state.lineNumber, state.lineNumber + (trimVertically.linesTop > 0 ? 0 : 1));\n\n\t\treturn getPrefixTrim([], originalRange, modifiedLines, this._editor);\n\t});\n\n\tprivate readonly _ghostText = derived<GhostText | undefined>(reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst prefixTrim = this._maxPrefixTrim.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\t\tconst modifiedLines = state.text.split(eol);\n\n\t\tconst inlineDecorations = modifiedLines.map((line, i) => new InlineDecoration(\n\t\t\tnew Range(i + 1, i === 0 ? 1 : prefixTrim.prefixTrim + 1, i + 1, line.length + 1),\n\t\t\t'modified-background',\n\t\t\tInlineDecorationType.Regular\n\t\t));\n\n\t\treturn new GhostText(state.lineNumber, [new GhostTextPart(state.column, state.text, false, inlineDecorations)]);\n\t});\n\n\tprotected readonly _ghostTextView: GhostTextView;\n\treadonly isHovered: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _input: IObservable<{\n\t\t\tlineNumber: number;\n\t\t\tstartColumn: number;\n\t\t\ttext: string;\n\t\t\tinDiffEditor: boolean;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextView = this._register(instantiationService.createInstance(GhostTextView,\n\t\t\tthis._editor,\n\t\t\t{\n\t\t\t\tghostText: this._ghostText,\n\t\t\t\tminReservedLineCount: constObservable(0),\n\t\t\t\ttargetTextModel: this._editorObs.model.map(model => model ?? undefined),\n\t\t\t\twarning: constObservable(undefined),\n\t\t\t\thandleInlineCompletionShown: constObservable(() => {\n\t\t\t\t\t// This is a no-op for the insertion view, as it is handled by the InlineEditsView.\n\t\t\t\t}),\n\t\t\t},\n\t\t\tobservableValue(this, { syntaxHighlightingEnabled: true, extraClasses: ['inline-edit'] }),\n\t\t\ttrue,\n\t\t\ttrue\n\t\t));\n\n\t\tthis.isHovered = this._ghostTextView.isHovered;\n\n\t\tthis._register(this._ghostTextView.onDidClick((e) => {\n\t\t\tthis._onDidClick.fire(e);\n\t\t}));\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._view.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst info = this._overlayLayout.read(reader);\n\t\t\t\tif (info === null) { return 0; }\n\t\t\t\treturn info.minContentWidthRequired;\n\t\t\t}),\n\t\t}));\n\t}\n\n\tprivate readonly _display = derived(this, reader => !!this._state.read(reader) ? 'block' : 'none');\n\n\tprivate readonly _editorMaxContentWidthInRange = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn 0;\n\t\t}\n\t\tthis._editorObs.versionId.read(reader);\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst textBeforeInsertion = state.text.startsWith(eol) ? '' : textModel.getValueInRange(new Range(state.lineNumber, 1, state.lineNumber, state.column));\n\t\tconst textAfterInsertion = textModel.getValueInRange(new Range(state.lineNumber, state.column, state.lineNumber, textModel.getLineLength(state.lineNumber) + 1));\n\t\tconst text = textBeforeInsertion + state.text + textAfterInsertion;\n\t\tconst lines = text.split(eol);\n\n\t\tconst renderOptions = RenderOptions.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0);\n\t\tconst lineWidths = lines.map(line => {\n\t\t\tconst t = textModel.tokenization.tokenizeLinesAt(state.lineNumber, [line])?.[0];\n\t\t\tlet tokens: LineTokens;\n\t\t\tif (t) {\n\t\t\t\ttokens = TokenArray.fromLineTokens(t).toLineTokens(line, this._languageService.languageIdCodec);\n\t\t\t} else {\n\t\t\t\ttokens = LineTokens.createEmpty(line, this._languageService.languageIdCodec);\n\t\t\t}\n\n\t\t\treturn renderLines(new LineSource([tokens]), renderOptions, [], $('div'), true).minWidthInPx;\n\t\t});\n\n\t\t// Take the max value that we observed.\n\t\t// Reset when either the edit changes or the editor text version.\n\t\treturn Math.max(...lineWidths);\n\t});\n\n\tpublic readonly startLineOffset = this._trimVertically.map(v => v.topOffset);\n\tpublic readonly originalLines = this._state.map(s => s ?\n\t\tnew LineRange(\n\t\t\ts.lineNumber,\n\t\t\tMath.min(s.lineNumber + 2, this._editor.getModel()!.getLineCount() + 1)\n\t\t) : undefined\n\t);\n\n\tprivate readonly _overlayLayout = derived(this, (reader) => {\n\t\tthis._ghostText.read(reader);\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Update the overlay when the position changes\n\t\tthis._editorObs.observePosition(observableValue(this, new Position(state.lineNumber, state.column)), reader.store).read(reader);\n\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\t\tconst verticalScrollbarWidth = this._editorObs.layoutInfoVerticalScrollbarWidth.read(reader);\n\n\t\tconst right = editorLayout.contentLeft + this._editorMaxContentWidthInRange.read(reader) - horizontalScrollOffset;\n\t\tconst prefixLeftOffset = this._maxPrefixTrim.read(reader).prefixLeftOffset ?? 0 /* fix due to observable bug? */;\n\t\tconst left = editorLayout.contentLeft + prefixLeftOffset - horizontalScrollOffset;\n\t\tif (right <= left) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { topOffset: topTrim, bottomOffset: bottomTrim } = this._trimVertically.read(reader);\n\n\t\tconst scrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst height = this._ghostTextView.height.read(reader) - topTrim - bottomTrim;\n\t\tconst top = this._editor.getTopForLineNumber(state.lineNumber) - scrollTop + topTrim;\n\t\tconst bottom = top + height;\n\n\t\tconst overlay = new Rect(left, top, right, bottom);\n\n\t\treturn {\n\t\t\toverlay,\n\t\t\tstartsAtContentLeft: prefixLeftOffset === 0,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\t\t\tminContentWidthRequired: prefixLeftOffset + overlay.width + verticalScrollbarWidth,\n\t\t};\n\t}).recomputeInitiallyAndOnChange(this._store);\n\n\tprivate readonly _modifiedOverlay = n.div({\n\t\tstyle: { pointerEvents: 'none', }\n\t}, derived(this, reader => {\n\t\tconst overlayLayoutObs = mapOutFalsy(this._overlayLayout).read(reader);\n\t\tif (!overlayLayoutObs) { return undefined; }\n\n\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t// such that there is a smooth transition at the edge of content left\n\t\tconst overlayHider = overlayLayoutObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\tlayoutInfo.overlay.top,\n\t\t\tlayoutInfo.contentLeft,\n\t\t\tlayoutInfo.overlay.bottom\n\t\t)).read(reader);\n\n\t\tconst separatorWidth = this._input.map(i => i?.inDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH).read(reader);\n\t\tconst overlayRect = overlayLayoutObs.map(l => l.overlay.withMargin(0, BORDER_WIDTH, 0, l.startsAtContentLeft ? 0 : BORDER_WIDTH).intersectHorizontal(new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER)));\n\t\tconst underlayRect = overlayRect.map(rect => rect.withMargin(separatorWidth, separatorWidth));\n\n\t\treturn [\n\t\t\tn.div({\n\t\t\t\tclass: 'originalUnderlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...underlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`,\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: getModifiedBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayHiderInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground),\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\t})).keepUpdated(this._store);\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: this._display,\n\t\t},\n\t}, [\n\t\t[this._modifiedOverlay],\n\t]).keepUpdated(this._store);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,0CAA0C,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,OAAO,EAAe,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AAEzF,O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/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 { $, n } from '../../../../../../../base/browser/dom.js';\nimport { IMouseEvent } from '../../../../../../../base/browser/mouseEvent.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { constObservable, derived, IObservable, observableValue } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { LineSource, renderLines, RenderOptions } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { ILanguageService } from '../../../../../../common/languages/language.js';\nimport { LineTokens, TokenArray } from '../../../../../../common/tokens/lineTokens.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../../common/viewModel/inlineDecorations.js';\nimport { GhostText, GhostTextPart } from '../../../model/ghostText.js';\nimport { GhostTextView, IGhostTextWidgetData } from '../../ghostText/ghostTextView.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getModifiedBorderColor, modifiedBackgroundColor } from '../theme.js';\nimport { getPrefixTrim, mapOutFalsy } from '../utils/utils.js';\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = 4;\n\nexport class InlineEditsInsertionView extends Disposable implements IInlineEditsView {\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tconst state = this._input.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tif (state.startColumn === 1 && state.lineNumber > 1 && textModel.getLineLength(state.lineNumber) !== 0 && state.text.endsWith(eol) && !state.text.startsWith(eol)) {\n\t\t\tconst endOfLineColumn = textModel.getLineLength(state.lineNumber - 1) + 1;\n\t\t\treturn { lineNumber: state.lineNumber - 1, column: endOfLineColumn, text: eol + state.text.slice(0, -eol.length) };\n\t\t}\n\n\t\treturn { lineNumber: state.lineNumber, column: state.startColumn, text: state.text };\n\t});\n\n\tprivate readonly _trimVertically = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst text = state?.text;\n\t\tif (!text || text.trim() === '') {\n\t\t\treturn { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };\n\t\t}\n\n\t\t// Adjust for leading/trailing newlines\n\t\tconst lineHeight = this._editor.getLineHeightForPosition(new Position(state.lineNumber, 1));\n\t\tconst eol = this._editor.getModel()!.getEOL();\n\t\tlet linesTop = 0;\n\t\tlet linesBottom = 0;\n\n\t\tlet i = 0;\n\t\tfor (; i < text.length && text.startsWith(eol, i); i += eol.length) {\n\t\t\tlinesTop += 1;\n\t\t}\n\n\t\tfor (let j = text.length; j > i && text.endsWith(eol, j); j -= eol.length) {\n\t\t\tlinesBottom += 1;\n\t\t}\n\n\t\treturn { topOffset: linesTop * lineHeight, bottomOffset: linesBottom * lineHeight, linesTop, linesBottom };\n\t});\n\n\tprivate readonly _maxPrefixTrim = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn { prefixLeftOffset: 0, prefixTrim: 0 };\n\t\t}\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst trimVertically = this._trimVertically.read(reader);\n\n\t\tconst lines = state.text.split(eol);\n\t\tconst modifiedLines = lines.slice(trimVertically.linesTop, lines.length - trimVertically.linesBottom);\n\t\tif (trimVertically.linesTop === 0) {\n\t\t\tmodifiedLines[0] = textModel.getLineContent(state.lineNumber) + modifiedLines[0];\n\t\t}\n\n\t\tconst originalRange = new LineRange(state.lineNumber, state.lineNumber + (trimVertically.linesTop > 0 ? 0 : 1));\n\n\t\treturn getPrefixTrim([], originalRange, modifiedLines, this._editor);\n\t});\n\n\tprivate readonly _ghostText = derived<GhostText | undefined>(reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst prefixTrim = this._maxPrefixTrim.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\t\tconst modifiedLines = state.text.split(eol);\n\n\t\tconst inlineDecorations = modifiedLines.map((line, i) => new InlineDecoration(\n\t\t\tnew Range(i + 1, i === 0 ? 1 : prefixTrim.prefixTrim + 1, i + 1, line.length + 1),\n\t\t\t'modified-background',\n\t\t\tInlineDecorationType.Regular\n\t\t));\n\n\t\treturn new GhostText(state.lineNumber, [new GhostTextPart(state.column, state.text, false, inlineDecorations)]);\n\t});\n\n\tprotected readonly _ghostTextView: GhostTextView;\n\treadonly isHovered: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _input: IObservable<{\n\t\t\tlineNumber: number;\n\t\t\tstartColumn: number;\n\t\t\ttext: string;\n\t\t\tinDiffEditor: boolean;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextView = this._register(instantiationService.createInstance(\n\t\t\tGhostTextView,\n\t\t\tthis._editor,\n\t\t\tderived(reader => {\n\t\t\t\tconst ghostText = this._ghostText.read(reader);\n\t\t\t\tif (!ghostText) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tghostText: ghostText,\n\t\t\t\t\thandleInlineCompletionShown: (data) => {\n\t\t\t\t\t\t// This is a no-op for the insertion view, as it is handled by the InlineEditsView.\n\t\t\t\t\t},\n\t\t\t\t\twarning: undefined,\n\t\t\t\t} satisfies IGhostTextWidgetData;\n\t\t\t}),\n\t\t\t{\n\t\t\t\textraClasses: ['inline-edit'],\n\t\t\t\tisClickable: true,\n\t\t\t\tshouldKeepCursorStable: true,\n\t\t\t}\n\t\t));\n\n\t\tthis.isHovered = this._ghostTextView.isHovered;\n\n\t\tthis._register(this._ghostTextView.onDidClick((e) => {\n\t\t\tthis._onDidClick.fire(e);\n\t\t}));\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._view.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst info = this._overlayLayout.read(reader);\n\t\t\t\tif (info === null) { return 0; }\n\t\t\t\treturn info.minContentWidthRequired;\n\t\t\t}),\n\t\t}));\n\t}\n\n\tprivate readonly _display = derived(this, reader => !!this._state.read(reader) ? 'block' : 'none');\n\n\tprivate readonly _editorMaxContentWidthInRange = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn 0;\n\t\t}\n\t\tthis._editorObs.versionId.read(reader);\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst textBeforeInsertion = state.text.startsWith(eol) ? '' : textModel.getValueInRange(new Range(state.lineNumber, 1, state.lineNumber, state.column));\n\t\tconst textAfterInsertion = textModel.getValueInRange(new Range(state.lineNumber, state.column, state.lineNumber, textModel.getLineLength(state.lineNumber) + 1));\n\t\tconst text = textBeforeInsertion + state.text + textAfterInsertion;\n\t\tconst lines = text.split(eol);\n\n\t\tconst renderOptions = RenderOptions.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0);\n\t\tconst lineWidths = lines.map(line => {\n\t\t\tconst t = textModel.tokenization.tokenizeLinesAt(state.lineNumber, [line])?.[0];\n\t\t\tlet tokens: LineTokens;\n\t\t\tif (t) {\n\t\t\t\ttokens = TokenArray.fromLineTokens(t).toLineTokens(line, this._languageService.languageIdCodec);\n\t\t\t} else {\n\t\t\t\ttokens = LineTokens.createEmpty(line, this._languageService.languageIdCodec);\n\t\t\t}\n\n\t\t\treturn renderLines(new LineSource([tokens]), renderOptions, [], $('div'), true).minWidthInPx;\n\t\t});\n\n\t\t// Take the max value that we observed.\n\t\t// Reset when either the edit changes or the editor text version.\n\t\treturn Math.max(...lineWidths);\n\t});\n\n\tpublic readonly startLineOffset = this._trimVertically.map(v => v.topOffset);\n\tpublic readonly originalLines = this._state.map(s => s ?\n\t\tnew LineRange(\n\t\t\ts.lineNumber,\n\t\t\tMath.min(s.lineNumber + 2, this._editor.getModel()!.getLineCount() + 1)\n\t\t) : undefined\n\t);\n\n\tprivate readonly _overlayLayout = derived(this, (reader) => {\n\t\tthis._ghostText.read(reader);\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Update the overlay when the position changes\n\t\tthis._editorObs.observePosition(observableValue(this, new Position(state.lineNumber, state.column)), reader.store).read(reader);\n\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\t\tconst verticalScrollbarWidth = this._editorObs.layoutInfoVerticalScrollbarWidth.read(reader);\n\n\t\tconst right = editorLayout.contentLeft + this._editorMaxContentWidthInRange.read(reader) - horizontalScrollOffset;\n\t\tconst prefixLeftOffset = this._maxPrefixTrim.read(reader).prefixLeftOffset ?? 0 /* fix due to observable bug? */;\n\t\tconst left = editorLayout.contentLeft + prefixLeftOffset - horizontalScrollOffset;\n\t\tif (right <= left) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { topOffset: topTrim, bottomOffset: bottomTrim } = this._trimVertically.read(reader);\n\n\t\tconst scrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst height = this._ghostTextView.height.read(reader) - topTrim - bottomTrim;\n\t\tconst top = this._editor.getTopForLineNumber(state.lineNumber) - scrollTop + topTrim;\n\t\tconst bottom = top + height;\n\n\t\tconst overlay = new Rect(left, top, right, bottom);\n\n\t\treturn {\n\t\t\toverlay,\n\t\t\tstartsAtContentLeft: prefixLeftOffset === 0,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\t\t\tminContentWidthRequired: prefixLeftOffset + overlay.width + verticalScrollbarWidth,\n\t\t};\n\t}).recomputeInitiallyAndOnChange(this._store);\n\n\tprivate readonly _modifiedOverlay = n.div({\n\t\tstyle: { pointerEvents: 'none', }\n\t}, derived(this, reader => {\n\t\tconst overlayLayoutObs = mapOutFalsy(this._overlayLayout).read(reader);\n\t\tif (!overlayLayoutObs) { return undefined; }\n\n\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t// such that there is a smooth transition at the edge of content left\n\t\tconst overlayHider = overlayLayoutObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\tlayoutInfo.overlay.top,\n\t\t\tlayoutInfo.contentLeft,\n\t\t\tlayoutInfo.overlay.bottom\n\t\t)).read(reader);\n\n\t\tconst separatorWidth = this._input.map(i => i?.inDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH).read(reader);\n\t\tconst overlayRect = overlayLayoutObs.map(l => l.overlay.withMargin(0, BORDER_WIDTH, 0, l.startsAtContentLeft ? 0 : BORDER_WIDTH).intersectHorizontal(new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER)));\n\t\tconst underlayRect = overlayRect.map(rect => rect.withMargin(separatorWidth, separatorWidth));\n\n\t\treturn [\n\t\t\tn.div({\n\t\t\t\tclass: 'originalUnderlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...underlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`,\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: getModifiedBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayHiderInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground),\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\t})).keepUpdated(this._store);\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: this._display,\n\t\t},\n\t}, [\n\t\t[this._modifiedOverlay],\n\t]).keepUpdated(this._store);\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 { $, n } from '../../../../../../../base/browser/dom.js';\nimport { IMouseEvent } from '../../../../../../../base/browser/mouseEvent.js';\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { constObservable, derived, IObservable, observableValue } from '../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { editorBackground } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { LineSource, renderLines, RenderOptions } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { ILanguageService } from '../../../../../../common/languages/language.js';\nimport { LineTokens, TokenArray } from '../../../../../../common/tokens/lineTokens.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../../common/viewModel/inlineDecorations.js';\nimport { GhostText, GhostTextPart } from '../../../model/ghostText.js';\nimport { GhostTextView, IGhostTextWidgetData } from '../../ghostText/ghostTextView.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getModifiedBorderColor, modifiedBackgroundColor } from '../theme.js';\nimport { getPrefixTrim, mapOutFalsy } from '../utils/utils.js';\n\nconst BORDER_WIDTH = 1;\nconst WIDGET_SEPARATOR_WIDTH = 1;\nconst WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3;\nconst BORDER_RADIUS = 4;\n\nexport class InlineEditsInsertionView extends Disposable implements IInlineEditsView {\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tconst state = this._input.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tif (state.startColumn === 1 && state.lineNumber > 1 && textModel.getLineLength(state.lineNumber) !== 0 && state.text.endsWith(eol) && !state.text.startsWith(eol)) {\n\t\t\tconst endOfLineColumn = textModel.getLineLength(state.lineNumber - 1) + 1;\n\t\t\treturn { lineNumber: state.lineNumber - 1, column: endOfLineColumn, text: eol + state.text.slice(0, -eol.length) };\n\t\t}\n\n\t\treturn { lineNumber: state.lineNumber, column: state.startColumn, text: state.text };\n\t});\n\n\tprivate readonly _trimVertically = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst text = state?.text;\n\t\tif (!text || text.trim() === '') {\n\t\t\treturn { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };\n\t\t}\n\n\t\t// Adjust for leading/trailing newlines\n\t\tconst lineHeight = this._editor.getLineHeightForPosition(new Position(state.lineNumber, 1));\n\t\tconst eol = this._editor.getModel()!.getEOL();\n\t\tlet linesTop = 0;\n\t\tlet linesBottom = 0;\n\n\t\tlet i = 0;\n\t\tfor (; i < text.length && text.startsWith(eol, i); i += eol.length) {\n\t\t\tlinesTop += 1;\n\t\t}\n\n\t\tfor (let j = text.length; j > i && text.endsWith(eol, j); j -= eol.length) {\n\t\t\tlinesBottom += 1;\n\t\t}\n\n\t\treturn { topOffset: linesTop * lineHeight, bottomOffset: linesBottom * lineHeight, linesTop, linesBottom };\n\t});\n\n\tprivate readonly _maxPrefixTrim = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn { prefixLeftOffset: 0, prefixTrim: 0 };\n\t\t}\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst trimVertically = this._trimVertically.read(reader);\n\n\t\tconst lines = state.text.split(eol);\n\t\tconst modifiedLines = lines.slice(trimVertically.linesTop, lines.length - trimVertically.linesBottom);\n\t\tif (trimVertically.linesTop === 0) {\n\t\t\tmodifiedLines[0] = textModel.getLineContent(state.lineNumber) + modifiedLines[0];\n\t\t}\n\n\t\tconst originalRange = new LineRange(state.lineNumber, state.lineNumber + (trimVertically.linesTop > 0 ? 0 : 1));\n\n\t\treturn getPrefixTrim([], originalRange, modifiedLines, this._editor);\n\t});\n\n\tprivate readonly _ghostText = derived<GhostText | undefined>(reader => {\n\t\tconst state = this._state.read(reader);\n\t\tconst prefixTrim = this._maxPrefixTrim.read(reader);\n\t\tif (!state) { return undefined; }\n\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\t\tconst modifiedLines = state.text.split(eol);\n\n\t\tconst inlineDecorations = modifiedLines.map((line, i) => new InlineDecoration(\n\t\t\tnew Range(i + 1, i === 0 ? 1 : prefixTrim.prefixTrim + 1, i + 1, line.length + 1),\n\t\t\t'modified-background',\n\t\t\tInlineDecorationType.Regular\n\t\t));\n\n\t\treturn new GhostText(state.lineNumber, [new GhostTextPart(state.column, state.text, false, inlineDecorations)]);\n\t});\n\n\tprotected readonly _ghostTextView: GhostTextView;\n\treadonly isHovered: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _input: IObservable<{\n\t\t\tlineNumber: number;\n\t\t\tstartColumn: number;\n\t\t\ttext: string;\n\t\t\tinDiffEditor: boolean;\n\t\t} | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextView = this._register(instantiationService.createInstance(\n\t\t\tGhostTextView,\n\t\t\tthis._editor,\n\t\t\tderived(reader => {\n\t\t\t\tconst ghostText = this._ghostText.read(reader);\n\t\t\t\tif (!ghostText) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tghostText: ghostText,\n\t\t\t\t\thandleInlineCompletionShown: (data) => {\n\t\t\t\t\t\t// This is a no-op for the insertion view, as it is handled by the InlineEditsView.\n\t\t\t\t\t},\n\t\t\t\t\twarning: undefined,\n\t\t\t\t} satisfies IGhostTextWidgetData;\n\t\t\t}),\n\t\t\t{\n\t\t\t\textraClasses: ['inline-edit'],\n\t\t\t\tisClickable: true,\n\t\t\t\tshouldKeepCursorStable: true,\n\t\t\t}\n\t\t));\n\n\t\tthis.isHovered = this._ghostTextView.isHovered;\n\n\t\tthis._register(this._ghostTextView.onDidClick((e) => {\n\t\t\tthis._onDidClick.fire(e);\n\t\t}));\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._view.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: derived(this, reader => {\n\t\t\t\tconst info = this._overlayLayout.read(reader);\n\t\t\t\tif (info === null) { return 0; }\n\t\t\t\treturn info.minContentWidthRequired;\n\t\t\t}),\n\t\t}));\n\t}\n\n\tprivate readonly _display = derived(this, reader => !!this._state.read(reader) ? 'block' : 'none');\n\n\tprivate readonly _editorMaxContentWidthInRange = derived(this, reader => {\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn 0;\n\t\t}\n\t\tthis._editorObs.versionId.read(reader);\n\t\tconst textModel = this._editor.getModel()!;\n\t\tconst eol = textModel.getEOL();\n\n\t\tconst textBeforeInsertion = state.text.startsWith(eol) ? '' : textModel.getValueInRange(new Range(state.lineNumber, 1, state.lineNumber, state.column));\n\t\tconst textAfterInsertion = textModel.getValueInRange(new Range(state.lineNumber, state.column, state.lineNumber, textModel.getLineLength(state.lineNumber) + 1));\n\t\tconst text = textBeforeInsertion + state.text + textAfterInsertion;\n\t\tconst lines = text.split(eol);\n\n\t\tconst renderOptions = RenderOptions.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0);\n\t\tconst lineWidths = lines.map(line => {\n\t\t\tconst t = textModel.tokenization.tokenizeLinesAt(state.lineNumber, [line])?.[0];\n\t\t\tlet tokens: LineTokens;\n\t\t\tif (t) {\n\t\t\t\ttokens = TokenArray.fromLineTokens(t).toLineTokens(line, this._languageService.languageIdCodec);\n\t\t\t} else {\n\t\t\t\ttokens = LineTokens.createEmpty(line, this._languageService.languageIdCodec);\n\t\t\t}\n\n\t\t\treturn renderLines(new LineSource([tokens]), renderOptions, [], $('div'), true).minWidthInPx;\n\t\t});\n\n\t\t// Take the max value that we observed.\n\t\t// Reset when either the edit changes or the editor text version.\n\t\treturn Math.max(...lineWidths);\n\t});\n\n\tpublic readonly startLineOffset = this._trimVertically.map(v => v.topOffset);\n\tpublic readonly originalLines = this._state.map(s => s ?\n\t\tnew LineRange(\n\t\t\ts.lineNumber,\n\t\t\tMath.min(s.lineNumber + 2, this._editor.getModel()!.getLineCount() + 1)\n\t\t) : undefined\n\t);\n\n\tprivate readonly _overlayLayout = derived(this, (reader) => {\n\t\tthis._ghostText.read(reader);\n\t\tconst state = this._state.read(reader);\n\t\tif (!state) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Update the overlay when the position changes\n\t\tthis._editorObs.observePosition(observableValue(this, new Position(state.lineNumber, state.column)), reader.store).read(reader);\n\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\t\tconst horizontalScrollOffset = this._editorObs.scrollLeft.read(reader);\n\t\tconst verticalScrollbarWidth = this._editorObs.layoutInfoVerticalScrollbarWidth.read(reader);\n\n\t\tconst right = editorLayout.contentLeft + this._editorMaxContentWidthInRange.read(reader) - horizontalScrollOffset;\n\t\tconst prefixLeftOffset = this._maxPrefixTrim.read(reader).prefixLeftOffset ?? 0 /* fix due to observable bug? */;\n\t\tconst left = editorLayout.contentLeft + prefixLeftOffset - horizontalScrollOffset;\n\t\tif (right <= left) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { topOffset: topTrim, bottomOffset: bottomTrim } = this._trimVertically.read(reader);\n\n\t\tconst scrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst height = this._ghostTextView.height.read(reader) - topTrim - bottomTrim;\n\t\tconst top = this._editor.getTopForLineNumber(state.lineNumber) - scrollTop + topTrim;\n\t\tconst bottom = top + height;\n\n\t\tconst overlay = new Rect(left, top, right, bottom);\n\n\t\treturn {\n\t\t\toverlay,\n\t\t\tstartsAtContentLeft: prefixLeftOffset === 0,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\t\t\tminContentWidthRequired: prefixLeftOffset + overlay.width + verticalScrollbarWidth,\n\t\t};\n\t}).recomputeInitiallyAndOnChange(this._store);\n\n\tprivate readonly _modifiedOverlay = n.div({\n\t\tstyle: { pointerEvents: 'none', }\n\t}, derived(this, reader => {\n\t\tconst overlayLayoutObs = mapOutFalsy(this._overlayLayout).read(reader);\n\t\tif (!overlayLayoutObs) { return undefined; }\n\n\t\t// Create an overlay which hides the left hand side of the original overlay when it overflows to the left\n\t\t// such that there is a smooth transition at the edge of content left\n\t\tconst overlayHider = overlayLayoutObs.map(layoutInfo => Rect.fromLeftTopRightBottom(\n\t\t\tlayoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH,\n\t\t\tlayoutInfo.overlay.top,\n\t\t\tlayoutInfo.contentLeft,\n\t\t\tlayoutInfo.overlay.bottom\n\t\t)).read(reader);\n\n\t\tconst separatorWidth = this._input.map(i => i?.inDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH).read(reader);\n\t\tconst overlayRect = overlayLayoutObs.map(l => l.overlay.withMargin(0, BORDER_WIDTH, 0, l.startsAtContentLeft ? 0 : BORDER_WIDTH).intersectHorizontal(new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER)));\n\t\tconst underlayRect = overlayRect.map(rect => rect.withMargin(separatorWidth, separatorWidth));\n\n\t\treturn [\n\t\t\tn.div({\n\t\t\t\tclass: 'originalUnderlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...underlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`,\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayRect.read(reader).toStyles(),\n\t\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\t\tborder: getModifiedBorderColor(this._tabAction).map(bc => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tbackgroundColor: asCssVariable(modifiedBackgroundColor),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'originalOverlayHiderInsertion',\n\t\t\t\tstyle: {\n\t\t\t\t\t...overlayHider.toStyles(),\n\t\t\t\t\tbackgroundColor: asCssVariable(editorBackground),\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\t})).keepUpdated(this._store);\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: this._display,\n\t\t},\n\t}, [\n\t\t[this._modifiedOverlay],\n\t]).keepUpdated(this._store);\n}\n"]}
|