monaco-editor-core 0.56.0-dev-20251125 → 0.56.0-dev-20251217
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 +30 -4
- package/esm/vs/base/browser/dom.js +1 -4
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +25 -11
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +15 -8
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/list/list.css +1 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +11 -2
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +6 -0
- package/esm/vs/base/common/defaultAccount.js.map +1 -0
- package/esm/vs/base/common/equals.js +73 -24
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +14 -4
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keybindings.js +0 -8
- package/esm/vs/base/common/keybindings.js.map +1 -1
- package/esm/vs/base/common/lifecycle.js +2 -2
- package/esm/vs/base/common/lifecycle.js.map +1 -1
- package/esm/vs/base/common/marshallingIds.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +1 -1
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/product.js.map +1 -1
- package/esm/vs/base/common/strings.js +3 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
- package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/view.js +11 -2
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
- package/esm/vs/editor/common/config/fontInfo.js +1 -1
- package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
- package/esm/vs/editor/common/core/edits/edit.js +19 -0
- package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
- package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/textEdit.js +0 -3
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.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/cursor/cursorWordOperations.js +6 -3
- package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
- package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
- package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
- package/esm/vs/editor/common/languages.js +2 -1
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/decorationProvider.js +21 -1
- package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +49 -30
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
- package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +2 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/textModelEvents.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +54 -36
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +14 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +33 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
- 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/inlineCompletions.contribution.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -70
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +59 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +152 -95
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +113 -54
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +317 -75
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
- 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 +29 -8
- 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 +78 -46
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
- 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 +48 -0
- 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 +18 -15
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
- 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/inlineEditsLineReplacementView.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- 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 -32
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
- 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 +19 -15
- 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/sectionHeaders/browser/sectionHeaders.js +3 -2
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
- 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/snippetParser.js +33 -0
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
- 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/stickyScrollController.js +12 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
- package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +34 -3
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.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.css +11 -8
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +11 -5
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
- 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/instantiation/common/instantiation.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +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/log/common/log.js +1 -1
- package/esm/vs/platform/log/common/log.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +6 -6
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +7 -3
- package/esm/vs/platform/quickinput/browser/quickInput.js +19 -11
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
- package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- 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 +21 -21
- package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
- package/esm/vs/platform/window/common/window.js +1 -1
- package/esm/vs/platform/window/common/window.js.map +1 -1
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +34 -3
- package/package.json +2 -2
- package/version.txt +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
- package/esm/vs/platform/product/common/productService.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts","vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts"],"names":[],"mappings":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C;AACF,CAAC","file":"contentWidgets.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 * as dom from '../../../../base/browser/dom.js';\nimport { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\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 * as dom from '../../../../base/browser/dom.js';\nimport { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts","vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAe,iBAA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AAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACR,SAAS;QACT,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","file":"contentWidgets.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 * as dom from '../../../../base/browser/dom.js';\nimport { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tif (!myWidget.useDisplayNone) {\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\tpublic readonly useDisplayNone: boolean;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\t\tthis.useDisplayNone = this._actual.useDisplayNone || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (!this.useDisplayNone && this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\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 * as dom from '../../../../base/browser/dom.js';\nimport { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tif (!myWidget.useDisplayNone) {\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\tpublic readonly useDisplayNone: boolean;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\t\tthis.useDisplayNone = this._actual.useDisplayNone || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (!this.useDisplayNone && this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\n}\n"]}
|
|
@@ -1015,6 +1015,10 @@ let CodeEditorWidget = class CodeEditorWidget extends Disposable {
|
|
|
1015
1015
|
delete this._decorationTypeKeysToIds[decorationTypeKey];
|
|
1016
1016
|
}
|
|
1017
1017
|
if (this._decorationTypeSubtypes.hasOwnProperty(decorationTypeKey)) {
|
|
1018
|
+
const items = this._decorationTypeSubtypes[decorationTypeKey];
|
|
1019
|
+
for (const subType of Object.keys(items)) {
|
|
1020
|
+
this._removeDecorationType(decorationTypeKey + '-' + subType);
|
|
1021
|
+
}
|
|
1018
1022
|
delete this._decorationTypeSubtypes[decorationTypeKey];
|
|
1019
1023
|
}
|
|
1020
1024
|
}
|
|
@@ -1207,6 +1211,12 @@ let CodeEditorWidget = class CodeEditorWidget extends Disposable {
|
|
|
1207
1211
|
}
|
|
1208
1212
|
return this._modelData.view.getOffsetForColumn(lineNumber, column);
|
|
1209
1213
|
}
|
|
1214
|
+
getWidthOfLine(lineNumber) {
|
|
1215
|
+
if (!this._modelData || !this._modelData.hasRealView) {
|
|
1216
|
+
return -1;
|
|
1217
|
+
}
|
|
1218
|
+
return this._modelData.view.getLineWidth(lineNumber);
|
|
1219
|
+
}
|
|
1210
1220
|
render(forceRedraw = false) {
|
|
1211
1221
|
if (!this._modelData || !this._modelData.hasRealView) {
|
|
1212
1222
|
return;
|