monaco-editor-core 0.56.0-dev-20251125 → 0.56.0-dev-20251218
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 +34 -6
- 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/actionbar/actionViewItems.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/findinput/findInput.js +6 -1
- package/esm/vs/base/browser/ui/findinput/findInput.js.map +1 -1
- package/esm/vs/base/browser/ui/inputbox/inputBox.js +17 -1
- package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.css +1 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js +78 -6
- package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
- 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/services/editorWorkerService.js +6 -2
- package/esm/vs/editor/browser/services/editorWorkerService.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/editorConfigurationSchema.js +49 -47
- package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +410 -410
- 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/editorColorRegistry.js +69 -69
- 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/editorContextKeys.js +47 -47
- 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/modesRegistry.js +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 +58 -57
- 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/editStack.js +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/standaloneStrings.js +11 -11
- 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 +3 -3
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +71 -53
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +23 -10
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -10
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- 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 +50 -21
- 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 +25 -27
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +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 +45 -7
- package/esm/vs/platform/quickinput/browser/quickInput.js +51 -15
- 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/quickInputBox.js +13 -1
- package/esm/vs/platform/quickinput/browser/quickInputBox.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +22 -12
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +17 -12
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +36 -8
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +3 -3
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +8 -4
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +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
|
@@ -30,10 +30,10 @@ export class IndentationToSpacesAction extends EditorAction {
|
|
|
30
30
|
constructor() {
|
|
31
31
|
super({
|
|
32
32
|
id: IndentationToSpacesAction.ID,
|
|
33
|
-
label: nls.localize2(
|
|
33
|
+
label: nls.localize2(1155, "Convert Indentation to Spaces"),
|
|
34
34
|
precondition: EditorContextKeys.writable,
|
|
35
35
|
metadata: {
|
|
36
|
-
description: nls.localize2(
|
|
36
|
+
description: nls.localize2(1156, "Convert the tab indentation to spaces."),
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -61,10 +61,10 @@ export class IndentationToTabsAction extends EditorAction {
|
|
|
61
61
|
constructor() {
|
|
62
62
|
super({
|
|
63
63
|
id: IndentationToTabsAction.ID,
|
|
64
|
-
label: nls.localize2(
|
|
64
|
+
label: nls.localize2(1157, "Convert Indentation to Tabs"),
|
|
65
65
|
precondition: EditorContextKeys.writable,
|
|
66
66
|
metadata: {
|
|
67
|
-
description: nls.localize2(
|
|
67
|
+
description: nls.localize2(1158, "Convert the spaces indentation to tabs."),
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}
|
|
@@ -107,17 +107,17 @@ export class ChangeIndentationSizeAction extends EditorAction {
|
|
|
107
107
|
label: n.toString(),
|
|
108
108
|
// add description for tabSize value set in the configuration
|
|
109
109
|
description: (n === creationOpts.tabSize && n === modelOpts.tabSize
|
|
110
|
-
? nls.localize(
|
|
110
|
+
? nls.localize(1151, "Configured Tab Size")
|
|
111
111
|
: n === creationOpts.tabSize
|
|
112
|
-
? nls.localize(
|
|
112
|
+
? nls.localize(1152, "Default Tab Size")
|
|
113
113
|
: n === modelOpts.tabSize
|
|
114
|
-
? nls.localize(
|
|
114
|
+
? nls.localize(1153, "Current Tab Size")
|
|
115
115
|
: undefined)
|
|
116
116
|
}));
|
|
117
117
|
// auto focus the tabSize set for the current editor
|
|
118
118
|
const autoFocusIndex = Math.min(model.getOptions().tabSize - 1, 7);
|
|
119
119
|
setTimeout(() => {
|
|
120
|
-
quickInputService.pick(picks, { placeHolder: nls.localize(
|
|
120
|
+
quickInputService.pick(picks, { placeHolder: nls.localize(1154, "Select Tab Size for Current File"), activeItem: picks[autoFocusIndex] }).then(pick => {
|
|
121
121
|
if (pick) {
|
|
122
122
|
if (model && !model.isDisposed()) {
|
|
123
123
|
const pickedVal = parseInt(pick.label, 10);
|
|
@@ -144,10 +144,10 @@ export class IndentUsingTabs extends ChangeIndentationSizeAction {
|
|
|
144
144
|
constructor() {
|
|
145
145
|
super(false, false, {
|
|
146
146
|
id: IndentUsingTabs.ID,
|
|
147
|
-
label: nls.localize2(
|
|
147
|
+
label: nls.localize2(1159, "Indent Using Tabs"),
|
|
148
148
|
precondition: undefined,
|
|
149
149
|
metadata: {
|
|
150
|
-
description: nls.localize2(
|
|
150
|
+
description: nls.localize2(1160, "Use indentation with tabs."),
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
}
|
|
@@ -157,10 +157,10 @@ export class IndentUsingSpaces extends ChangeIndentationSizeAction {
|
|
|
157
157
|
constructor() {
|
|
158
158
|
super(true, false, {
|
|
159
159
|
id: IndentUsingSpaces.ID,
|
|
160
|
-
label: nls.localize2(
|
|
160
|
+
label: nls.localize2(1161, "Indent Using Spaces"),
|
|
161
161
|
precondition: undefined,
|
|
162
162
|
metadata: {
|
|
163
|
-
description: nls.localize2(
|
|
163
|
+
description: nls.localize2(1162, "Use indentation with spaces."),
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
}
|
|
@@ -170,10 +170,10 @@ export class ChangeTabDisplaySize extends ChangeIndentationSizeAction {
|
|
|
170
170
|
constructor() {
|
|
171
171
|
super(true, true, {
|
|
172
172
|
id: ChangeTabDisplaySize.ID,
|
|
173
|
-
label: nls.localize2(
|
|
173
|
+
label: nls.localize2(1163, "Change Tab Display Size"),
|
|
174
174
|
precondition: undefined,
|
|
175
175
|
metadata: {
|
|
176
|
-
description: nls.localize2(
|
|
176
|
+
description: nls.localize2(1164, "Change the space size equivalent of the tab."),
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
}
|
|
@@ -183,10 +183,10 @@ export class DetectIndentation extends EditorAction {
|
|
|
183
183
|
constructor() {
|
|
184
184
|
super({
|
|
185
185
|
id: DetectIndentation.ID,
|
|
186
|
-
label: nls.localize2(
|
|
186
|
+
label: nls.localize2(1165, "Detect Indentation from Content"),
|
|
187
187
|
precondition: undefined,
|
|
188
188
|
metadata: {
|
|
189
|
-
description: nls.localize2(
|
|
189
|
+
description: nls.localize2(1166, "Detect the indentation from content."),
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
}
|
|
@@ -204,10 +204,10 @@ export class ReindentLinesAction extends EditorAction {
|
|
|
204
204
|
constructor() {
|
|
205
205
|
super({
|
|
206
206
|
id: 'editor.action.reindentlines',
|
|
207
|
-
label: nls.localize2(
|
|
207
|
+
label: nls.localize2(1167, "Reindent Lines"),
|
|
208
208
|
precondition: EditorContextKeys.writable,
|
|
209
209
|
metadata: {
|
|
210
|
-
description: nls.localize2(
|
|
210
|
+
description: nls.localize2(1168, "Reindent the lines of the editor."),
|
|
211
211
|
},
|
|
212
212
|
canTriggerInlineEdits: true,
|
|
213
213
|
});
|
|
@@ -230,10 +230,10 @@ export class ReindentSelectedLinesAction extends EditorAction {
|
|
|
230
230
|
constructor() {
|
|
231
231
|
super({
|
|
232
232
|
id: 'editor.action.reindentselectedlines',
|
|
233
|
-
label: nls.localize2(
|
|
233
|
+
label: nls.localize2(1169, "Reindent Selected Lines"),
|
|
234
234
|
precondition: EditorContextKeys.writable,
|
|
235
235
|
metadata: {
|
|
236
|
-
description: nls.localize2(
|
|
236
|
+
description: nls.localize2(1170, "Reindent the selected lines of the editor."),
|
|
237
237
|
},
|
|
238
238
|
canTriggerInlineEdits: true,
|
|
239
239
|
});
|
|
@@ -220,6 +220,7 @@ let InlayHintsController = class InlayHintsController {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
store.add(inlayHints);
|
|
223
|
+
store.add(toDisposable(() => watchedProviders.clear()));
|
|
223
224
|
this._updateHintsDecorators(inlayHints.ranges, inlayHints.items);
|
|
224
225
|
this._cacheHintsForFastRestore(model);
|
|
225
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts","vs/editor/contrib/inlayHints/browser/inlayHintsController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE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AM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAElC,MAAM,EAAE,kBAAkB,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACtE,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC5E,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC5I,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5C,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,oCAAoC;QAC1E,OAAO,MAAM,CAAC;IACf,CAAC;YAAS,CAAC;QACV,GAAG,CAAC,OAAO,EAAE,CAAC;IACf,CAAC;AACF,CAAC,CAAC,CAAC","file":"inlayHintsController.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 { isHTMLElement, ModifierKeyEmitter } from '../../../../base/browser/dom.js';\nimport { isNonEmptyArray } from '../../../../base/common/arrays.js';\nimport { disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { LRUCache } from '../../../../base/common/map.js';\nimport { IRange } from '../../../../base/common/range.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ClassNameReference, CssProperties, DynamicCssRules } from '../../../browser/editorDom.js';\nimport { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport { EditOperation } from '../../../common/core/editOperation.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport * as languages from '../../../common/languages.js';\nimport { IModelDeltaDecoration, InjectedTextCursorStops, InjectedTextOptions, ITextModel, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ITextModelService } from '../../../common/services/resolverService.js';\nimport { ClickLinkGesture, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js';\nimport { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from './inlayHints.js';\nimport { goToDefinitionWithLocation, showGoToContextMenu } from './inlayHintsLocations.js';\nimport { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';\nimport * as colors from '../../../../platform/theme/common/colorRegistry.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { Position } from '../../../common/core/position.js';\n\n// --- hint caching service (per session)\n\nclass InlayHintsCache {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _entries = new LRUCache<string, InlayHintItem[]>(50);\n\n\tget(model: ITextModel): InlayHintItem[] | undefined {\n\t\tconst key = InlayHintsCache._key(model);\n\t\treturn this._entries.get(key);\n\t}\n\n\tset(model: ITextModel, value: InlayHintItem[]): void {\n\t\tconst key = InlayHintsCache._key(model);\n\t\tthis._entries.set(key, value);\n\t}\n\n\tprivate static _key(model: ITextModel): string {\n\t\treturn `${model.uri.toString()}/${model.getVersionId()}`;\n\t}\n}\n\ninterface IInlayHintsCache extends InlayHintsCache { }\nconst IInlayHintsCache = createDecorator<IInlayHintsCache>('IInlayHintsCache');\nregisterSingleton(IInlayHintsCache, InlayHintsCache, InstantiationType.Delayed);\n\n// --- rendered label\n\nexport class RenderedInlayHintLabelPart {\n\tconstructor(readonly item: InlayHintItem, readonly index: number) { }\n\n\tget part() {\n\t\tconst label = this.item.hint.label;\n\t\tif (typeof label === 'string') {\n\t\t\treturn { label };\n\t\t} else {\n\t\t\treturn label[this.index];\n\t\t}\n\t}\n}\n\nclass ActiveInlayHintInfo {\n\tconstructor(readonly part: RenderedInlayHintLabelPart, readonly hasTriggerModifier: boolean) { }\n}\n\ntype InlayHintDecorationRenderInfo = {\n\titem: InlayHintItem;\n\tdecoration: IModelDeltaDecoration;\n\tclassNameRef: ClassNameReference;\n};\n\nconst enum RenderMode {\n\tNormal,\n\tInvisible\n}\n\n\n\n/**\n * Mix of CancellationTokenSource, DisposableStore and MutableDisposable\n */\nclass CancellationStore implements IDisposable {\n\n\tprivate readonly _store = new MutableDisposable<DisposableStore>();\n\tprivate _tokenSource = new CancellationTokenSource();\n\n\tdispose() {\n\t\tthis._store.dispose();\n\t\tthis._tokenSource.dispose(true);\n\t}\n\n\treset() {\n\t\tthis._tokenSource.dispose(true);\n\t\tthis._tokenSource = new CancellationTokenSource();\n\t\tthis._store.value = new DisposableStore();\n\n\t\treturn {\n\t\t\tstore: this._store.value,\n\t\t\ttoken: this._tokenSource.token\n\t\t};\n\t}\n}\n\n\n// --- controller\n\n\nexport class InlayHintsController implements IEditorContribution {\n\n\tstatic readonly ID: string = 'editor.contrib.InlayHints';\n\n\tprivate static readonly _MAX_DECORATORS = 1500;\n\tprivate static readonly _whitespaceData = {};\n\n\tstatic get(editor: ICodeEditor): InlayHintsController | undefined {\n\t\treturn editor.getContribution<InlayHintsController>(InlayHintsController.ID) ?? undefined;\n\t}\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _sessionDisposables = new DisposableStore();\n\tprivate readonly _decorationsMetadata = new Map<string, InlayHintDecorationRenderInfo>();\n\tprivate readonly _debounceInfo: IFeatureDebounceInformation;\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate _cursorInfo?: { position: Position; notEarlierThan: number };\n\tprivate _activeRenderMode = RenderMode.Normal;\n\tprivate _activeInlayHintPart?: ActiveInlayHintInfo;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService _featureDebounce: ILanguageFeatureDebounceService,\n\t\t@IInlayHintsCache private readonly _inlayHintsCache: IInlayHintsCache,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IInstantiationService private readonly _instaService: IInstantiationService,\n\t) {\n\t\tthis._ruleFactory = this._disposables.add(new DynamicCssRules(this._editor));\n\t\tthis._debounceInfo = _featureDebounce.for(_languageFeaturesService.inlayHintsProvider, 'InlayHint', { min: 25 });\n\t\tthis._disposables.add(_languageFeaturesService.inlayHintsProvider.onDidChange(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t\tthis._update();\n\n\t}\n\n\tdispose(): void {\n\t\tthis._sessionDisposables.dispose();\n\t\tthis._removeAllDecorations();\n\t\tthis._disposables.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tthis._sessionDisposables.clear();\n\t\tthis._removeAllDecorations();\n\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tif (options.enabled === 'off') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model || !this._languageFeaturesService.inlayHintsProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options.enabled === 'on') {\n\t\t\t// different \"on\" modes: always\n\t\t\tthis._activeRenderMode = RenderMode.Normal;\n\t\t} else {\n\t\t\t// different \"on\" modes: offUnlessPressed, or onUnlessPressed\n\t\t\tlet defaultMode: RenderMode;\n\t\t\tlet altMode: RenderMode;\n\t\t\tif (options.enabled === 'onUnlessPressed') {\n\t\t\t\tdefaultMode = RenderMode.Normal;\n\t\t\t\taltMode = RenderMode.Invisible;\n\t\t\t} else {\n\t\t\t\tdefaultMode = RenderMode.Invisible;\n\t\t\t\taltMode = RenderMode.Normal;\n\t\t\t}\n\t\t\tthis._activeRenderMode = defaultMode;\n\n\t\t\tthis._sessionDisposables.add(ModifierKeyEmitter.getInstance().event(e => {\n\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst newRenderMode = e.altKey && e.ctrlKey && !(e.shiftKey || e.metaKey) ? altMode : defaultMode;\n\t\t\t\tif (newRenderMode !== this._activeRenderMode) {\n\t\t\t\t\tthis._activeRenderMode = newRenderMode;\n\t\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\t\tconst copies = this._copyInlayHintsWithCurrentAnchor(model);\n\t\t\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], copies);\n\t\t\t\t\tscheduler.schedule(0);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\t// iff possible, quickly update from cache\n\t\tconst cached = this._inlayHintsCache.get(model);\n\t\tif (cached) {\n\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], cached);\n\t\t}\n\t\tthis._sessionDisposables.add(toDisposable(() => {\n\t\t\t// cache items when switching files etc\n\t\t\tif (!model.isDisposed()) {\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\t\t\t}\n\t\t}));\n\n\t\tlet cts: CancellationTokenSource | undefined;\n\t\tconst watchedProviders = new Set<languages.InlayHintsProvider>();\n\n\t\tthis._sessionDisposables.add(model.onWillDispose(() => cts?.cancel()));\n\n\t\tconst cancellationStore = this._sessionDisposables.add(new CancellationStore());\n\n\t\tconst scheduler = new RunOnceScheduler(async () => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tconst { store, token } = cancellationStore.reset();\n\n\t\t\ttry {\n\t\t\t\tconst inlayHints = await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider, model, this._getHintsRanges(), token);\n\t\t\t\tscheduler.delay = this._debounceInfo.update(model, Date.now() - t1);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\tinlayHints.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// listen to provider changes\n\t\t\t\tfor (const provider of inlayHints.provider) {\n\t\t\t\t\tif (typeof provider.onDidChangeInlayHints === 'function' && !watchedProviders.has(provider)) {\n\t\t\t\t\t\twatchedProviders.add(provider);\n\t\t\t\t\t\tstore.add(provider.onDidChangeInlayHints(() => {\n\t\t\t\t\t\t\tif (!scheduler.isScheduled()) { // ignore event when request is already scheduled\n\t\t\t\t\t\t\t\tscheduler.schedule();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstore.add(inlayHints);\n\t\t\t\tthis._updateHintsDecorators(inlayHints.ranges, inlayHints.items);\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}, this._debounceInfo.get(model));\n\n\t\tthis._sessionDisposables.add(scheduler);\n\t\tscheduler.schedule(0);\n\n\t\tthis._sessionDisposables.add(this._editor.onDidScrollChange((e) => {\n\t\t\t// update when scroll position changes\n\t\t\t// uses scrollTopChanged has weak heuristic to differenatiate between scrolling due to\n\t\t\t// typing or due to \"actual\" scrolling\n\t\t\tif (e.scrollTopChanged || !scheduler.isScheduled()) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tconst cursor = this._sessionDisposables.add(new MutableDisposable());\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tcts?.cancel();\n\n\t\t\t// mark current cursor position and time after which the whole can be updated/redrawn\n\t\t\tconst delay = Math.max(scheduler.delay, 800);\n\t\t\tthis._cursorInfo = { position: this._editor.getPosition()!, notEarlierThan: Date.now() + delay };\n\t\t\tcursor.value = disposableTimeout(() => scheduler.schedule(0), delay);\n\n\t\t\tscheduler.schedule();\n\t\t}));\n\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\t// mouse gestures\n\t\tthis._sessionDisposables.add(this._installDblClickGesture(() => scheduler.schedule(0)));\n\t\tthis._sessionDisposables.add(this._installLinkGesture());\n\t\tthis._sessionDisposables.add(this._installContextMenu());\n\t}\n\n\tprivate _installLinkGesture(): IDisposable {\n\n\t\tconst store = new DisposableStore();\n\t\tconst gesture = store.add(new ClickLinkGesture(this._editor));\n\n\t\t// let removeHighlight = () => { };\n\n\t\tconst sessionStore = new DisposableStore();\n\t\tstore.add(sessionStore);\n\n\t\tstore.add(gesture.onMouseMoveOrRelevantKeyDown(e => {\n\t\t\tconst [mouseEvent] = e;\n\t\t\tconst labelPart = this._getInlayHintLabelPart(mouseEvent);\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (!labelPart || !model) {\n\t\t\t\tsessionStore.clear();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// resolve the item\n\t\t\tconst cts = new CancellationTokenSource();\n\t\t\tsessionStore.add(toDisposable(() => cts.dispose(true)));\n\t\t\tlabelPart.item.resolve(cts.token);\n\n\t\t\t// render link => when the modifier is pressed and when there is a command or location\n\t\t\tthis._activeInlayHintPart = labelPart.part.command || labelPart.part.location\n\t\t\t\t? new ActiveInlayHintInfo(labelPart, mouseEvent.hasTriggerModifier)\n\t\t\t\t: undefined;\n\n\t\t\tconst lineNumber = model.validatePosition(labelPart.item.hint.position).lineNumber;\n\t\t\tconst range = new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber));\n\t\t\tconst lineHints = this._getInlineHintsForRange(range);\n\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\tsessionStore.add(toDisposable(() => {\n\t\t\t\tthis._activeInlayHintPart = undefined;\n\t\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\t}));\n\t\t}));\n\t\tstore.add(gesture.onCancel(() => sessionStore.clear()));\n\t\tstore.add(gesture.onExecute(async e => {\n\t\t\tconst label = this._getInlayHintLabelPart(e);\n\t\t\tif (label) {\n\t\t\t\tconst part = label.part;\n\t\t\t\tif (part.location) {\n\t\t\t\t\t// location -> execute go to def\n\t\t\t\t\tthis._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor as IActiveCodeEditor, part.location);\n\t\t\t\t} else if (languages.Command.is(part.command)) {\n\t\t\t\t\t// command -> execute it\n\t\t\t\t\tawait this._invokeCommand(part.command, label.item);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\treturn store;\n\t}\n\n\tprivate _getInlineHintsForRange(range: Range) {\n\t\tconst lineHints = new Set<InlayHintItem>();\n\t\tfor (const data of this._decorationsMetadata.values()) {\n\t\t\tif (range.containsRange(data.item.anchor.range)) {\n\t\t\t\tlineHints.add(data.item);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(lineHints);\n\t}\n\n\tprivate _installDblClickGesture(updateInlayHints: Function): IDisposable {\n\t\treturn this._editor.onMouseUp(async e => {\n\t\t\tif (e.event.detail !== 2) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (!part) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.event.preventDefault();\n\t\t\tawait part.item.resolve(CancellationToken.None);\n\t\t\tif (isNonEmptyArray(part.item.hint.textEdits)) {\n\t\t\t\tconst edits = part.item.hint.textEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));\n\t\t\t\tthis._editor.executeEdits('inlayHint.default', edits);\n\t\t\t\tupdateInlayHints();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _installContextMenu(): IDisposable {\n\t\treturn this._editor.onContextMenu(async e => {\n\t\t\tif (!(isHTMLElement(e.event.target))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (part) {\n\t\t\t\tawait this._instaService.invokeFunction(showGoToContextMenu, this._editor, e.event.target, part);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _getInlayHintLabelPart(e: IEditorMouseEvent | ClickLinkMouseEvent): RenderedInlayHintLabelPart | undefined {\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst options = e.target.detail.injectedText?.options;\n\t\tif (options instanceof ModelDecorationInjectedTextOptions && options?.attachedData instanceof RenderedInlayHintLabelPart) {\n\t\t\treturn options.attachedData;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate async _invokeCommand(command: languages.Command, item: InlayHintItem) {\n\t\ttry {\n\t\t\tawait this._commandService.executeCommand(command.id, ...(command.arguments ?? []));\n\t\t} catch (err) {\n\t\t\tthis._notificationService.notify({\n\t\t\t\tseverity: Severity.Error,\n\t\t\t\tsource: item.provider.displayName,\n\t\t\t\tmessage: err\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _cacheHintsForFastRestore(model: ITextModel): void {\n\t\tconst hints = this._copyInlayHintsWithCurrentAnchor(model);\n\t\tthis._inlayHintsCache.set(model, hints);\n\t}\n\n\t// return inlay hints but with an anchor that reflects \"updates\"\n\t// that happened after receiving them, e.g adding new lines before a hint\n\tprivate _copyInlayHintsWithCurrentAnchor(model: ITextModel): InlayHintItem[] {\n\t\tconst items = new Map<InlayHintItem, InlayHintItem>();\n\t\tfor (const [id, obj] of this._decorationsMetadata) {\n\t\t\tif (items.has(obj.item)) {\n\t\t\t\t// an inlay item can be rendered as multiple decorations\n\t\t\t\t// but they will all uses the same range\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst range = model.getDecorationRange(id);\n\t\t\tif (range) {\n\t\t\t\t// update range with whatever the editor has tweaked it to\n\t\t\t\tconst anchor = new InlayHintAnchor(range, obj.item.anchor.direction);\n\t\t\t\tconst copy = obj.item.with({ anchor });\n\t\t\t\titems.set(obj.item, copy);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(items.values());\n\t}\n\n\tprivate _getHintsRanges(): Range[] {\n\t\tconst extra = 30;\n\t\tconst model = this._editor.getModel()!;\n\t\tconst visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow();\n\t\tconst result: Range[] = [];\n\t\tfor (const range of visibleRanges.sort(Range.compareRangesUsingStarts)) {\n\t\t\tconst extendedRange = model.validateRange(new Range(range.startLineNumber - extra, range.startColumn, range.endLineNumber + extra, range.endColumn));\n\t\t\tif (result.length === 0 || !Range.areIntersectingOrTouching(result[result.length - 1], extendedRange)) {\n\t\t\t\tresult.push(extendedRange);\n\t\t\t} else {\n\t\t\t\tresult[result.length - 1] = Range.plusRange(result[result.length - 1], extendedRange);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _updateHintsDecorators(ranges: readonly Range[], items: readonly InlayHintItem[]): void {\n\n\t\tconst itemFixedLengths = new Map<InlayHintItem, number>();\n\n\t\tif (this._cursorInfo\n\t\t\t&& this._cursorInfo.notEarlierThan > Date.now()\n\t\t\t&& ranges.some(range => range.containsPosition(this._cursorInfo!.position))\n\t\t) {\n\t\t\t// collect inlay hints that are on the same line and before the cursor. Those \"old\" hints\n\t\t\t// define fixed lengths so that the cursor does not jump back and worth while typing.\n\t\t\tconst { position } = this._cursorInfo;\n\t\t\tthis._cursorInfo = undefined;\n\n\t\t\tconst lengths = new Map<InlayHintItem, number>();\n\n\t\t\tfor (const deco of this._editor.getLineDecorations(position.lineNumber) ?? []) {\n\n\t\t\t\tconst data = this._decorationsMetadata.get(deco.id);\n\t\t\t\tif (deco.range.startColumn > position.column) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst opts = data?.decoration.options[data.item.anchor.direction];\n\t\t\t\tif (opts && opts.attachedData !== InlayHintsController._whitespaceData) {\n\t\t\t\t\tconst len = lengths.get(data.item) ?? 0;\n\t\t\t\t\tlengths.set(data.item, len + opts.content.length);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// on the cursor line and before the cursor-column\n\t\t\tconst newItemsWithFixedLength = items.filter(item => item.anchor.range.startLineNumber === position.lineNumber && item.anchor.range.endColumn <= position.column);\n\t\t\tconst fixedLengths = Array.from(lengths.values());\n\n\t\t\t// match up fixed lengths with items and distribute the remaining lengths to the last item\n\t\t\tlet lastItem: InlayHintItem | undefined;\n\t\t\twhile (true) {\n\t\t\t\tconst targetItem = newItemsWithFixedLength.shift();\n\t\t\t\tconst fixedLength = fixedLengths.shift();\n\n\t\t\t\tif (!fixedLength && !targetItem) {\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\n\t\t\t\tif (targetItem) {\n\t\t\t\t\titemFixedLengths.set(targetItem, fixedLength ?? 0);\n\t\t\t\t\tlastItem = targetItem;\n\n\t\t\t\t} else if (lastItem && fixedLength) {\n\t\t\t\t\t// still lengths but no more item. give it all to the last\n\t\t\t\t\tlet len = itemFixedLengths.get(lastItem)!;\n\t\t\t\t\tlen += fixedLength;\n\t\t\t\t\tlen += fixedLengths.reduce((p, c) => p + c, 0);\n\t\t\t\t\tfixedLengths.length = 0;\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// utils to collect/create injected text decorations\n\t\tconst newDecorationsData: InlayHintDecorationRenderInfo[] = [];\n\t\tconst addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart | object): void => {\n\t\t\tconst opts: InjectedTextOptions = {\n\t\t\t\tcontent,\n\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\tinlineClassName: ref.className,\n\t\t\t\tcursorStops,\n\t\t\t\tattachedData\n\t\t\t};\n\t\t\tnewDecorationsData.push({\n\t\t\t\titem,\n\t\t\t\tclassNameRef: ref,\n\t\t\t\tdecoration: {\n\t\t\t\t\trange: item.anchor.range,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// className: \"rangeHighlight\", // DEBUG highlight to see to what range a hint is attached\n\t\t\t\t\t\tdescription: 'InlayHint',\n\t\t\t\t\t\tshowIfCollapsed: item.anchor.range.isEmpty(), // \"original\" range is empty\n\t\t\t\t\t\tcollapseOnReplaceEdit: !item.anchor.range.isEmpty(),\n\t\t\t\t\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\t\t\t\t\t[item.anchor.direction]: this._activeRenderMode === RenderMode.Normal ? opts : undefined\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst addInjectedWhitespace = (item: InlayHintItem, isLast: boolean): void => {\n\t\t\tconst marginRule = this._ruleFactory.createClassNameRef({\n\t\t\t\twidth: `${(fontSize / 3) | 0}px`,\n\t\t\t\tdisplay: 'inline-block'\n\t\t\t});\n\t\t\taddInjectedText(item, marginRule, '\\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, InlayHintsController._whitespaceData);\n\t\t};\n\n\n\t\t//\n\t\tconst { fontSize, fontFamily, padding, isUniform } = this._getLayoutInfo();\n\t\tconst maxLength = this._editor.getOption(EditorOption.inlayHints).maximumLength;\n\t\tconst fontFamilyVar = '--code-editorInlayHintsFontFamily';\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily);\n\n\n\t\ttype ILineInfo = { line: number; totalLen: number };\n\t\tlet currentLineInfo: ILineInfo = { line: 0, totalLen: 0 };\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst item = items[i];\n\n\t\t\tif (currentLineInfo.line !== item.anchor.range.startLineNumber) {\n\t\t\t\tcurrentLineInfo = { line: item.anchor.range.startLineNumber, totalLen: 0 };\n\t\t\t}\n\n\t\t\tif (maxLength && currentLineInfo.totalLen > maxLength) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// whitespace leading the actual label\n\t\t\tif (item.hint.paddingLeft) {\n\t\t\t\taddInjectedWhitespace(item, false);\n\t\t\t}\n\n\t\t\t// the label with its parts\n\t\t\tconst parts: languages.InlayHintLabelPart[] = typeof item.hint.label === 'string'\n\t\t\t\t? [{ label: item.hint.label }]\n\t\t\t\t: item.hint.label;\n\n\t\t\tconst itemFixedLength = itemFixedLengths.get(item);\n\t\t\tlet itemActualLength = 0;\n\n\t\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\t\tconst part = parts[i];\n\n\t\t\t\tconst isFirst = i === 0;\n\t\t\t\tconst isLast = i === parts.length - 1;\n\n\t\t\t\tconst cssProperties: CssProperties = {\n\t\t\t\t\tfontSize: `${fontSize}px`,\n\t\t\t\t\tfontFamily: `var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}`,\n\t\t\t\t\tverticalAlign: isUniform ? 'baseline' : 'middle',\n\t\t\t\t\tunicodeBidi: 'isolate'\n\t\t\t\t};\n\n\t\t\t\tif (isNonEmptyArray(item.hint.textEdits)) {\n\t\t\t\t\tcssProperties.cursor = 'default';\n\t\t\t\t}\n\n\t\t\t\tthis._fillInColors(cssProperties, item.hint);\n\n\t\t\t\tif ((part.command || part.location) && this._activeInlayHintPart?.part.item === item && this._activeInlayHintPart.part.index === i) {\n\t\t\t\t\t// active link!\n\t\t\t\t\tcssProperties.textDecoration = 'underline';\n\t\t\t\t\tif (this._activeInlayHintPart.hasTriggerModifier) {\n\t\t\t\t\t\tcssProperties.color = themeColorFromId(colors.editorActiveLinkForeground);\n\t\t\t\t\t\tcssProperties.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet textlabel = part.label;\n\t\t\t\tcurrentLineInfo.totalLen += textlabel.length;\n\t\t\t\tlet tooLong = false;\n\t\t\t\tconst over = maxLength !== 0 ? (currentLineInfo.totalLen - maxLength) : 0;\n\t\t\t\tif (over > 0) {\n\t\t\t\t\ttextlabel = textlabel.slice(0, -over) + '…';\n\t\t\t\t\ttooLong = true;\n\t\t\t\t}\n\n\t\t\t\titemActualLength += textlabel.length;\n\n\t\t\t\tif (itemFixedLength !== undefined) {\n\t\t\t\t\tconst overFixedLength = itemActualLength - itemFixedLength;\n\t\t\t\t\tif (overFixedLength >= 0) {\n\t\t\t\t\t\t// longer than fixed length, trim\n\t\t\t\t\t\titemActualLength -= overFixedLength;\n\t\t\t\t\t\ttextlabel = textlabel.slice(0, -(1 + overFixedLength)) + '…';\n\t\t\t\t\t\ttooLong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (padding) {\n\t\t\t\t\tif (isFirst && (isLast || tooLong)) {\n\t\t\t\t\t\t// only element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if (isFirst) {\n\t\t\t\t\t\t// first element\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px 0 0 ${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if ((isLast || tooLong)) {\n\t\t\t\t\t\t// last element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`;\n\t\t\t\t\t\tcssProperties.borderRadius = `0 ${(fontSize / 4) | 0}px ${(fontSize / 4) | 0}px 0`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px 0`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef(cssProperties),\n\t\t\t\t\tfixSpace(textlabel),\n\t\t\t\t\tisLast && !item.hint.paddingRight ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None,\n\t\t\t\t\tnew RenderedInlayHintLabelPart(item, i)\n\t\t\t\t);\n\n\t\t\t\tif (tooLong) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (itemFixedLength !== undefined && itemActualLength < itemFixedLength) {\n\t\t\t\t// shorter than fixed length, pad\n\t\t\t\tconst pad = (itemFixedLength - itemActualLength);\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef({}),\n\t\t\t\t\t'\\u200a'.repeat(pad),\n\t\t\t\t\tInjectedTextCursorStops.None\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// whitespace trailing the actual label\n\t\t\tif (item.hint.paddingRight) {\n\t\t\t\taddInjectedWhitespace(item, true);\n\t\t\t}\n\n\t\t\tif (newDecorationsData.length > InlayHintsController._MAX_DECORATORS) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// collect all decoration ids that are affected by the ranges\n\t\t// and only update those decorations\n\t\tconst decorationIdsToReplace: string[] = [];\n\t\tfor (const [id, metadata] of this._decorationsMetadata) {\n\t\t\tconst range = this._editor.getModel()?.getDecorationRange(id);\n\t\t\tif (range && ranges.some(r => r.containsRange(range))) {\n\t\t\t\tdecorationIdsToReplace.push(id);\n\t\t\t\tmetadata.classNameRef.dispose();\n\t\t\t\tthis._decorationsMetadata.delete(id);\n\t\t\t}\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\n\t\tthis._editor.changeDecorations(accessor => {\n\t\t\tconst newDecorationIds = accessor.deltaDecorations(decorationIdsToReplace, newDecorationsData.map(d => d.decoration));\n\t\t\tfor (let i = 0; i < newDecorationIds.length; i++) {\n\t\t\t\tconst data = newDecorationsData[i];\n\t\t\t\tthis._decorationsMetadata.set(newDecorationIds[i], data);\n\t\t\t}\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _fillInColors(props: CssProperties, hint: languages.InlayHint): void {\n\t\tif (hint.kind === languages.InlayHintKind.Parameter) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintParameterBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintParameterForeground);\n\t\t} else if (hint.kind === languages.InlayHintKind.Type) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintTypeBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintTypeForeground);\n\t\t} else {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintForeground);\n\t\t}\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tconst padding = options.padding;\n\n\t\tconst editorFontSize = this._editor.getOption(EditorOption.fontSize);\n\t\tconst editorFontFamily = this._editor.getOption(EditorOption.fontFamily);\n\n\t\tlet fontSize = options.fontSize;\n\t\tif (!fontSize || fontSize < 5 || fontSize > editorFontSize) {\n\t\t\tfontSize = editorFontSize;\n\t\t}\n\n\t\tconst fontFamily = options.fontFamily || editorFontFamily;\n\n\t\tconst isUniform = !padding\n\t\t\t&& fontFamily === editorFontFamily\n\t\t\t&& fontSize === editorFontSize;\n\n\t\treturn { fontSize, fontFamily, padding, isUniform };\n\t}\n\n\tprivate _removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));\n\t\tfor (const obj of this._decorationsMetadata.values()) {\n\t\t\tobj.classNameRef.dispose();\n\t\t}\n\t\tthis._decorationsMetadata.clear();\n\t}\n}\n\n\n// Prevents the view from potentially visible whitespace\nfunction fixSpace(str: string): string {\n\tconst noBreakWhitespace = '\\xa0';\n\treturn str.replace(/[ \\t]/g, noBreakWhitespace);\n}\n\nCommandsRegistry.registerCommand('_executeInlayHintProvider', async (accessor, ...args: [URI, IRange]): Promise<languages.InlayHint[]> => {\n\n\tconst [uri, range] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Range.isIRange(range));\n\n\tconst { inlayHintsProvider } = accessor.get(ILanguageFeaturesService);\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\t\tconst model = await InlayHintsFragments.create(inlayHintsProvider, ref.object.textEditorModel, [Range.lift(range)], CancellationToken.None);\n\t\tconst result = model.items.map(i => i.hint);\n\t\tsetTimeout(() => model.dispose(), 0); // dispose after sending to ext host\n\t\treturn result;\n\t} finally {\n\t\tref.dispose();\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 { isHTMLElement, ModifierKeyEmitter } from '../../../../base/browser/dom.js';\nimport { isNonEmptyArray } from '../../../../base/common/arrays.js';\nimport { disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { LRUCache } from '../../../../base/common/map.js';\nimport { IRange } from '../../../../base/common/range.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ClassNameReference, CssProperties, DynamicCssRules } from '../../../browser/editorDom.js';\nimport { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport { EditOperation } from '../../../common/core/editOperation.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport * as languages from '../../../common/languages.js';\nimport { IModelDeltaDecoration, InjectedTextCursorStops, InjectedTextOptions, ITextModel, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ITextModelService } from '../../../common/services/resolverService.js';\nimport { ClickLinkGesture, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js';\nimport { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from './inlayHints.js';\nimport { goToDefinitionWithLocation, showGoToContextMenu } from './inlayHintsLocations.js';\nimport { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';\nimport * as colors from '../../../../platform/theme/common/colorRegistry.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { Position } from '../../../common/core/position.js';\n\n// --- hint caching service (per session)\n\nclass InlayHintsCache {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _entries = new LRUCache<string, InlayHintItem[]>(50);\n\n\tget(model: ITextModel): InlayHintItem[] | undefined {\n\t\tconst key = InlayHintsCache._key(model);\n\t\treturn this._entries.get(key);\n\t}\n\n\tset(model: ITextModel, value: InlayHintItem[]): void {\n\t\tconst key = InlayHintsCache._key(model);\n\t\tthis._entries.set(key, value);\n\t}\n\n\tprivate static _key(model: ITextModel): string {\n\t\treturn `${model.uri.toString()}/${model.getVersionId()}`;\n\t}\n}\n\ninterface IInlayHintsCache extends InlayHintsCache { }\nconst IInlayHintsCache = createDecorator<IInlayHintsCache>('IInlayHintsCache');\nregisterSingleton(IInlayHintsCache, InlayHintsCache, InstantiationType.Delayed);\n\n// --- rendered label\n\nexport class RenderedInlayHintLabelPart {\n\tconstructor(readonly item: InlayHintItem, readonly index: number) { }\n\n\tget part() {\n\t\tconst label = this.item.hint.label;\n\t\tif (typeof label === 'string') {\n\t\t\treturn { label };\n\t\t} else {\n\t\t\treturn label[this.index];\n\t\t}\n\t}\n}\n\nclass ActiveInlayHintInfo {\n\tconstructor(readonly part: RenderedInlayHintLabelPart, readonly hasTriggerModifier: boolean) { }\n}\n\ntype InlayHintDecorationRenderInfo = {\n\titem: InlayHintItem;\n\tdecoration: IModelDeltaDecoration;\n\tclassNameRef: ClassNameReference;\n};\n\nconst enum RenderMode {\n\tNormal,\n\tInvisible\n}\n\n\n\n/**\n * Mix of CancellationTokenSource, DisposableStore and MutableDisposable\n */\nclass CancellationStore implements IDisposable {\n\n\tprivate readonly _store = new MutableDisposable<DisposableStore>();\n\tprivate _tokenSource = new CancellationTokenSource();\n\n\tdispose() {\n\t\tthis._store.dispose();\n\t\tthis._tokenSource.dispose(true);\n\t}\n\n\treset() {\n\t\tthis._tokenSource.dispose(true);\n\t\tthis._tokenSource = new CancellationTokenSource();\n\t\tthis._store.value = new DisposableStore();\n\n\t\treturn {\n\t\t\tstore: this._store.value,\n\t\t\ttoken: this._tokenSource.token\n\t\t};\n\t}\n}\n\n\n// --- controller\n\n\nexport class InlayHintsController implements IEditorContribution {\n\n\tstatic readonly ID: string = 'editor.contrib.InlayHints';\n\n\tprivate static readonly _MAX_DECORATORS = 1500;\n\tprivate static readonly _whitespaceData = {};\n\n\tstatic get(editor: ICodeEditor): InlayHintsController | undefined {\n\t\treturn editor.getContribution<InlayHintsController>(InlayHintsController.ID) ?? undefined;\n\t}\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _sessionDisposables = new DisposableStore();\n\tprivate readonly _decorationsMetadata = new Map<string, InlayHintDecorationRenderInfo>();\n\tprivate readonly _debounceInfo: IFeatureDebounceInformation;\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate _cursorInfo?: { position: Position; notEarlierThan: number };\n\tprivate _activeRenderMode = RenderMode.Normal;\n\tprivate _activeInlayHintPart?: ActiveInlayHintInfo;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService _featureDebounce: ILanguageFeatureDebounceService,\n\t\t@IInlayHintsCache private readonly _inlayHintsCache: IInlayHintsCache,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IInstantiationService private readonly _instaService: IInstantiationService,\n\t) {\n\t\tthis._ruleFactory = this._disposables.add(new DynamicCssRules(this._editor));\n\t\tthis._debounceInfo = _featureDebounce.for(_languageFeaturesService.inlayHintsProvider, 'InlayHint', { min: 25 });\n\t\tthis._disposables.add(_languageFeaturesService.inlayHintsProvider.onDidChange(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t\tthis._update();\n\n\t}\n\n\tdispose(): void {\n\t\tthis._sessionDisposables.dispose();\n\t\tthis._removeAllDecorations();\n\t\tthis._disposables.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tthis._sessionDisposables.clear();\n\t\tthis._removeAllDecorations();\n\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tif (options.enabled === 'off') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model || !this._languageFeaturesService.inlayHintsProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options.enabled === 'on') {\n\t\t\t// different \"on\" modes: always\n\t\t\tthis._activeRenderMode = RenderMode.Normal;\n\t\t} else {\n\t\t\t// different \"on\" modes: offUnlessPressed, or onUnlessPressed\n\t\t\tlet defaultMode: RenderMode;\n\t\t\tlet altMode: RenderMode;\n\t\t\tif (options.enabled === 'onUnlessPressed') {\n\t\t\t\tdefaultMode = RenderMode.Normal;\n\t\t\t\taltMode = RenderMode.Invisible;\n\t\t\t} else {\n\t\t\t\tdefaultMode = RenderMode.Invisible;\n\t\t\t\taltMode = RenderMode.Normal;\n\t\t\t}\n\t\t\tthis._activeRenderMode = defaultMode;\n\n\t\t\tthis._sessionDisposables.add(ModifierKeyEmitter.getInstance().event(e => {\n\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst newRenderMode = e.altKey && e.ctrlKey && !(e.shiftKey || e.metaKey) ? altMode : defaultMode;\n\t\t\t\tif (newRenderMode !== this._activeRenderMode) {\n\t\t\t\t\tthis._activeRenderMode = newRenderMode;\n\t\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\t\tconst copies = this._copyInlayHintsWithCurrentAnchor(model);\n\t\t\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], copies);\n\t\t\t\t\tscheduler.schedule(0);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\t// iff possible, quickly update from cache\n\t\tconst cached = this._inlayHintsCache.get(model);\n\t\tif (cached) {\n\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], cached);\n\t\t}\n\t\tthis._sessionDisposables.add(toDisposable(() => {\n\t\t\t// cache items when switching files etc\n\t\t\tif (!model.isDisposed()) {\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\t\t\t}\n\t\t}));\n\n\t\tlet cts: CancellationTokenSource | undefined;\n\t\tconst watchedProviders = new Set<languages.InlayHintsProvider>();\n\n\t\tthis._sessionDisposables.add(model.onWillDispose(() => cts?.cancel()));\n\n\t\tconst cancellationStore = this._sessionDisposables.add(new CancellationStore());\n\n\t\tconst scheduler = new RunOnceScheduler(async () => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tconst { store, token } = cancellationStore.reset();\n\n\t\t\ttry {\n\t\t\t\tconst inlayHints = await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider, model, this._getHintsRanges(), token);\n\t\t\t\tscheduler.delay = this._debounceInfo.update(model, Date.now() - t1);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\tinlayHints.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// listen to provider changes\n\t\t\t\tfor (const provider of inlayHints.provider) {\n\t\t\t\t\tif (typeof provider.onDidChangeInlayHints === 'function' && !watchedProviders.has(provider)) {\n\t\t\t\t\t\twatchedProviders.add(provider);\n\t\t\t\t\t\tstore.add(provider.onDidChangeInlayHints(() => {\n\t\t\t\t\t\t\tif (!scheduler.isScheduled()) { // ignore event when request is already scheduled\n\t\t\t\t\t\t\t\tscheduler.schedule();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstore.add(inlayHints);\n\t\t\t\tthis._updateHintsDecorators(inlayHints.ranges, inlayHints.items);\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}, this._debounceInfo.get(model));\n\n\t\tthis._sessionDisposables.add(scheduler);\n\t\tscheduler.schedule(0);\n\n\t\tthis._sessionDisposables.add(this._editor.onDidScrollChange((e) => {\n\t\t\t// update when scroll position changes\n\t\t\t// uses scrollTopChanged has weak heuristic to differenatiate between scrolling due to\n\t\t\t// typing or due to \"actual\" scrolling\n\t\t\tif (e.scrollTopChanged || !scheduler.isScheduled()) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tconst cursor = this._sessionDisposables.add(new MutableDisposable());\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tcts?.cancel();\n\n\t\t\t// mark current cursor position and time after which the whole can be updated/redrawn\n\t\t\tconst delay = Math.max(scheduler.delay, 800);\n\t\t\tthis._cursorInfo = { position: this._editor.getPosition()!, notEarlierThan: Date.now() + delay };\n\t\t\tcursor.value = disposableTimeout(() => scheduler.schedule(0), delay);\n\n\t\t\tscheduler.schedule();\n\t\t}));\n\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\t// mouse gestures\n\t\tthis._sessionDisposables.add(this._installDblClickGesture(() => scheduler.schedule(0)));\n\t\tthis._sessionDisposables.add(this._installLinkGesture());\n\t\tthis._sessionDisposables.add(this._installContextMenu());\n\t}\n\n\tprivate _installLinkGesture(): IDisposable {\n\n\t\tconst store = new DisposableStore();\n\t\tconst gesture = store.add(new ClickLinkGesture(this._editor));\n\n\t\t// let removeHighlight = () => { };\n\n\t\tconst sessionStore = new DisposableStore();\n\t\tstore.add(sessionStore);\n\n\t\tstore.add(gesture.onMouseMoveOrRelevantKeyDown(e => {\n\t\t\tconst [mouseEvent] = e;\n\t\t\tconst labelPart = this._getInlayHintLabelPart(mouseEvent);\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (!labelPart || !model) {\n\t\t\t\tsessionStore.clear();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// resolve the item\n\t\t\tconst cts = new CancellationTokenSource();\n\t\t\tsessionStore.add(toDisposable(() => cts.dispose(true)));\n\t\t\tlabelPart.item.resolve(cts.token);\n\n\t\t\t// render link => when the modifier is pressed and when there is a command or location\n\t\t\tthis._activeInlayHintPart = labelPart.part.command || labelPart.part.location\n\t\t\t\t? new ActiveInlayHintInfo(labelPart, mouseEvent.hasTriggerModifier)\n\t\t\t\t: undefined;\n\n\t\t\tconst lineNumber = model.validatePosition(labelPart.item.hint.position).lineNumber;\n\t\t\tconst range = new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber));\n\t\t\tconst lineHints = this._getInlineHintsForRange(range);\n\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\tsessionStore.add(toDisposable(() => {\n\t\t\t\tthis._activeInlayHintPart = undefined;\n\t\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\t}));\n\t\t}));\n\t\tstore.add(gesture.onCancel(() => sessionStore.clear()));\n\t\tstore.add(gesture.onExecute(async e => {\n\t\t\tconst label = this._getInlayHintLabelPart(e);\n\t\t\tif (label) {\n\t\t\t\tconst part = label.part;\n\t\t\t\tif (part.location) {\n\t\t\t\t\t// location -> execute go to def\n\t\t\t\t\tthis._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor as IActiveCodeEditor, part.location);\n\t\t\t\t} else if (languages.Command.is(part.command)) {\n\t\t\t\t\t// command -> execute it\n\t\t\t\t\tawait this._invokeCommand(part.command, label.item);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\treturn store;\n\t}\n\n\tprivate _getInlineHintsForRange(range: Range) {\n\t\tconst lineHints = new Set<InlayHintItem>();\n\t\tfor (const data of this._decorationsMetadata.values()) {\n\t\t\tif (range.containsRange(data.item.anchor.range)) {\n\t\t\t\tlineHints.add(data.item);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(lineHints);\n\t}\n\n\tprivate _installDblClickGesture(updateInlayHints: Function): IDisposable {\n\t\treturn this._editor.onMouseUp(async e => {\n\t\t\tif (e.event.detail !== 2) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (!part) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.event.preventDefault();\n\t\t\tawait part.item.resolve(CancellationToken.None);\n\t\t\tif (isNonEmptyArray(part.item.hint.textEdits)) {\n\t\t\t\tconst edits = part.item.hint.textEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));\n\t\t\t\tthis._editor.executeEdits('inlayHint.default', edits);\n\t\t\t\tupdateInlayHints();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _installContextMenu(): IDisposable {\n\t\treturn this._editor.onContextMenu(async e => {\n\t\t\tif (!(isHTMLElement(e.event.target))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (part) {\n\t\t\t\tawait this._instaService.invokeFunction(showGoToContextMenu, this._editor, e.event.target, part);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _getInlayHintLabelPart(e: IEditorMouseEvent | ClickLinkMouseEvent): RenderedInlayHintLabelPart | undefined {\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst options = e.target.detail.injectedText?.options;\n\t\tif (options instanceof ModelDecorationInjectedTextOptions && options?.attachedData instanceof RenderedInlayHintLabelPart) {\n\t\t\treturn options.attachedData;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate async _invokeCommand(command: languages.Command, item: InlayHintItem) {\n\t\ttry {\n\t\t\tawait this._commandService.executeCommand(command.id, ...(command.arguments ?? []));\n\t\t} catch (err) {\n\t\t\tthis._notificationService.notify({\n\t\t\t\tseverity: Severity.Error,\n\t\t\t\tsource: item.provider.displayName,\n\t\t\t\tmessage: err\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _cacheHintsForFastRestore(model: ITextModel): void {\n\t\tconst hints = this._copyInlayHintsWithCurrentAnchor(model);\n\t\tthis._inlayHintsCache.set(model, hints);\n\t}\n\n\t// return inlay hints but with an anchor that reflects \"updates\"\n\t// that happened after receiving them, e.g adding new lines before a hint\n\tprivate _copyInlayHintsWithCurrentAnchor(model: ITextModel): InlayHintItem[] {\n\t\tconst items = new Map<InlayHintItem, InlayHintItem>();\n\t\tfor (const [id, obj] of this._decorationsMetadata) {\n\t\t\tif (items.has(obj.item)) {\n\t\t\t\t// an inlay item can be rendered as multiple decorations\n\t\t\t\t// but they will all uses the same range\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst range = model.getDecorationRange(id);\n\t\t\tif (range) {\n\t\t\t\t// update range with whatever the editor has tweaked it to\n\t\t\t\tconst anchor = new InlayHintAnchor(range, obj.item.anchor.direction);\n\t\t\t\tconst copy = obj.item.with({ anchor });\n\t\t\t\titems.set(obj.item, copy);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(items.values());\n\t}\n\n\tprivate _getHintsRanges(): Range[] {\n\t\tconst extra = 30;\n\t\tconst model = this._editor.getModel()!;\n\t\tconst visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow();\n\t\tconst result: Range[] = [];\n\t\tfor (const range of visibleRanges.sort(Range.compareRangesUsingStarts)) {\n\t\t\tconst extendedRange = model.validateRange(new Range(range.startLineNumber - extra, range.startColumn, range.endLineNumber + extra, range.endColumn));\n\t\t\tif (result.length === 0 || !Range.areIntersectingOrTouching(result[result.length - 1], extendedRange)) {\n\t\t\t\tresult.push(extendedRange);\n\t\t\t} else {\n\t\t\t\tresult[result.length - 1] = Range.plusRange(result[result.length - 1], extendedRange);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _updateHintsDecorators(ranges: readonly Range[], items: readonly InlayHintItem[]): void {\n\n\t\tconst itemFixedLengths = new Map<InlayHintItem, number>();\n\n\t\tif (this._cursorInfo\n\t\t\t&& this._cursorInfo.notEarlierThan > Date.now()\n\t\t\t&& ranges.some(range => range.containsPosition(this._cursorInfo!.position))\n\t\t) {\n\t\t\t// collect inlay hints that are on the same line and before the cursor. Those \"old\" hints\n\t\t\t// define fixed lengths so that the cursor does not jump back and worth while typing.\n\t\t\tconst { position } = this._cursorInfo;\n\t\t\tthis._cursorInfo = undefined;\n\n\t\t\tconst lengths = new Map<InlayHintItem, number>();\n\n\t\t\tfor (const deco of this._editor.getLineDecorations(position.lineNumber) ?? []) {\n\n\t\t\t\tconst data = this._decorationsMetadata.get(deco.id);\n\t\t\t\tif (deco.range.startColumn > position.column) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst opts = data?.decoration.options[data.item.anchor.direction];\n\t\t\t\tif (opts && opts.attachedData !== InlayHintsController._whitespaceData) {\n\t\t\t\t\tconst len = lengths.get(data.item) ?? 0;\n\t\t\t\t\tlengths.set(data.item, len + opts.content.length);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// on the cursor line and before the cursor-column\n\t\t\tconst newItemsWithFixedLength = items.filter(item => item.anchor.range.startLineNumber === position.lineNumber && item.anchor.range.endColumn <= position.column);\n\t\t\tconst fixedLengths = Array.from(lengths.values());\n\n\t\t\t// match up fixed lengths with items and distribute the remaining lengths to the last item\n\t\t\tlet lastItem: InlayHintItem | undefined;\n\t\t\twhile (true) {\n\t\t\t\tconst targetItem = newItemsWithFixedLength.shift();\n\t\t\t\tconst fixedLength = fixedLengths.shift();\n\n\t\t\t\tif (!fixedLength && !targetItem) {\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\n\t\t\t\tif (targetItem) {\n\t\t\t\t\titemFixedLengths.set(targetItem, fixedLength ?? 0);\n\t\t\t\t\tlastItem = targetItem;\n\n\t\t\t\t} else if (lastItem && fixedLength) {\n\t\t\t\t\t// still lengths but no more item. give it all to the last\n\t\t\t\t\tlet len = itemFixedLengths.get(lastItem)!;\n\t\t\t\t\tlen += fixedLength;\n\t\t\t\t\tlen += fixedLengths.reduce((p, c) => p + c, 0);\n\t\t\t\t\tfixedLengths.length = 0;\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// utils to collect/create injected text decorations\n\t\tconst newDecorationsData: InlayHintDecorationRenderInfo[] = [];\n\t\tconst addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart | object): void => {\n\t\t\tconst opts: InjectedTextOptions = {\n\t\t\t\tcontent,\n\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\tinlineClassName: ref.className,\n\t\t\t\tcursorStops,\n\t\t\t\tattachedData\n\t\t\t};\n\t\t\tnewDecorationsData.push({\n\t\t\t\titem,\n\t\t\t\tclassNameRef: ref,\n\t\t\t\tdecoration: {\n\t\t\t\t\trange: item.anchor.range,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// className: \"rangeHighlight\", // DEBUG highlight to see to what range a hint is attached\n\t\t\t\t\t\tdescription: 'InlayHint',\n\t\t\t\t\t\tshowIfCollapsed: item.anchor.range.isEmpty(), // \"original\" range is empty\n\t\t\t\t\t\tcollapseOnReplaceEdit: !item.anchor.range.isEmpty(),\n\t\t\t\t\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\t\t\t\t\t[item.anchor.direction]: this._activeRenderMode === RenderMode.Normal ? opts : undefined\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst addInjectedWhitespace = (item: InlayHintItem, isLast: boolean): void => {\n\t\t\tconst marginRule = this._ruleFactory.createClassNameRef({\n\t\t\t\twidth: `${(fontSize / 3) | 0}px`,\n\t\t\t\tdisplay: 'inline-block'\n\t\t\t});\n\t\t\taddInjectedText(item, marginRule, '\\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, InlayHintsController._whitespaceData);\n\t\t};\n\n\n\t\t//\n\t\tconst { fontSize, fontFamily, padding, isUniform } = this._getLayoutInfo();\n\t\tconst maxLength = this._editor.getOption(EditorOption.inlayHints).maximumLength;\n\t\tconst fontFamilyVar = '--code-editorInlayHintsFontFamily';\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily);\n\n\n\t\ttype ILineInfo = { line: number; totalLen: number };\n\t\tlet currentLineInfo: ILineInfo = { line: 0, totalLen: 0 };\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst item = items[i];\n\n\t\t\tif (currentLineInfo.line !== item.anchor.range.startLineNumber) {\n\t\t\t\tcurrentLineInfo = { line: item.anchor.range.startLineNumber, totalLen: 0 };\n\t\t\t}\n\n\t\t\tif (maxLength && currentLineInfo.totalLen > maxLength) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// whitespace leading the actual label\n\t\t\tif (item.hint.paddingLeft) {\n\t\t\t\taddInjectedWhitespace(item, false);\n\t\t\t}\n\n\t\t\t// the label with its parts\n\t\t\tconst parts: languages.InlayHintLabelPart[] = typeof item.hint.label === 'string'\n\t\t\t\t? [{ label: item.hint.label }]\n\t\t\t\t: item.hint.label;\n\n\t\t\tconst itemFixedLength = itemFixedLengths.get(item);\n\t\t\tlet itemActualLength = 0;\n\n\t\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\t\tconst part = parts[i];\n\n\t\t\t\tconst isFirst = i === 0;\n\t\t\t\tconst isLast = i === parts.length - 1;\n\n\t\t\t\tconst cssProperties: CssProperties = {\n\t\t\t\t\tfontSize: `${fontSize}px`,\n\t\t\t\t\tfontFamily: `var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}`,\n\t\t\t\t\tverticalAlign: isUniform ? 'baseline' : 'middle',\n\t\t\t\t\tunicodeBidi: 'isolate'\n\t\t\t\t};\n\n\t\t\t\tif (isNonEmptyArray(item.hint.textEdits)) {\n\t\t\t\t\tcssProperties.cursor = 'default';\n\t\t\t\t}\n\n\t\t\t\tthis._fillInColors(cssProperties, item.hint);\n\n\t\t\t\tif ((part.command || part.location) && this._activeInlayHintPart?.part.item === item && this._activeInlayHintPart.part.index === i) {\n\t\t\t\t\t// active link!\n\t\t\t\t\tcssProperties.textDecoration = 'underline';\n\t\t\t\t\tif (this._activeInlayHintPart.hasTriggerModifier) {\n\t\t\t\t\t\tcssProperties.color = themeColorFromId(colors.editorActiveLinkForeground);\n\t\t\t\t\t\tcssProperties.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet textlabel = part.label;\n\t\t\t\tcurrentLineInfo.totalLen += textlabel.length;\n\t\t\t\tlet tooLong = false;\n\t\t\t\tconst over = maxLength !== 0 ? (currentLineInfo.totalLen - maxLength) : 0;\n\t\t\t\tif (over > 0) {\n\t\t\t\t\ttextlabel = textlabel.slice(0, -over) + '…';\n\t\t\t\t\ttooLong = true;\n\t\t\t\t}\n\n\t\t\t\titemActualLength += textlabel.length;\n\n\t\t\t\tif (itemFixedLength !== undefined) {\n\t\t\t\t\tconst overFixedLength = itemActualLength - itemFixedLength;\n\t\t\t\t\tif (overFixedLength >= 0) {\n\t\t\t\t\t\t// longer than fixed length, trim\n\t\t\t\t\t\titemActualLength -= overFixedLength;\n\t\t\t\t\t\ttextlabel = textlabel.slice(0, -(1 + overFixedLength)) + '…';\n\t\t\t\t\t\ttooLong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (padding) {\n\t\t\t\t\tif (isFirst && (isLast || tooLong)) {\n\t\t\t\t\t\t// only element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if (isFirst) {\n\t\t\t\t\t\t// first element\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px 0 0 ${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if ((isLast || tooLong)) {\n\t\t\t\t\t\t// last element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`;\n\t\t\t\t\t\tcssProperties.borderRadius = `0 ${(fontSize / 4) | 0}px ${(fontSize / 4) | 0}px 0`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px 0`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef(cssProperties),\n\t\t\t\t\tfixSpace(textlabel),\n\t\t\t\t\tisLast && !item.hint.paddingRight ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None,\n\t\t\t\t\tnew RenderedInlayHintLabelPart(item, i)\n\t\t\t\t);\n\n\t\t\t\tif (tooLong) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (itemFixedLength !== undefined && itemActualLength < itemFixedLength) {\n\t\t\t\t// shorter than fixed length, pad\n\t\t\t\tconst pad = (itemFixedLength - itemActualLength);\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef({}),\n\t\t\t\t\t'\\u200a'.repeat(pad),\n\t\t\t\t\tInjectedTextCursorStops.None\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// whitespace trailing the actual label\n\t\t\tif (item.hint.paddingRight) {\n\t\t\t\taddInjectedWhitespace(item, true);\n\t\t\t}\n\n\t\t\tif (newDecorationsData.length > InlayHintsController._MAX_DECORATORS) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// collect all decoration ids that are affected by the ranges\n\t\t// and only update those decorations\n\t\tconst decorationIdsToReplace: string[] = [];\n\t\tfor (const [id, metadata] of this._decorationsMetadata) {\n\t\t\tconst range = this._editor.getModel()?.getDecorationRange(id);\n\t\t\tif (range && ranges.some(r => r.containsRange(range))) {\n\t\t\t\tdecorationIdsToReplace.push(id);\n\t\t\t\tmetadata.classNameRef.dispose();\n\t\t\t\tthis._decorationsMetadata.delete(id);\n\t\t\t}\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\n\t\tthis._editor.changeDecorations(accessor => {\n\t\t\tconst newDecorationIds = accessor.deltaDecorations(decorationIdsToReplace, newDecorationsData.map(d => d.decoration));\n\t\t\tfor (let i = 0; i < newDecorationIds.length; i++) {\n\t\t\t\tconst data = newDecorationsData[i];\n\t\t\t\tthis._decorationsMetadata.set(newDecorationIds[i], data);\n\t\t\t}\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _fillInColors(props: CssProperties, hint: languages.InlayHint): void {\n\t\tif (hint.kind === languages.InlayHintKind.Parameter) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintParameterBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintParameterForeground);\n\t\t} else if (hint.kind === languages.InlayHintKind.Type) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintTypeBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintTypeForeground);\n\t\t} else {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintForeground);\n\t\t}\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tconst padding = options.padding;\n\n\t\tconst editorFontSize = this._editor.getOption(EditorOption.fontSize);\n\t\tconst editorFontFamily = this._editor.getOption(EditorOption.fontFamily);\n\n\t\tlet fontSize = options.fontSize;\n\t\tif (!fontSize || fontSize < 5 || fontSize > editorFontSize) {\n\t\t\tfontSize = editorFontSize;\n\t\t}\n\n\t\tconst fontFamily = options.fontFamily || editorFontFamily;\n\n\t\tconst isUniform = !padding\n\t\t\t&& fontFamily === editorFontFamily\n\t\t\t&& fontSize === editorFontSize;\n\n\t\treturn { fontSize, fontFamily, padding, isUniform };\n\t}\n\n\tprivate _removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));\n\t\tfor (const obj of this._decorationsMetadata.values()) {\n\t\t\tobj.classNameRef.dispose();\n\t\t}\n\t\tthis._decorationsMetadata.clear();\n\t}\n}\n\n\n// Prevents the view from potentially visible whitespace\nfunction fixSpace(str: string): string {\n\tconst noBreakWhitespace = '\\xa0';\n\treturn str.replace(/[ \\t]/g, noBreakWhitespace);\n}\n\nCommandsRegistry.registerCommand('_executeInlayHintProvider', async (accessor, ...args: [URI, IRange]): Promise<languages.InlayHint[]> => {\n\n\tconst [uri, range] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Range.isIRange(range));\n\n\tconst { inlayHintsProvider } = accessor.get(ILanguageFeaturesService);\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\t\tconst model = await InlayHintsFragments.create(inlayHintsProvider, ref.object.textEditorModel, [Range.lift(range)], CancellationToken.None);\n\t\tconst result = model.items.map(i => i.hint);\n\t\tsetTimeout(() => model.dispose(), 0); // dispose after sending to ext host\n\t\treturn result;\n\t} finally {\n\t\tref.dispose();\n\t}\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts","vs/editor/contrib/inlayHints/browser/inlayHintsController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,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or-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 { isHTMLElement, ModifierKeyEmitter } from '../../../../base/browser/dom.js';\nimport { isNonEmptyArray } from '../../../../base/common/arrays.js';\nimport { disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { LRUCache } from '../../../../base/common/map.js';\nimport { IRange } from '../../../../base/common/range.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ClassNameReference, CssProperties, DynamicCssRules } from '../../../browser/editorDom.js';\nimport { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport { EditOperation } from '../../../common/core/editOperation.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport * as languages from '../../../common/languages.js';\nimport { IModelDeltaDecoration, InjectedTextCursorStops, InjectedTextOptions, ITextModel, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ITextModelService } from '../../../common/services/resolverService.js';\nimport { ClickLinkGesture, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js';\nimport { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from './inlayHints.js';\nimport { goToDefinitionWithLocation, showGoToContextMenu } from './inlayHintsLocations.js';\nimport { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';\nimport * as colors from '../../../../platform/theme/common/colorRegistry.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { Position } from '../../../common/core/position.js';\n\n// --- hint caching service (per session)\n\nclass InlayHintsCache {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _entries = new LRUCache<string, InlayHintItem[]>(50);\n\n\tget(model: ITextModel): InlayHintItem[] | undefined {\n\t\tconst key = InlayHintsCache._key(model);\n\t\treturn this._entries.get(key);\n\t}\n\n\tset(model: ITextModel, value: InlayHintItem[]): void {\n\t\tconst key = InlayHintsCache._key(model);\n\t\tthis._entries.set(key, value);\n\t}\n\n\tprivate static _key(model: ITextModel): string {\n\t\treturn `${model.uri.toString()}/${model.getVersionId()}`;\n\t}\n}\n\ninterface IInlayHintsCache extends InlayHintsCache { }\nconst IInlayHintsCache = createDecorator<IInlayHintsCache>('IInlayHintsCache');\nregisterSingleton(IInlayHintsCache, InlayHintsCache, InstantiationType.Delayed);\n\n// --- rendered label\n\nexport class RenderedInlayHintLabelPart {\n\tconstructor(readonly item: InlayHintItem, readonly index: number) { }\n\n\tget part() {\n\t\tconst label = this.item.hint.label;\n\t\tif (typeof label === 'string') {\n\t\t\treturn { label };\n\t\t} else {\n\t\t\treturn label[this.index];\n\t\t}\n\t}\n}\n\nclass ActiveInlayHintInfo {\n\tconstructor(readonly part: RenderedInlayHintLabelPart, readonly hasTriggerModifier: boolean) { }\n}\n\ntype InlayHintDecorationRenderInfo = {\n\titem: InlayHintItem;\n\tdecoration: IModelDeltaDecoration;\n\tclassNameRef: ClassNameReference;\n};\n\nconst enum RenderMode {\n\tNormal,\n\tInvisible\n}\n\n\n\n/**\n * Mix of CancellationTokenSource, DisposableStore and MutableDisposable\n */\nclass CancellationStore implements IDisposable {\n\n\tprivate readonly _store = new MutableDisposable<DisposableStore>();\n\tprivate _tokenSource = new CancellationTokenSource();\n\n\tdispose() {\n\t\tthis._store.dispose();\n\t\tthis._tokenSource.dispose(true);\n\t}\n\n\treset() {\n\t\tthis._tokenSource.dispose(true);\n\t\tthis._tokenSource = new CancellationTokenSource();\n\t\tthis._store.value = new DisposableStore();\n\n\t\treturn {\n\t\t\tstore: this._store.value,\n\t\t\ttoken: this._tokenSource.token\n\t\t};\n\t}\n}\n\n\n// --- controller\n\n\nexport class InlayHintsController implements IEditorContribution {\n\n\tstatic readonly ID: string = 'editor.contrib.InlayHints';\n\n\tprivate static readonly _MAX_DECORATORS = 1500;\n\tprivate static readonly _whitespaceData = {};\n\n\tstatic get(editor: ICodeEditor): InlayHintsController | undefined {\n\t\treturn editor.getContribution<InlayHintsController>(InlayHintsController.ID) ?? undefined;\n\t}\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _sessionDisposables = new DisposableStore();\n\tprivate readonly _decorationsMetadata = new Map<string, InlayHintDecorationRenderInfo>();\n\tprivate readonly _debounceInfo: IFeatureDebounceInformation;\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate _cursorInfo?: { position: Position; notEarlierThan: number };\n\tprivate _activeRenderMode = RenderMode.Normal;\n\tprivate _activeInlayHintPart?: ActiveInlayHintInfo;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService _featureDebounce: ILanguageFeatureDebounceService,\n\t\t@IInlayHintsCache private readonly _inlayHintsCache: IInlayHintsCache,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IInstantiationService private readonly _instaService: IInstantiationService,\n\t) {\n\t\tthis._ruleFactory = this._disposables.add(new DynamicCssRules(this._editor));\n\t\tthis._debounceInfo = _featureDebounce.for(_languageFeaturesService.inlayHintsProvider, 'InlayHint', { min: 25 });\n\t\tthis._disposables.add(_languageFeaturesService.inlayHintsProvider.onDidChange(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t\tthis._update();\n\n\t}\n\n\tdispose(): void {\n\t\tthis._sessionDisposables.dispose();\n\t\tthis._removeAllDecorations();\n\t\tthis._disposables.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tthis._sessionDisposables.clear();\n\t\tthis._removeAllDecorations();\n\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tif (options.enabled === 'off') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model || !this._languageFeaturesService.inlayHintsProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options.enabled === 'on') {\n\t\t\t// different \"on\" modes: always\n\t\t\tthis._activeRenderMode = RenderMode.Normal;\n\t\t} else {\n\t\t\t// different \"on\" modes: offUnlessPressed, or onUnlessPressed\n\t\t\tlet defaultMode: RenderMode;\n\t\t\tlet altMode: RenderMode;\n\t\t\tif (options.enabled === 'onUnlessPressed') {\n\t\t\t\tdefaultMode = RenderMode.Normal;\n\t\t\t\taltMode = RenderMode.Invisible;\n\t\t\t} else {\n\t\t\t\tdefaultMode = RenderMode.Invisible;\n\t\t\t\taltMode = RenderMode.Normal;\n\t\t\t}\n\t\t\tthis._activeRenderMode = defaultMode;\n\n\t\t\tthis._sessionDisposables.add(ModifierKeyEmitter.getInstance().event(e => {\n\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst newRenderMode = e.altKey && e.ctrlKey && !(e.shiftKey || e.metaKey) ? altMode : defaultMode;\n\t\t\t\tif (newRenderMode !== this._activeRenderMode) {\n\t\t\t\t\tthis._activeRenderMode = newRenderMode;\n\t\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\t\tconst copies = this._copyInlayHintsWithCurrentAnchor(model);\n\t\t\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], copies);\n\t\t\t\t\tscheduler.schedule(0);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\t// iff possible, quickly update from cache\n\t\tconst cached = this._inlayHintsCache.get(model);\n\t\tif (cached) {\n\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], cached);\n\t\t}\n\t\tthis._sessionDisposables.add(toDisposable(() => {\n\t\t\t// cache items when switching files etc\n\t\t\tif (!model.isDisposed()) {\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\t\t\t}\n\t\t}));\n\n\t\tlet cts: CancellationTokenSource | undefined;\n\t\tconst watchedProviders = new Set<languages.InlayHintsProvider>();\n\n\t\tthis._sessionDisposables.add(model.onWillDispose(() => cts?.cancel()));\n\n\t\tconst cancellationStore = this._sessionDisposables.add(new CancellationStore());\n\n\t\tconst scheduler = new RunOnceScheduler(async () => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tconst { store, token } = cancellationStore.reset();\n\n\t\t\ttry {\n\t\t\t\tconst inlayHints = await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider, model, this._getHintsRanges(), token);\n\t\t\t\tscheduler.delay = this._debounceInfo.update(model, Date.now() - t1);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\tinlayHints.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// listen to provider changes\n\t\t\t\tfor (const provider of inlayHints.provider) {\n\t\t\t\t\tif (typeof provider.onDidChangeInlayHints === 'function' && !watchedProviders.has(provider)) {\n\t\t\t\t\t\twatchedProviders.add(provider);\n\t\t\t\t\t\tstore.add(provider.onDidChangeInlayHints(() => {\n\t\t\t\t\t\t\tif (!scheduler.isScheduled()) { // ignore event when request is already scheduled\n\t\t\t\t\t\t\t\tscheduler.schedule();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstore.add(inlayHints);\n\t\t\t\tstore.add(toDisposable(() => watchedProviders.clear()));\n\t\t\t\tthis._updateHintsDecorators(inlayHints.ranges, inlayHints.items);\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}, this._debounceInfo.get(model));\n\n\t\tthis._sessionDisposables.add(scheduler);\n\t\tscheduler.schedule(0);\n\n\t\tthis._sessionDisposables.add(this._editor.onDidScrollChange((e) => {\n\t\t\t// update when scroll position changes\n\t\t\t// uses scrollTopChanged has weak heuristic to differenatiate between scrolling due to\n\t\t\t// typing or due to \"actual\" scrolling\n\t\t\tif (e.scrollTopChanged || !scheduler.isScheduled()) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tconst cursor = this._sessionDisposables.add(new MutableDisposable());\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tcts?.cancel();\n\n\t\t\t// mark current cursor position and time after which the whole can be updated/redrawn\n\t\t\tconst delay = Math.max(scheduler.delay, 800);\n\t\t\tthis._cursorInfo = { position: this._editor.getPosition()!, notEarlierThan: Date.now() + delay };\n\t\t\tcursor.value = disposableTimeout(() => scheduler.schedule(0), delay);\n\n\t\t\tscheduler.schedule();\n\t\t}));\n\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\t// mouse gestures\n\t\tthis._sessionDisposables.add(this._installDblClickGesture(() => scheduler.schedule(0)));\n\t\tthis._sessionDisposables.add(this._installLinkGesture());\n\t\tthis._sessionDisposables.add(this._installContextMenu());\n\t}\n\n\tprivate _installLinkGesture(): IDisposable {\n\n\t\tconst store = new DisposableStore();\n\t\tconst gesture = store.add(new ClickLinkGesture(this._editor));\n\n\t\t// let removeHighlight = () => { };\n\n\t\tconst sessionStore = new DisposableStore();\n\t\tstore.add(sessionStore);\n\n\t\tstore.add(gesture.onMouseMoveOrRelevantKeyDown(e => {\n\t\t\tconst [mouseEvent] = e;\n\t\t\tconst labelPart = this._getInlayHintLabelPart(mouseEvent);\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (!labelPart || !model) {\n\t\t\t\tsessionStore.clear();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// resolve the item\n\t\t\tconst cts = new CancellationTokenSource();\n\t\t\tsessionStore.add(toDisposable(() => cts.dispose(true)));\n\t\t\tlabelPart.item.resolve(cts.token);\n\n\t\t\t// render link => when the modifier is pressed and when there is a command or location\n\t\t\tthis._activeInlayHintPart = labelPart.part.command || labelPart.part.location\n\t\t\t\t? new ActiveInlayHintInfo(labelPart, mouseEvent.hasTriggerModifier)\n\t\t\t\t: undefined;\n\n\t\t\tconst lineNumber = model.validatePosition(labelPart.item.hint.position).lineNumber;\n\t\t\tconst range = new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber));\n\t\t\tconst lineHints = this._getInlineHintsForRange(range);\n\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\tsessionStore.add(toDisposable(() => {\n\t\t\t\tthis._activeInlayHintPart = undefined;\n\t\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\t}));\n\t\t}));\n\t\tstore.add(gesture.onCancel(() => sessionStore.clear()));\n\t\tstore.add(gesture.onExecute(async e => {\n\t\t\tconst label = this._getInlayHintLabelPart(e);\n\t\t\tif (label) {\n\t\t\t\tconst part = label.part;\n\t\t\t\tif (part.location) {\n\t\t\t\t\t// location -> execute go to def\n\t\t\t\t\tthis._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor as IActiveCodeEditor, part.location);\n\t\t\t\t} else if (languages.Command.is(part.command)) {\n\t\t\t\t\t// command -> execute it\n\t\t\t\t\tawait this._invokeCommand(part.command, label.item);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\treturn store;\n\t}\n\n\tprivate _getInlineHintsForRange(range: Range) {\n\t\tconst lineHints = new Set<InlayHintItem>();\n\t\tfor (const data of this._decorationsMetadata.values()) {\n\t\t\tif (range.containsRange(data.item.anchor.range)) {\n\t\t\t\tlineHints.add(data.item);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(lineHints);\n\t}\n\n\tprivate _installDblClickGesture(updateInlayHints: Function): IDisposable {\n\t\treturn this._editor.onMouseUp(async e => {\n\t\t\tif (e.event.detail !== 2) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (!part) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.event.preventDefault();\n\t\t\tawait part.item.resolve(CancellationToken.None);\n\t\t\tif (isNonEmptyArray(part.item.hint.textEdits)) {\n\t\t\t\tconst edits = part.item.hint.textEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));\n\t\t\t\tthis._editor.executeEdits('inlayHint.default', edits);\n\t\t\t\tupdateInlayHints();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _installContextMenu(): IDisposable {\n\t\treturn this._editor.onContextMenu(async e => {\n\t\t\tif (!(isHTMLElement(e.event.target))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (part) {\n\t\t\t\tawait this._instaService.invokeFunction(showGoToContextMenu, this._editor, e.event.target, part);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _getInlayHintLabelPart(e: IEditorMouseEvent | ClickLinkMouseEvent): RenderedInlayHintLabelPart | undefined {\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst options = e.target.detail.injectedText?.options;\n\t\tif (options instanceof ModelDecorationInjectedTextOptions && options?.attachedData instanceof RenderedInlayHintLabelPart) {\n\t\t\treturn options.attachedData;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate async _invokeCommand(command: languages.Command, item: InlayHintItem) {\n\t\ttry {\n\t\t\tawait this._commandService.executeCommand(command.id, ...(command.arguments ?? []));\n\t\t} catch (err) {\n\t\t\tthis._notificationService.notify({\n\t\t\t\tseverity: Severity.Error,\n\t\t\t\tsource: item.provider.displayName,\n\t\t\t\tmessage: err\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _cacheHintsForFastRestore(model: ITextModel): void {\n\t\tconst hints = this._copyInlayHintsWithCurrentAnchor(model);\n\t\tthis._inlayHintsCache.set(model, hints);\n\t}\n\n\t// return inlay hints but with an anchor that reflects \"updates\"\n\t// that happened after receiving them, e.g adding new lines before a hint\n\tprivate _copyInlayHintsWithCurrentAnchor(model: ITextModel): InlayHintItem[] {\n\t\tconst items = new Map<InlayHintItem, InlayHintItem>();\n\t\tfor (const [id, obj] of this._decorationsMetadata) {\n\t\t\tif (items.has(obj.item)) {\n\t\t\t\t// an inlay item can be rendered as multiple decorations\n\t\t\t\t// but they will all uses the same range\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst range = model.getDecorationRange(id);\n\t\t\tif (range) {\n\t\t\t\t// update range with whatever the editor has tweaked it to\n\t\t\t\tconst anchor = new InlayHintAnchor(range, obj.item.anchor.direction);\n\t\t\t\tconst copy = obj.item.with({ anchor });\n\t\t\t\titems.set(obj.item, copy);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(items.values());\n\t}\n\n\tprivate _getHintsRanges(): Range[] {\n\t\tconst extra = 30;\n\t\tconst model = this._editor.getModel()!;\n\t\tconst visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow();\n\t\tconst result: Range[] = [];\n\t\tfor (const range of visibleRanges.sort(Range.compareRangesUsingStarts)) {\n\t\t\tconst extendedRange = model.validateRange(new Range(range.startLineNumber - extra, range.startColumn, range.endLineNumber + extra, range.endColumn));\n\t\t\tif (result.length === 0 || !Range.areIntersectingOrTouching(result[result.length - 1], extendedRange)) {\n\t\t\t\tresult.push(extendedRange);\n\t\t\t} else {\n\t\t\t\tresult[result.length - 1] = Range.plusRange(result[result.length - 1], extendedRange);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _updateHintsDecorators(ranges: readonly Range[], items: readonly InlayHintItem[]): void {\n\n\t\tconst itemFixedLengths = new Map<InlayHintItem, number>();\n\n\t\tif (this._cursorInfo\n\t\t\t&& this._cursorInfo.notEarlierThan > Date.now()\n\t\t\t&& ranges.some(range => range.containsPosition(this._cursorInfo!.position))\n\t\t) {\n\t\t\t// collect inlay hints that are on the same line and before the cursor. Those \"old\" hints\n\t\t\t// define fixed lengths so that the cursor does not jump back and worth while typing.\n\t\t\tconst { position } = this._cursorInfo;\n\t\t\tthis._cursorInfo = undefined;\n\n\t\t\tconst lengths = new Map<InlayHintItem, number>();\n\n\t\t\tfor (const deco of this._editor.getLineDecorations(position.lineNumber) ?? []) {\n\n\t\t\t\tconst data = this._decorationsMetadata.get(deco.id);\n\t\t\t\tif (deco.range.startColumn > position.column) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst opts = data?.decoration.options[data.item.anchor.direction];\n\t\t\t\tif (opts && opts.attachedData !== InlayHintsController._whitespaceData) {\n\t\t\t\t\tconst len = lengths.get(data.item) ?? 0;\n\t\t\t\t\tlengths.set(data.item, len + opts.content.length);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// on the cursor line and before the cursor-column\n\t\t\tconst newItemsWithFixedLength = items.filter(item => item.anchor.range.startLineNumber === position.lineNumber && item.anchor.range.endColumn <= position.column);\n\t\t\tconst fixedLengths = Array.from(lengths.values());\n\n\t\t\t// match up fixed lengths with items and distribute the remaining lengths to the last item\n\t\t\tlet lastItem: InlayHintItem | undefined;\n\t\t\twhile (true) {\n\t\t\t\tconst targetItem = newItemsWithFixedLength.shift();\n\t\t\t\tconst fixedLength = fixedLengths.shift();\n\n\t\t\t\tif (!fixedLength && !targetItem) {\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\n\t\t\t\tif (targetItem) {\n\t\t\t\t\titemFixedLengths.set(targetItem, fixedLength ?? 0);\n\t\t\t\t\tlastItem = targetItem;\n\n\t\t\t\t} else if (lastItem && fixedLength) {\n\t\t\t\t\t// still lengths but no more item. give it all to the last\n\t\t\t\t\tlet len = itemFixedLengths.get(lastItem)!;\n\t\t\t\t\tlen += fixedLength;\n\t\t\t\t\tlen += fixedLengths.reduce((p, c) => p + c, 0);\n\t\t\t\t\tfixedLengths.length = 0;\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// utils to collect/create injected text decorations\n\t\tconst newDecorationsData: InlayHintDecorationRenderInfo[] = [];\n\t\tconst addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart | object): void => {\n\t\t\tconst opts: InjectedTextOptions = {\n\t\t\t\tcontent,\n\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\tinlineClassName: ref.className,\n\t\t\t\tcursorStops,\n\t\t\t\tattachedData\n\t\t\t};\n\t\t\tnewDecorationsData.push({\n\t\t\t\titem,\n\t\t\t\tclassNameRef: ref,\n\t\t\t\tdecoration: {\n\t\t\t\t\trange: item.anchor.range,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// className: \"rangeHighlight\", // DEBUG highlight to see to what range a hint is attached\n\t\t\t\t\t\tdescription: 'InlayHint',\n\t\t\t\t\t\tshowIfCollapsed: item.anchor.range.isEmpty(), // \"original\" range is empty\n\t\t\t\t\t\tcollapseOnReplaceEdit: !item.anchor.range.isEmpty(),\n\t\t\t\t\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\t\t\t\t\t[item.anchor.direction]: this._activeRenderMode === RenderMode.Normal ? opts : undefined\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst addInjectedWhitespace = (item: InlayHintItem, isLast: boolean): void => {\n\t\t\tconst marginRule = this._ruleFactory.createClassNameRef({\n\t\t\t\twidth: `${(fontSize / 3) | 0}px`,\n\t\t\t\tdisplay: 'inline-block'\n\t\t\t});\n\t\t\taddInjectedText(item, marginRule, '\\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, InlayHintsController._whitespaceData);\n\t\t};\n\n\n\t\t//\n\t\tconst { fontSize, fontFamily, padding, isUniform } = this._getLayoutInfo();\n\t\tconst maxLength = this._editor.getOption(EditorOption.inlayHints).maximumLength;\n\t\tconst fontFamilyVar = '--code-editorInlayHintsFontFamily';\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily);\n\n\n\t\ttype ILineInfo = { line: number; totalLen: number };\n\t\tlet currentLineInfo: ILineInfo = { line: 0, totalLen: 0 };\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst item = items[i];\n\n\t\t\tif (currentLineInfo.line !== item.anchor.range.startLineNumber) {\n\t\t\t\tcurrentLineInfo = { line: item.anchor.range.startLineNumber, totalLen: 0 };\n\t\t\t}\n\n\t\t\tif (maxLength && currentLineInfo.totalLen > maxLength) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// whitespace leading the actual label\n\t\t\tif (item.hint.paddingLeft) {\n\t\t\t\taddInjectedWhitespace(item, false);\n\t\t\t}\n\n\t\t\t// the label with its parts\n\t\t\tconst parts: languages.InlayHintLabelPart[] = typeof item.hint.label === 'string'\n\t\t\t\t? [{ label: item.hint.label }]\n\t\t\t\t: item.hint.label;\n\n\t\t\tconst itemFixedLength = itemFixedLengths.get(item);\n\t\t\tlet itemActualLength = 0;\n\n\t\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\t\tconst part = parts[i];\n\n\t\t\t\tconst isFirst = i === 0;\n\t\t\t\tconst isLast = i === parts.length - 1;\n\n\t\t\t\tconst cssProperties: CssProperties = {\n\t\t\t\t\tfontSize: `${fontSize}px`,\n\t\t\t\t\tfontFamily: `var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}`,\n\t\t\t\t\tverticalAlign: isUniform ? 'baseline' : 'middle',\n\t\t\t\t\tunicodeBidi: 'isolate'\n\t\t\t\t};\n\n\t\t\t\tif (isNonEmptyArray(item.hint.textEdits)) {\n\t\t\t\t\tcssProperties.cursor = 'default';\n\t\t\t\t}\n\n\t\t\t\tthis._fillInColors(cssProperties, item.hint);\n\n\t\t\t\tif ((part.command || part.location) && this._activeInlayHintPart?.part.item === item && this._activeInlayHintPart.part.index === i) {\n\t\t\t\t\t// active link!\n\t\t\t\t\tcssProperties.textDecoration = 'underline';\n\t\t\t\t\tif (this._activeInlayHintPart.hasTriggerModifier) {\n\t\t\t\t\t\tcssProperties.color = themeColorFromId(colors.editorActiveLinkForeground);\n\t\t\t\t\t\tcssProperties.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet textlabel = part.label;\n\t\t\t\tcurrentLineInfo.totalLen += textlabel.length;\n\t\t\t\tlet tooLong = false;\n\t\t\t\tconst over = maxLength !== 0 ? (currentLineInfo.totalLen - maxLength) : 0;\n\t\t\t\tif (over > 0) {\n\t\t\t\t\ttextlabel = textlabel.slice(0, -over) + '…';\n\t\t\t\t\ttooLong = true;\n\t\t\t\t}\n\n\t\t\t\titemActualLength += textlabel.length;\n\n\t\t\t\tif (itemFixedLength !== undefined) {\n\t\t\t\t\tconst overFixedLength = itemActualLength - itemFixedLength;\n\t\t\t\t\tif (overFixedLength >= 0) {\n\t\t\t\t\t\t// longer than fixed length, trim\n\t\t\t\t\t\titemActualLength -= overFixedLength;\n\t\t\t\t\t\ttextlabel = textlabel.slice(0, -(1 + overFixedLength)) + '…';\n\t\t\t\t\t\ttooLong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (padding) {\n\t\t\t\t\tif (isFirst && (isLast || tooLong)) {\n\t\t\t\t\t\t// only element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if (isFirst) {\n\t\t\t\t\t\t// first element\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px 0 0 ${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if ((isLast || tooLong)) {\n\t\t\t\t\t\t// last element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`;\n\t\t\t\t\t\tcssProperties.borderRadius = `0 ${(fontSize / 4) | 0}px ${(fontSize / 4) | 0}px 0`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px 0`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef(cssProperties),\n\t\t\t\t\tfixSpace(textlabel),\n\t\t\t\t\tisLast && !item.hint.paddingRight ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None,\n\t\t\t\t\tnew RenderedInlayHintLabelPart(item, i)\n\t\t\t\t);\n\n\t\t\t\tif (tooLong) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (itemFixedLength !== undefined && itemActualLength < itemFixedLength) {\n\t\t\t\t// shorter than fixed length, pad\n\t\t\t\tconst pad = (itemFixedLength - itemActualLength);\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef({}),\n\t\t\t\t\t'\\u200a'.repeat(pad),\n\t\t\t\t\tInjectedTextCursorStops.None\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// whitespace trailing the actual label\n\t\t\tif (item.hint.paddingRight) {\n\t\t\t\taddInjectedWhitespace(item, true);\n\t\t\t}\n\n\t\t\tif (newDecorationsData.length > InlayHintsController._MAX_DECORATORS) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// collect all decoration ids that are affected by the ranges\n\t\t// and only update those decorations\n\t\tconst decorationIdsToReplace: string[] = [];\n\t\tfor (const [id, metadata] of this._decorationsMetadata) {\n\t\t\tconst range = this._editor.getModel()?.getDecorationRange(id);\n\t\t\tif (range && ranges.some(r => r.containsRange(range))) {\n\t\t\t\tdecorationIdsToReplace.push(id);\n\t\t\t\tmetadata.classNameRef.dispose();\n\t\t\t\tthis._decorationsMetadata.delete(id);\n\t\t\t}\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\n\t\tthis._editor.changeDecorations(accessor => {\n\t\t\tconst newDecorationIds = accessor.deltaDecorations(decorationIdsToReplace, newDecorationsData.map(d => d.decoration));\n\t\t\tfor (let i = 0; i < newDecorationIds.length; i++) {\n\t\t\t\tconst data = newDecorationsData[i];\n\t\t\t\tthis._decorationsMetadata.set(newDecorationIds[i], data);\n\t\t\t}\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _fillInColors(props: CssProperties, hint: languages.InlayHint): void {\n\t\tif (hint.kind === languages.InlayHintKind.Parameter) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintParameterBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintParameterForeground);\n\t\t} else if (hint.kind === languages.InlayHintKind.Type) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintTypeBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintTypeForeground);\n\t\t} else {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintForeground);\n\t\t}\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tconst padding = options.padding;\n\n\t\tconst editorFontSize = this._editor.getOption(EditorOption.fontSize);\n\t\tconst editorFontFamily = this._editor.getOption(EditorOption.fontFamily);\n\n\t\tlet fontSize = options.fontSize;\n\t\tif (!fontSize || fontSize < 5 || fontSize > editorFontSize) {\n\t\t\tfontSize = editorFontSize;\n\t\t}\n\n\t\tconst fontFamily = options.fontFamily || editorFontFamily;\n\n\t\tconst isUniform = !padding\n\t\t\t&& fontFamily === editorFontFamily\n\t\t\t&& fontSize === editorFontSize;\n\n\t\treturn { fontSize, fontFamily, padding, isUniform };\n\t}\n\n\tprivate _removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));\n\t\tfor (const obj of this._decorationsMetadata.values()) {\n\t\t\tobj.classNameRef.dispose();\n\t\t}\n\t\tthis._decorationsMetadata.clear();\n\t}\n}\n\n\n// Prevents the view from potentially visible whitespace\nfunction fixSpace(str: string): string {\n\tconst noBreakWhitespace = '\\xa0';\n\treturn str.replace(/[ \\t]/g, noBreakWhitespace);\n}\n\nCommandsRegistry.registerCommand('_executeInlayHintProvider', async (accessor, ...args: [URI, IRange]): Promise<languages.InlayHint[]> => {\n\n\tconst [uri, range] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Range.isIRange(range));\n\n\tconst { inlayHintsProvider } = accessor.get(ILanguageFeaturesService);\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\t\tconst model = await InlayHintsFragments.create(inlayHintsProvider, ref.object.textEditorModel, [Range.lift(range)], CancellationToken.None);\n\t\tconst result = model.items.map(i => i.hint);\n\t\tsetTimeout(() => model.dispose(), 0); // dispose after sending to ext host\n\t\treturn result;\n\t} finally {\n\t\tref.dispose();\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 { isHTMLElement, ModifierKeyEmitter } from '../../../../base/browser/dom.js';\nimport { isNonEmptyArray } from '../../../../base/common/arrays.js';\nimport { disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { LRUCache } from '../../../../base/common/map.js';\nimport { IRange } from '../../../../base/common/range.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ClassNameReference, CssProperties, DynamicCssRules } from '../../../browser/editorDom.js';\nimport { StableEditorScrollState } from '../../../browser/stableEditorScroll.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport { EditOperation } from '../../../common/core/editOperation.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution } from '../../../common/editorCommon.js';\nimport * as languages from '../../../common/languages.js';\nimport { IModelDeltaDecoration, InjectedTextCursorStops, InjectedTextOptions, ITextModel, TrackedRangeStickiness } from '../../../common/model.js';\nimport { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ITextModelService } from '../../../common/services/resolverService.js';\nimport { ClickLinkGesture, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js';\nimport { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from './inlayHints.js';\nimport { goToDefinitionWithLocation, showGoToContextMenu } from './inlayHintsLocations.js';\nimport { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';\nimport * as colors from '../../../../platform/theme/common/colorRegistry.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { Position } from '../../../common/core/position.js';\n\n// --- hint caching service (per session)\n\nclass InlayHintsCache {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _entries = new LRUCache<string, InlayHintItem[]>(50);\n\n\tget(model: ITextModel): InlayHintItem[] | undefined {\n\t\tconst key = InlayHintsCache._key(model);\n\t\treturn this._entries.get(key);\n\t}\n\n\tset(model: ITextModel, value: InlayHintItem[]): void {\n\t\tconst key = InlayHintsCache._key(model);\n\t\tthis._entries.set(key, value);\n\t}\n\n\tprivate static _key(model: ITextModel): string {\n\t\treturn `${model.uri.toString()}/${model.getVersionId()}`;\n\t}\n}\n\ninterface IInlayHintsCache extends InlayHintsCache { }\nconst IInlayHintsCache = createDecorator<IInlayHintsCache>('IInlayHintsCache');\nregisterSingleton(IInlayHintsCache, InlayHintsCache, InstantiationType.Delayed);\n\n// --- rendered label\n\nexport class RenderedInlayHintLabelPart {\n\tconstructor(readonly item: InlayHintItem, readonly index: number) { }\n\n\tget part() {\n\t\tconst label = this.item.hint.label;\n\t\tif (typeof label === 'string') {\n\t\t\treturn { label };\n\t\t} else {\n\t\t\treturn label[this.index];\n\t\t}\n\t}\n}\n\nclass ActiveInlayHintInfo {\n\tconstructor(readonly part: RenderedInlayHintLabelPart, readonly hasTriggerModifier: boolean) { }\n}\n\ntype InlayHintDecorationRenderInfo = {\n\titem: InlayHintItem;\n\tdecoration: IModelDeltaDecoration;\n\tclassNameRef: ClassNameReference;\n};\n\nconst enum RenderMode {\n\tNormal,\n\tInvisible\n}\n\n\n\n/**\n * Mix of CancellationTokenSource, DisposableStore and MutableDisposable\n */\nclass CancellationStore implements IDisposable {\n\n\tprivate readonly _store = new MutableDisposable<DisposableStore>();\n\tprivate _tokenSource = new CancellationTokenSource();\n\n\tdispose() {\n\t\tthis._store.dispose();\n\t\tthis._tokenSource.dispose(true);\n\t}\n\n\treset() {\n\t\tthis._tokenSource.dispose(true);\n\t\tthis._tokenSource = new CancellationTokenSource();\n\t\tthis._store.value = new DisposableStore();\n\n\t\treturn {\n\t\t\tstore: this._store.value,\n\t\t\ttoken: this._tokenSource.token\n\t\t};\n\t}\n}\n\n\n// --- controller\n\n\nexport class InlayHintsController implements IEditorContribution {\n\n\tstatic readonly ID: string = 'editor.contrib.InlayHints';\n\n\tprivate static readonly _MAX_DECORATORS = 1500;\n\tprivate static readonly _whitespaceData = {};\n\n\tstatic get(editor: ICodeEditor): InlayHintsController | undefined {\n\t\treturn editor.getContribution<InlayHintsController>(InlayHintsController.ID) ?? undefined;\n\t}\n\n\tprivate readonly _disposables = new DisposableStore();\n\tprivate readonly _sessionDisposables = new DisposableStore();\n\tprivate readonly _decorationsMetadata = new Map<string, InlayHintDecorationRenderInfo>();\n\tprivate readonly _debounceInfo: IFeatureDebounceInformation;\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate _cursorInfo?: { position: Position; notEarlierThan: number };\n\tprivate _activeRenderMode = RenderMode.Normal;\n\tprivate _activeInlayHintPart?: ActiveInlayHintInfo;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService _featureDebounce: ILanguageFeatureDebounceService,\n\t\t@IInlayHintsCache private readonly _inlayHintsCache: IInlayHintsCache,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IInstantiationService private readonly _instaService: IInstantiationService,\n\t) {\n\t\tthis._ruleFactory = this._disposables.add(new DynamicCssRules(this._editor));\n\t\tthis._debounceInfo = _featureDebounce.for(_languageFeaturesService.inlayHintsProvider, 'InlayHint', { min: 25 });\n\t\tthis._disposables.add(_languageFeaturesService.inlayHintsProvider.onDidChange(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.add(_editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}));\n\t\tthis._update();\n\n\t}\n\n\tdispose(): void {\n\t\tthis._sessionDisposables.dispose();\n\t\tthis._removeAllDecorations();\n\t\tthis._disposables.dispose();\n\t}\n\n\tprivate _update(): void {\n\t\tthis._sessionDisposables.clear();\n\t\tthis._removeAllDecorations();\n\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tif (options.enabled === 'off') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tif (!model || !this._languageFeaturesService.inlayHintsProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options.enabled === 'on') {\n\t\t\t// different \"on\" modes: always\n\t\t\tthis._activeRenderMode = RenderMode.Normal;\n\t\t} else {\n\t\t\t// different \"on\" modes: offUnlessPressed, or onUnlessPressed\n\t\t\tlet defaultMode: RenderMode;\n\t\t\tlet altMode: RenderMode;\n\t\t\tif (options.enabled === 'onUnlessPressed') {\n\t\t\t\tdefaultMode = RenderMode.Normal;\n\t\t\t\taltMode = RenderMode.Invisible;\n\t\t\t} else {\n\t\t\t\tdefaultMode = RenderMode.Invisible;\n\t\t\t\taltMode = RenderMode.Normal;\n\t\t\t}\n\t\t\tthis._activeRenderMode = defaultMode;\n\n\t\t\tthis._sessionDisposables.add(ModifierKeyEmitter.getInstance().event(e => {\n\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst newRenderMode = e.altKey && e.ctrlKey && !(e.shiftKey || e.metaKey) ? altMode : defaultMode;\n\t\t\t\tif (newRenderMode !== this._activeRenderMode) {\n\t\t\t\t\tthis._activeRenderMode = newRenderMode;\n\t\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\t\tconst copies = this._copyInlayHintsWithCurrentAnchor(model);\n\t\t\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], copies);\n\t\t\t\t\tscheduler.schedule(0);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\t// iff possible, quickly update from cache\n\t\tconst cached = this._inlayHintsCache.get(model);\n\t\tif (cached) {\n\t\t\tthis._updateHintsDecorators([model.getFullModelRange()], cached);\n\t\t}\n\t\tthis._sessionDisposables.add(toDisposable(() => {\n\t\t\t// cache items when switching files etc\n\t\t\tif (!model.isDisposed()) {\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\t\t\t}\n\t\t}));\n\n\t\tlet cts: CancellationTokenSource | undefined;\n\t\tconst watchedProviders = new Set<languages.InlayHintsProvider>();\n\n\t\tthis._sessionDisposables.add(model.onWillDispose(() => cts?.cancel()));\n\n\t\tconst cancellationStore = this._sessionDisposables.add(new CancellationStore());\n\n\t\tconst scheduler = new RunOnceScheduler(async () => {\n\t\t\tconst t1 = Date.now();\n\n\t\t\tconst { store, token } = cancellationStore.reset();\n\n\t\t\ttry {\n\t\t\t\tconst inlayHints = await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider, model, this._getHintsRanges(), token);\n\t\t\t\tscheduler.delay = this._debounceInfo.update(model, Date.now() - t1);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\tinlayHints.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// listen to provider changes\n\t\t\t\tfor (const provider of inlayHints.provider) {\n\t\t\t\t\tif (typeof provider.onDidChangeInlayHints === 'function' && !watchedProviders.has(provider)) {\n\t\t\t\t\t\twatchedProviders.add(provider);\n\t\t\t\t\t\tstore.add(provider.onDidChangeInlayHints(() => {\n\t\t\t\t\t\t\tif (!scheduler.isScheduled()) { // ignore event when request is already scheduled\n\t\t\t\t\t\t\t\tscheduler.schedule();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstore.add(inlayHints);\n\t\t\t\tstore.add(toDisposable(() => watchedProviders.clear()));\n\t\t\t\tthis._updateHintsDecorators(inlayHints.ranges, inlayHints.items);\n\t\t\t\tthis._cacheHintsForFastRestore(model);\n\n\t\t\t} catch (err) {\n\t\t\t\tonUnexpectedError(err);\n\t\t\t}\n\t\t}, this._debounceInfo.get(model));\n\n\t\tthis._sessionDisposables.add(scheduler);\n\t\tscheduler.schedule(0);\n\n\t\tthis._sessionDisposables.add(this._editor.onDidScrollChange((e) => {\n\t\t\t// update when scroll position changes\n\t\t\t// uses scrollTopChanged has weak heuristic to differenatiate between scrolling due to\n\t\t\t// typing or due to \"actual\" scrolling\n\t\t\tif (e.scrollTopChanged || !scheduler.isScheduled()) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\tconst cursor = this._sessionDisposables.add(new MutableDisposable());\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tcts?.cancel();\n\n\t\t\t// mark current cursor position and time after which the whole can be updated/redrawn\n\t\t\tconst delay = Math.max(scheduler.delay, 800);\n\t\t\tthis._cursorInfo = { position: this._editor.getPosition()!, notEarlierThan: Date.now() + delay };\n\t\t\tcursor.value = disposableTimeout(() => scheduler.schedule(0), delay);\n\n\t\t\tscheduler.schedule();\n\t\t}));\n\n\t\tthis._sessionDisposables.add(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.hasChanged(EditorOption.inlayHints)) {\n\t\t\t\tscheduler.schedule();\n\t\t\t}\n\t\t}));\n\n\t\t// mouse gestures\n\t\tthis._sessionDisposables.add(this._installDblClickGesture(() => scheduler.schedule(0)));\n\t\tthis._sessionDisposables.add(this._installLinkGesture());\n\t\tthis._sessionDisposables.add(this._installContextMenu());\n\t}\n\n\tprivate _installLinkGesture(): IDisposable {\n\n\t\tconst store = new DisposableStore();\n\t\tconst gesture = store.add(new ClickLinkGesture(this._editor));\n\n\t\t// let removeHighlight = () => { };\n\n\t\tconst sessionStore = new DisposableStore();\n\t\tstore.add(sessionStore);\n\n\t\tstore.add(gesture.onMouseMoveOrRelevantKeyDown(e => {\n\t\t\tconst [mouseEvent] = e;\n\t\t\tconst labelPart = this._getInlayHintLabelPart(mouseEvent);\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (!labelPart || !model) {\n\t\t\t\tsessionStore.clear();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// resolve the item\n\t\t\tconst cts = new CancellationTokenSource();\n\t\t\tsessionStore.add(toDisposable(() => cts.dispose(true)));\n\t\t\tlabelPart.item.resolve(cts.token);\n\n\t\t\t// render link => when the modifier is pressed and when there is a command or location\n\t\t\tthis._activeInlayHintPart = labelPart.part.command || labelPart.part.location\n\t\t\t\t? new ActiveInlayHintInfo(labelPart, mouseEvent.hasTriggerModifier)\n\t\t\t\t: undefined;\n\n\t\t\tconst lineNumber = model.validatePosition(labelPart.item.hint.position).lineNumber;\n\t\t\tconst range = new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber));\n\t\t\tconst lineHints = this._getInlineHintsForRange(range);\n\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\tsessionStore.add(toDisposable(() => {\n\t\t\t\tthis._activeInlayHintPart = undefined;\n\t\t\t\tthis._updateHintsDecorators([range], lineHints);\n\t\t\t}));\n\t\t}));\n\t\tstore.add(gesture.onCancel(() => sessionStore.clear()));\n\t\tstore.add(gesture.onExecute(async e => {\n\t\t\tconst label = this._getInlayHintLabelPart(e);\n\t\t\tif (label) {\n\t\t\t\tconst part = label.part;\n\t\t\t\tif (part.location) {\n\t\t\t\t\t// location -> execute go to def\n\t\t\t\t\tthis._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor as IActiveCodeEditor, part.location);\n\t\t\t\t} else if (languages.Command.is(part.command)) {\n\t\t\t\t\t// command -> execute it\n\t\t\t\t\tawait this._invokeCommand(part.command, label.item);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\treturn store;\n\t}\n\n\tprivate _getInlineHintsForRange(range: Range) {\n\t\tconst lineHints = new Set<InlayHintItem>();\n\t\tfor (const data of this._decorationsMetadata.values()) {\n\t\t\tif (range.containsRange(data.item.anchor.range)) {\n\t\t\t\tlineHints.add(data.item);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(lineHints);\n\t}\n\n\tprivate _installDblClickGesture(updateInlayHints: Function): IDisposable {\n\t\treturn this._editor.onMouseUp(async e => {\n\t\t\tif (e.event.detail !== 2) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (!part) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.event.preventDefault();\n\t\t\tawait part.item.resolve(CancellationToken.None);\n\t\t\tif (isNonEmptyArray(part.item.hint.textEdits)) {\n\t\t\t\tconst edits = part.item.hint.textEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));\n\t\t\t\tthis._editor.executeEdits('inlayHint.default', edits);\n\t\t\t\tupdateInlayHints();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _installContextMenu(): IDisposable {\n\t\treturn this._editor.onContextMenu(async e => {\n\t\t\tif (!(isHTMLElement(e.event.target))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst part = this._getInlayHintLabelPart(e);\n\t\t\tif (part) {\n\t\t\t\tawait this._instaService.invokeFunction(showGoToContextMenu, this._editor, e.event.target, part);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _getInlayHintLabelPart(e: IEditorMouseEvent | ClickLinkMouseEvent): RenderedInlayHintLabelPart | undefined {\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst options = e.target.detail.injectedText?.options;\n\t\tif (options instanceof ModelDecorationInjectedTextOptions && options?.attachedData instanceof RenderedInlayHintLabelPart) {\n\t\t\treturn options.attachedData;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate async _invokeCommand(command: languages.Command, item: InlayHintItem) {\n\t\ttry {\n\t\t\tawait this._commandService.executeCommand(command.id, ...(command.arguments ?? []));\n\t\t} catch (err) {\n\t\t\tthis._notificationService.notify({\n\t\t\t\tseverity: Severity.Error,\n\t\t\t\tsource: item.provider.displayName,\n\t\t\t\tmessage: err\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _cacheHintsForFastRestore(model: ITextModel): void {\n\t\tconst hints = this._copyInlayHintsWithCurrentAnchor(model);\n\t\tthis._inlayHintsCache.set(model, hints);\n\t}\n\n\t// return inlay hints but with an anchor that reflects \"updates\"\n\t// that happened after receiving them, e.g adding new lines before a hint\n\tprivate _copyInlayHintsWithCurrentAnchor(model: ITextModel): InlayHintItem[] {\n\t\tconst items = new Map<InlayHintItem, InlayHintItem>();\n\t\tfor (const [id, obj] of this._decorationsMetadata) {\n\t\t\tif (items.has(obj.item)) {\n\t\t\t\t// an inlay item can be rendered as multiple decorations\n\t\t\t\t// but they will all uses the same range\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst range = model.getDecorationRange(id);\n\t\t\tif (range) {\n\t\t\t\t// update range with whatever the editor has tweaked it to\n\t\t\t\tconst anchor = new InlayHintAnchor(range, obj.item.anchor.direction);\n\t\t\t\tconst copy = obj.item.with({ anchor });\n\t\t\t\titems.set(obj.item, copy);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(items.values());\n\t}\n\n\tprivate _getHintsRanges(): Range[] {\n\t\tconst extra = 30;\n\t\tconst model = this._editor.getModel()!;\n\t\tconst visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow();\n\t\tconst result: Range[] = [];\n\t\tfor (const range of visibleRanges.sort(Range.compareRangesUsingStarts)) {\n\t\t\tconst extendedRange = model.validateRange(new Range(range.startLineNumber - extra, range.startColumn, range.endLineNumber + extra, range.endColumn));\n\t\t\tif (result.length === 0 || !Range.areIntersectingOrTouching(result[result.length - 1], extendedRange)) {\n\t\t\t\tresult.push(extendedRange);\n\t\t\t} else {\n\t\t\t\tresult[result.length - 1] = Range.plusRange(result[result.length - 1], extendedRange);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _updateHintsDecorators(ranges: readonly Range[], items: readonly InlayHintItem[]): void {\n\n\t\tconst itemFixedLengths = new Map<InlayHintItem, number>();\n\n\t\tif (this._cursorInfo\n\t\t\t&& this._cursorInfo.notEarlierThan > Date.now()\n\t\t\t&& ranges.some(range => range.containsPosition(this._cursorInfo!.position))\n\t\t) {\n\t\t\t// collect inlay hints that are on the same line and before the cursor. Those \"old\" hints\n\t\t\t// define fixed lengths so that the cursor does not jump back and worth while typing.\n\t\t\tconst { position } = this._cursorInfo;\n\t\t\tthis._cursorInfo = undefined;\n\n\t\t\tconst lengths = new Map<InlayHintItem, number>();\n\n\t\t\tfor (const deco of this._editor.getLineDecorations(position.lineNumber) ?? []) {\n\n\t\t\t\tconst data = this._decorationsMetadata.get(deco.id);\n\t\t\t\tif (deco.range.startColumn > position.column) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst opts = data?.decoration.options[data.item.anchor.direction];\n\t\t\t\tif (opts && opts.attachedData !== InlayHintsController._whitespaceData) {\n\t\t\t\t\tconst len = lengths.get(data.item) ?? 0;\n\t\t\t\t\tlengths.set(data.item, len + opts.content.length);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// on the cursor line and before the cursor-column\n\t\t\tconst newItemsWithFixedLength = items.filter(item => item.anchor.range.startLineNumber === position.lineNumber && item.anchor.range.endColumn <= position.column);\n\t\t\tconst fixedLengths = Array.from(lengths.values());\n\n\t\t\t// match up fixed lengths with items and distribute the remaining lengths to the last item\n\t\t\tlet lastItem: InlayHintItem | undefined;\n\t\t\twhile (true) {\n\t\t\t\tconst targetItem = newItemsWithFixedLength.shift();\n\t\t\t\tconst fixedLength = fixedLengths.shift();\n\n\t\t\t\tif (!fixedLength && !targetItem) {\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\n\t\t\t\tif (targetItem) {\n\t\t\t\t\titemFixedLengths.set(targetItem, fixedLength ?? 0);\n\t\t\t\t\tlastItem = targetItem;\n\n\t\t\t\t} else if (lastItem && fixedLength) {\n\t\t\t\t\t// still lengths but no more item. give it all to the last\n\t\t\t\t\tlet len = itemFixedLengths.get(lastItem)!;\n\t\t\t\t\tlen += fixedLength;\n\t\t\t\t\tlen += fixedLengths.reduce((p, c) => p + c, 0);\n\t\t\t\t\tfixedLengths.length = 0;\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// utils to collect/create injected text decorations\n\t\tconst newDecorationsData: InlayHintDecorationRenderInfo[] = [];\n\t\tconst addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart | object): void => {\n\t\t\tconst opts: InjectedTextOptions = {\n\t\t\t\tcontent,\n\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\tinlineClassName: ref.className,\n\t\t\t\tcursorStops,\n\t\t\t\tattachedData\n\t\t\t};\n\t\t\tnewDecorationsData.push({\n\t\t\t\titem,\n\t\t\t\tclassNameRef: ref,\n\t\t\t\tdecoration: {\n\t\t\t\t\trange: item.anchor.range,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// className: \"rangeHighlight\", // DEBUG highlight to see to what range a hint is attached\n\t\t\t\t\t\tdescription: 'InlayHint',\n\t\t\t\t\t\tshowIfCollapsed: item.anchor.range.isEmpty(), // \"original\" range is empty\n\t\t\t\t\t\tcollapseOnReplaceEdit: !item.anchor.range.isEmpty(),\n\t\t\t\t\t\tstickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,\n\t\t\t\t\t\t[item.anchor.direction]: this._activeRenderMode === RenderMode.Normal ? opts : undefined\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst addInjectedWhitespace = (item: InlayHintItem, isLast: boolean): void => {\n\t\t\tconst marginRule = this._ruleFactory.createClassNameRef({\n\t\t\t\twidth: `${(fontSize / 3) | 0}px`,\n\t\t\t\tdisplay: 'inline-block'\n\t\t\t});\n\t\t\taddInjectedText(item, marginRule, '\\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, InlayHintsController._whitespaceData);\n\t\t};\n\n\n\t\t//\n\t\tconst { fontSize, fontFamily, padding, isUniform } = this._getLayoutInfo();\n\t\tconst maxLength = this._editor.getOption(EditorOption.inlayHints).maximumLength;\n\t\tconst fontFamilyVar = '--code-editorInlayHintsFontFamily';\n\t\tthis._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily);\n\n\n\t\ttype ILineInfo = { line: number; totalLen: number };\n\t\tlet currentLineInfo: ILineInfo = { line: 0, totalLen: 0 };\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst item = items[i];\n\n\t\t\tif (currentLineInfo.line !== item.anchor.range.startLineNumber) {\n\t\t\t\tcurrentLineInfo = { line: item.anchor.range.startLineNumber, totalLen: 0 };\n\t\t\t}\n\n\t\t\tif (maxLength && currentLineInfo.totalLen > maxLength) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// whitespace leading the actual label\n\t\t\tif (item.hint.paddingLeft) {\n\t\t\t\taddInjectedWhitespace(item, false);\n\t\t\t}\n\n\t\t\t// the label with its parts\n\t\t\tconst parts: languages.InlayHintLabelPart[] = typeof item.hint.label === 'string'\n\t\t\t\t? [{ label: item.hint.label }]\n\t\t\t\t: item.hint.label;\n\n\t\t\tconst itemFixedLength = itemFixedLengths.get(item);\n\t\t\tlet itemActualLength = 0;\n\n\t\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\t\tconst part = parts[i];\n\n\t\t\t\tconst isFirst = i === 0;\n\t\t\t\tconst isLast = i === parts.length - 1;\n\n\t\t\t\tconst cssProperties: CssProperties = {\n\t\t\t\t\tfontSize: `${fontSize}px`,\n\t\t\t\t\tfontFamily: `var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}`,\n\t\t\t\t\tverticalAlign: isUniform ? 'baseline' : 'middle',\n\t\t\t\t\tunicodeBidi: 'isolate'\n\t\t\t\t};\n\n\t\t\t\tif (isNonEmptyArray(item.hint.textEdits)) {\n\t\t\t\t\tcssProperties.cursor = 'default';\n\t\t\t\t}\n\n\t\t\t\tthis._fillInColors(cssProperties, item.hint);\n\n\t\t\t\tif ((part.command || part.location) && this._activeInlayHintPart?.part.item === item && this._activeInlayHintPart.part.index === i) {\n\t\t\t\t\t// active link!\n\t\t\t\t\tcssProperties.textDecoration = 'underline';\n\t\t\t\t\tif (this._activeInlayHintPart.hasTriggerModifier) {\n\t\t\t\t\t\tcssProperties.color = themeColorFromId(colors.editorActiveLinkForeground);\n\t\t\t\t\t\tcssProperties.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet textlabel = part.label;\n\t\t\t\tcurrentLineInfo.totalLen += textlabel.length;\n\t\t\t\tlet tooLong = false;\n\t\t\t\tconst over = maxLength !== 0 ? (currentLineInfo.totalLen - maxLength) : 0;\n\t\t\t\tif (over > 0) {\n\t\t\t\t\ttextlabel = textlabel.slice(0, -over) + '…';\n\t\t\t\t\ttooLong = true;\n\t\t\t\t}\n\n\t\t\t\titemActualLength += textlabel.length;\n\n\t\t\t\tif (itemFixedLength !== undefined) {\n\t\t\t\t\tconst overFixedLength = itemActualLength - itemFixedLength;\n\t\t\t\t\tif (overFixedLength >= 0) {\n\t\t\t\t\t\t// longer than fixed length, trim\n\t\t\t\t\t\titemActualLength -= overFixedLength;\n\t\t\t\t\t\ttextlabel = textlabel.slice(0, -(1 + overFixedLength)) + '…';\n\t\t\t\t\t\ttooLong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (padding) {\n\t\t\t\t\tif (isFirst && (isLast || tooLong)) {\n\t\t\t\t\t\t// only element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if (isFirst) {\n\t\t\t\t\t\t// first element\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`;\n\t\t\t\t\t\tcssProperties.borderRadius = `${(fontSize / 4) | 0}px 0 0 ${(fontSize / 4) | 0}px`;\n\t\t\t\t\t} else if ((isLast || tooLong)) {\n\t\t\t\t\t\t// last element\n\t\t\t\t\t\tcssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`;\n\t\t\t\t\t\tcssProperties.borderRadius = `0 ${(fontSize / 4) | 0}px ${(fontSize / 4) | 0}px 0`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcssProperties.padding = `1px 0 1px 0`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef(cssProperties),\n\t\t\t\t\tfixSpace(textlabel),\n\t\t\t\t\tisLast && !item.hint.paddingRight ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None,\n\t\t\t\t\tnew RenderedInlayHintLabelPart(item, i)\n\t\t\t\t);\n\n\t\t\t\tif (tooLong) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (itemFixedLength !== undefined && itemActualLength < itemFixedLength) {\n\t\t\t\t// shorter than fixed length, pad\n\t\t\t\tconst pad = (itemFixedLength - itemActualLength);\n\t\t\t\taddInjectedText(\n\t\t\t\t\titem,\n\t\t\t\t\tthis._ruleFactory.createClassNameRef({}),\n\t\t\t\t\t'\\u200a'.repeat(pad),\n\t\t\t\t\tInjectedTextCursorStops.None\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// whitespace trailing the actual label\n\t\t\tif (item.hint.paddingRight) {\n\t\t\t\taddInjectedWhitespace(item, true);\n\t\t\t}\n\n\t\t\tif (newDecorationsData.length > InlayHintsController._MAX_DECORATORS) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// collect all decoration ids that are affected by the ranges\n\t\t// and only update those decorations\n\t\tconst decorationIdsToReplace: string[] = [];\n\t\tfor (const [id, metadata] of this._decorationsMetadata) {\n\t\t\tconst range = this._editor.getModel()?.getDecorationRange(id);\n\t\t\tif (range && ranges.some(r => r.containsRange(range))) {\n\t\t\t\tdecorationIdsToReplace.push(id);\n\t\t\t\tmetadata.classNameRef.dispose();\n\t\t\t\tthis._decorationsMetadata.delete(id);\n\t\t\t}\n\t\t}\n\n\t\tconst scrollState = StableEditorScrollState.capture(this._editor);\n\n\t\tthis._editor.changeDecorations(accessor => {\n\t\t\tconst newDecorationIds = accessor.deltaDecorations(decorationIdsToReplace, newDecorationsData.map(d => d.decoration));\n\t\t\tfor (let i = 0; i < newDecorationIds.length; i++) {\n\t\t\t\tconst data = newDecorationsData[i];\n\t\t\t\tthis._decorationsMetadata.set(newDecorationIds[i], data);\n\t\t\t}\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _fillInColors(props: CssProperties, hint: languages.InlayHint): void {\n\t\tif (hint.kind === languages.InlayHintKind.Parameter) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintParameterBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintParameterForeground);\n\t\t} else if (hint.kind === languages.InlayHintKind.Type) {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintTypeBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintTypeForeground);\n\t\t} else {\n\t\t\tprops.backgroundColor = themeColorFromId(colors.editorInlayHintBackground);\n\t\t\tprops.color = themeColorFromId(colors.editorInlayHintForeground);\n\t\t}\n\t}\n\n\tprivate _getLayoutInfo() {\n\t\tconst options = this._editor.getOption(EditorOption.inlayHints);\n\t\tconst padding = options.padding;\n\n\t\tconst editorFontSize = this._editor.getOption(EditorOption.fontSize);\n\t\tconst editorFontFamily = this._editor.getOption(EditorOption.fontFamily);\n\n\t\tlet fontSize = options.fontSize;\n\t\tif (!fontSize || fontSize < 5 || fontSize > editorFontSize) {\n\t\t\tfontSize = editorFontSize;\n\t\t}\n\n\t\tconst fontFamily = options.fontFamily || editorFontFamily;\n\n\t\tconst isUniform = !padding\n\t\t\t&& fontFamily === editorFontFamily\n\t\t\t&& fontSize === editorFontSize;\n\n\t\treturn { fontSize, fontFamily, padding, isUniform };\n\t}\n\n\tprivate _removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));\n\t\tfor (const obj of this._decorationsMetadata.values()) {\n\t\t\tobj.classNameRef.dispose();\n\t\t}\n\t\tthis._decorationsMetadata.clear();\n\t}\n}\n\n\n// Prevents the view from potentially visible whitespace\nfunction fixSpace(str: string): string {\n\tconst noBreakWhitespace = '\\xa0';\n\treturn str.replace(/[ \\t]/g, noBreakWhitespace);\n}\n\nCommandsRegistry.registerCommand('_executeInlayHintProvider', async (accessor, ...args: [URI, IRange]): Promise<languages.InlayHint[]> => {\n\n\tconst [uri, range] = args;\n\tassertType(URI.isUri(uri));\n\tassertType(Range.isIRange(range));\n\n\tconst { inlayHintsProvider } = accessor.get(ILanguageFeaturesService);\n\tconst ref = await accessor.get(ITextModelService).createModelReference(uri);\n\ttry {\n\t\tconst model = await InlayHintsFragments.create(inlayHintsProvider, ref.object.textEditorModel, [Range.lift(range)], CancellationToken.None);\n\t\tconst result = model.items.map(i => i.hint);\n\t\tsetTimeout(() => model.dispose(), 0); // dispose after sending to ext host\n\t\treturn result;\n\t} finally {\n\t\tref.dispose();\n\t}\n});\n"]}
|