monaco-editor-core 0.56.0-dev-20260119 → 0.56.0-dev-20260121
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.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/dom.js +8 -0
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +1 -0
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +4 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.css +8 -5
- package/esm/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.js +1 -0
- package/esm/vs/base/browser/ui/list/list.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +62 -5
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +0 -4
- package/esm/vs/base/common/defaultAccount.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +81 -35
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/editContext.js +11 -0
- package/esm/vs/editor/browser/controller/editContext/editContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +38 -18
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +4 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +39 -16
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/view.js +21 -1
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +18 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +3 -3
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +7 -5
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +21 -17
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js +11 -4
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +25 -14
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/common/viewModel.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +3 -3
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +28 -64
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +27 -20
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +37 -10
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.css +7 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +22 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +19 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +5 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +46 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +8 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +2 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +1 -0
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +16 -1
- package/esm/vs/platform/product/common/product.js.map +1 -1
- package/monaco.d.ts +5 -1
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC1G,OAAO,EAAoC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7M,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,4DAA4D,CAAC;AAG3F,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,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":"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 { ModifierKeyEmitter, n, trackFocus } from '../../../../../../../base/browser/dom.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, ISettableObservable, autorun, constObservable, debouncedObservable, derived, observableFromEvent, observableValue, runOnChange } from '../../../../../../../base/common/observable.js';\nimport { IAccessibilityService } from '../../../../../../../platform/accessibility/common/accessibility.js';\nimport { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { IEditorMouseEvent } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { HoverService } from '../../../../../../../platform/hover/browser/hoverService.js';\nimport { HoverWidget } from '../../../../../../../platform/hover/browser/hoverWidget.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getEditorBlendedColor, INLINE_EDITS_BORDER_RADIUS, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorSuccessfulBackground, inlineEditIndicatorSuccessfulBorder, inlineEditIndicatorSuccessfulForeground } from '../theme.js';\nimport { mapOutFalsy, rectToProps } from '../utils/utils.js';\nimport { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';\nimport { assertNever } from '../../../../../../../base/common/assert.js';\nimport { Command, InlineCompletionCommand, IInlineCompletionModelInfo } from '../../../../../../common/languages.js';\nimport { InlineSuggestionItem } from '../../../model/inlineSuggestionItem.js';\nimport { localize } from '../../../../../../../nls.js';\nimport { InlineCompletionsModel } from '../../../model/inlineCompletionsModel.js';\nimport { InlineSuggestAlternativeAction } from '../../../model/InlineSuggestAlternativeAction.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\n\nexport class InlineEditsGutterIndicatorData {\n\tconstructor(\n\t\treadonly gutterMenuData: InlineSuggestionGutterMenuData,\n\t\treadonly originalRange: LineRange,\n\t\treadonly model: SimpleInlineSuggestModel,\n\t\treadonly altAction: InlineSuggestAlternativeAction | undefined,\n\t) { }\n}\n\nexport class InlineSuggestionGutterMenuData {\n\tpublic static fromInlineSuggestion(suggestion: InlineSuggestionItem): InlineSuggestionGutterMenuData {\n\t\tconst alternativeAction = suggestion.action?.kind === 'edit' ? suggestion.action.alternativeAction : undefined;\n\t\treturn new InlineSuggestionGutterMenuData(\n\t\t\tsuggestion.gutterMenuLinkAction,\n\t\t\tsuggestion.source.provider.displayName ?? localize('inlineSuggestion', \"Inline Suggestion\"),\n\t\t\tsuggestion.source.inlineSuggestions.commands ?? [],\n\t\t\talternativeAction,\n\t\t\tsuggestion.source.provider.modelInfo,\n\t\t\tsuggestion.source.provider.setModelId?.bind(suggestion.source.provider),\n\t\t);\n\t}\n\n\tconstructor(\n\t\treadonly action: Command | undefined,\n\t\treadonly displayName: string,\n\t\treadonly extensionCommands: InlineCompletionCommand[],\n\t\treadonly alternativeAction: InlineSuggestAlternativeAction | undefined,\n\t\treadonly modelInfo: IInlineCompletionModelInfo | undefined,\n\t\treadonly setModelId: ((modelId: string) => Promise<void>) | undefined,\n\t) { }\n}\n\n// TODO this class does not make that much sense yet.\nexport class SimpleInlineSuggestModel {\n\tpublic static fromInlineCompletionModel(model: InlineCompletionsModel): SimpleInlineSuggestModel {\n\t\treturn new SimpleInlineSuggestModel(\n\t\t\t() => model.accept(),\n\t\t\t() => model.jump(),\n\t\t);\n\t}\n\n\tconstructor(\n\t\treadonly accept: () => void,\n\t\treadonly jump: () => void,\n\t) { }\n}\n\nconst CODICON_SIZE_PX = 16;\nconst CODICON_PADDING_PX = 2;\n\nexport class InlineEditsGutterIndicator extends Disposable {\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _data: IObservable<InlineEditsGutterIndicatorData | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\tprivate readonly _verticalOffset: IObservable<number>,\n\t\tprivate readonly _isHoveringOverInlineEdit: IObservable<boolean>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\n\t\t@IHoverService private readonly _hoverService: HoverService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IThemeService private readonly _themeService: IThemeService\n\t) {\n\t\tsuper();\n\n\t\tthis._originalRangeObs = mapOutFalsy(this._data.map(d => d?.originalRange));\n\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController\n\t\t\t? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight)\n\t\t\t: constObservable(0);\n\n\t\tconst indicator = this._indicator.keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: indicator.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tconst state = this._state.get();\n\t\t\tif (state === undefined) { return; }\n\n\t\t\tconst el = this._iconRef.element;\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tconst rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height);\n\t\t\tconst point = new Point(e.event.posx, e.event.posy);\n\t\t\tthis._isHoveredOverIcon.set(rectangularArea.containsPoint(point), undefined);\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onDidScrollChange(() => {\n\t\t\tthis._isHoveredOverIcon.set(false, undefined);\n\t\t}));\n\n\t\tthis._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);\n\n\t\t// pulse animation when hovering inline edit\n\t\tthis._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => {\n\t\t\tif (isHovering) {\n\t\t\t\tthis.triggerAnimation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tindicator.readEffect(reader);\n\t\t\tif (indicator.element) {\n\t\t\t\t// For the line number\n\t\t\t\tthis._editorObs.editor.applyFontInfo(indicator.element);\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate readonly _isHoveredOverInlineEditDebounced: IObservable<boolean>;\n\n\tprivate readonly _modifierPressed = observableFromEvent(this, ModifierKeyEmitter.getInstance().event, () => ModifierKeyEmitter.getInstance().keyStatus.shiftKey);\n\tprivate readonly _gutterIndicatorStyles = derived(this, reader => {\n\t\tlet v = this._tabAction.read(reader);\n\n\t\t// TODO: add source of truth for alt action active and key pressed\n\t\tconst altAction = this._data.read(reader)?.altAction;\n\t\tconst modifiedPressed = this._modifierPressed.read(reader);\n\t\tif (altAction && modifiedPressed) {\n\t\t\tv = InlineEditTabAction.Inactive;\n\t\t}\n\n\t\tswitch (v) {\n\t\t\tcase InlineEditTabAction.Inactive: return {\n\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, this._themeService).read(reader).toString(),\n\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, this._themeService).read(reader).toString(),\n\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, this._themeService).read(reader).toString(),\n\t\t\t};\n\t\t\tcase InlineEditTabAction.Jump: return {\n\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, this._themeService).read(reader).toString(),\n\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, this._themeService).read(reader).toString(),\n\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, this._themeService).read(reader).toString()\n\t\t\t};\n\t\t\tcase InlineEditTabAction.Accept: return {\n\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSuccessfulBackground, this._themeService).read(reader).toString(),\n\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSuccessfulForeground, this._themeService).read(reader).toString(),\n\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSuccessfulBorder, this._themeService).read(reader).toString()\n\t\t\t};\n\t\t\tdefault:\n\t\t\t\tassertNever(v);\n\t\t}\n\t});\n\n\tpublic triggerAnimation(): Promise<Animation> {\n\t\tif (this._accessibilityService.isMotionReduced()) {\n\t\t\treturn new Animation(null, null).finished;\n\t\t}\n\n\t\t// PULSE ANIMATION:\n\t\tconst animation = this._iconRef.element.animate([\n\t\t\t{\n\t\t\t\toutline: `2px solid ${this._gutterIndicatorStyles.map(v => v.border).get()}`,\n\t\t\t\toutlineOffset: '-1px',\n\t\t\t\toffset: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\toutline: `2px solid transparent`,\n\t\t\t\toutlineOffset: '10px',\n\t\t\t\toffset: 1\n\t\t\t},\n\t\t], { duration: 500 });\n\n\t\treturn animation.finished;\n\t}\n\n\tprivate readonly _originalRangeObs;\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tconst range = this._originalRangeObs.read(reader);\n\t\tif (!range) { return undefined; }\n\t\treturn {\n\t\t\trange,\n\t\t\tlineOffsetRange: this._editorObs.observeLineOffsetRange(range, reader.store),\n\t\t};\n\t});\n\n\tprivate readonly _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _lineNumberToRender = derived(this, reader => {\n\t\tif (this._verticalOffset.read(reader) !== 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst lineNumber = this._data.read(reader)?.originalRange.startLineNumber;\n\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\n\t\tif (lineNumber === undefined || lineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Interval) {\n\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) {\n\t\t\t\treturn lineNumber.toString();\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative) {\n\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (!cursorPosition) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tconst relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber);\n\t\t\tif (relativeLineNumber === 0) {\n\t\t\t\treturn lineNumber.toString();\n\t\t\t}\n\t\t\treturn relativeLineNumber.toString();\n\t\t}\n\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Custom) {\n\t\t\tif (lineNumberOptions.renderFn) {\n\t\t\t\treturn lineNumberOptions.renderFn(lineNumber);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\treturn lineNumber.toString();\n\t});\n\n\tprivate readonly _availableWidthForIcon = derived(this, reader => {\n\t\tconst textModel = this._editorObs.editor.getModel();\n\t\tconst editor = this._editorObs.editor;\n\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\t\tconst gutterWidth = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft;\n\n\t\tif (!textModel || gutterWidth <= 0) {\n\t\t\treturn () => 0;\n\t\t}\n\n\t\t// no glyph margin => the entire gutter width is available as there is no optimal place to put the icon\n\t\tif (layout.lineNumbersLeft === 0) {\n\t\t\treturn () => gutterWidth;\n\t\t}\n\n\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative || /* likely to flicker */\n\t\t\tlineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\treturn () => gutterWidth;\n\t\t}\n\n\t\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\tconst rightOfLineNumber = layout.lineNumbersLeft + layout.lineNumbersWidth;\n\t\tconst totalLines = textModel.getLineCount();\n\t\tconst totalLinesDigits = (totalLines + 1 /* 0 based to 1 based*/).toString().length;\n\n\t\tconst offsetDigits: {\n\t\t\tfirstLineNumberWithDigitCount: number;\n\t\t\ttopOfLineNumber: number;\n\t\t\tusableWidthLeftOfLineNumber: number;\n\t\t}[] = [];\n\n\t\t// We only need to pre compute the usable width left of the line number for the first line number with a given digit count\n\t\tfor (let digits = 1; digits <= totalLinesDigits; digits++) {\n\t\t\tconst firstLineNumberWithDigitCount = 10 ** (digits - 1);\n\t\t\tconst topOfLineNumber = editor.getTopForLineNumber(firstLineNumberWithDigitCount);\n\t\t\tconst digitsWidth = digits * w;\n\t\t\tconst usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout.glyphMarginLeft));\n\t\t\toffsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber });\n\t\t}\n\n\t\treturn (topOffset: number) => {\n\t\t\tfor (let i = offsetDigits.length - 1; i >= 0; i--) {\n\t\t\t\tif (topOffset >= offsetDigits[i].topOfLineNumber) {\n\t\t\t\t\treturn offsetDigits[i].usableWidthLeftOfLineNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new BugIndicatingError('Could not find avilable width for icon');\n\t\t};\n\t});\n\n\tprivate readonly _layout = derived(this, reader => {\n\t\tconst s = this._state.read(reader);\n\t\tif (!s) { return undefined; }\n\n\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\n\t\tconst lineHeight = this._editorObs.observeLineHeightForLine(s.range.map(r => r.startLineNumber)).read(reader);\n\t\tconst gutterViewPortPaddingLeft = 1;\n\t\tconst gutterViewPortPaddingTop = 2;\n\n\t\t// Entire gutter view from top left to bottom right\n\t\tconst gutterWidthWithoutPadding = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft - 2 * gutterViewPortPaddingLeft;\n\t\tconst gutterHeightWithoutPadding = layout.height - 2 * gutterViewPortPaddingTop;\n\t\tconst gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPaddingLeft, gutterViewPortPaddingTop, gutterWidthWithoutPadding, gutterHeightWithoutPadding);\n\t\tconst gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader));\n\t\tconst gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPaddingTop);\n\n\t\t// The glyph margin area across all relevant lines\n\t\tconst verticalEditRange = s.lineOffsetRange.read(reader);\n\t\tconst gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange);\n\n\t\t// The gutter view container (pill)\n\t\tconst pillHeight = lineHeight;\n\t\tconst pillOffset = this._verticalOffset.read(reader);\n\t\tconst pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset);\n\t\tconst pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect);\n\n\t\t// The icon which will be rendered in the pill\n\t\tconst iconNoneDocked = this._tabAction.map(action => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight);\n\t\tconst iconDocked = derived(this, reader => {\n\t\t\tif (this._isHoveredOverIconDebounced.read(reader) || this._isHoveredOverInlineEditDebounced.read(reader)) {\n\t\t\t\treturn Codicon.check;\n\t\t\t}\n\t\t\tif (this._tabAction.read(reader) === InlineEditTabAction.Accept) {\n\t\t\t\treturn Codicon.keyboardTab;\n\t\t\t}\n\t\t\tconst cursorLineNumber = this._editorObs.cursorLineNumber.read(reader) ?? 0;\n\t\t\tconst editStartLineNumber = s.range.read(reader).startLineNumber;\n\t\t\treturn cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow;\n\t\t});\n\n\t\tconst idealIconAreaWidth = 22;\n\t\tconst iconWidth = (pillRect: Rect) => {\n\t\t\tconst availableIconAreaWidth = this._availableWidthForIcon.read(undefined)(pillRect.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPaddingLeft;\n\t\t\treturn Math.max(Math.min(availableIconAreaWidth, idealIconAreaWidth), CODICON_SIZE_PX);\n\t\t};\n\n\t\tif (pillIsFullyDocked) {\n\t\t\tconst pillRect = pillFullyDockedRect;\n\n\t\t\tlet widthUntilLineNumberEnd;\n\t\t\tif (layout.lineNumbersWidth === 0) {\n\t\t\t\twidthUntilLineNumberEnd = Math.min(Math.max(layout.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect.width - idealIconAreaWidth);\n\t\t\t} else {\n\t\t\t\twidthUntilLineNumberEnd = Math.max(layout.lineNumbersLeft + layout.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0);\n\t\t\t}\n\n\t\t\tconst lineNumberRect = pillRect.withWidth(widthUntilLineNumberEnd);\n\t\t\tconst minimalIconWidthWithPadding = CODICON_SIZE_PX + CODICON_PADDING_PX;\n\t\t\tconst iconWidth = Math.min(pillRect.width - widthUntilLineNumberEnd, idealIconAreaWidth);\n\t\t\tconst iconRect = pillRect.withWidth(Math.max(iconWidth, minimalIconWidthWithPadding)).translateX(widthUntilLineNumberEnd);\n\t\t\tconst iconVisible = iconWidth >= minimalIconWidthWithPadding;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconDocked,\n\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\ticonRect,\n\t\t\t\ticonVisible,\n\t\t\t\tpillRect,\n\t\t\t\tlineNumberRect,\n\t\t\t};\n\t\t}\n\n\t\tconst pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); // The area in which the pill could be partially docked\n\t\tconst pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight;\n\n\t\tif (pillIsPartiallyDocked) {\n\t\t\t// pillFullyDockedRect is outside viewport, move it into the viewport under sticky scroll as we prefer the pill to not be on top of the sticky scroll\n\t\t\t// then move it into the possible area which will only cause it to move if it has to be rendered on top of the sticky scroll\n\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea);\n\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\tconst iconRect = pillRect;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconDocked,\n\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\ticonRect,\n\t\t\t\tpillRect,\n\t\t\t\ticonVisible: true,\n\t\t\t};\n\t\t}\n\n\t\t// pillFullyDockedRect is outside viewport, so move it into viewport\n\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll);\n\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\tconst iconRect = pillRect;\n\n\t\t// docked = pill was already in the viewport\n\t\tconst iconDirection = pillRect.top < pillFullyDockedRect.top ?\n\t\t\t'top' as const :\n\t\t\t'bottom' as const;\n\n\t\treturn {\n\t\t\tgutterEditArea,\n\t\t\ticon: iconNoneDocked,\n\t\t\ticonDirection,\n\t\t\ticonRect,\n\t\t\tpillRect,\n\t\t\ticonVisible: true,\n\t\t};\n\t});\n\n\n\tprivate readonly _iconRef = n.ref<HTMLDivElement>();\n\n\tpublic readonly isVisible = this._layout.map(l => !!l);\n\n\tprivate readonly _hoverVisible = observableValue(this, false);\n\tpublic readonly isHoverVisible: IObservable<boolean> = this._hoverVisible;\n\n\tprivate readonly _isHoveredOverIcon = observableValue(this, false);\n\tprivate readonly _isHoveredOverIconDebounced: IObservable<boolean> = debouncedObservable(this._isHoveredOverIcon, 100);\n\tpublic readonly isHoveredOverIcon: IObservable<boolean> = this._isHoveredOverIconDebounced;\n\n\tprivate _showHover(): void {\n\t\tif (this._hoverVisible.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst data = this._data.get();\n\t\tif (!data) {\n\t\t\tthrow new BugIndicatingError('Gutter indicator data not available');\n\t\t}\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst content = disposableStore.add(this._instantiationService.createInstance(\n\t\t\tGutterIndicatorMenuContent,\n\t\t\tthis._editorObs,\n\t\t\tdata.gutterMenuData,\n\t\t\t(focusEditor) => {\n\t\t\t\tif (focusEditor) {\n\t\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\t}\n\t\t\t\th?.dispose();\n\t\t\t},\n\t\t).toDisposableLiveElement());\n\n\t\tconst focusTracker = disposableStore.add(trackFocus(content.element)); // TODO@benibenj should this be removed?\n\t\tdisposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, undefined)));\n\t\tdisposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, undefined)));\n\t\tdisposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, undefined)));\n\n\t\tconst h = this._hoverService.showInstantHover({\n\t\t\ttarget: this._iconRef.element,\n\t\t\tcontent: content.element,\n\t\t}) as HoverWidget | undefined;\n\t\tif (h) {\n\t\t\tthis._hoverVisible.set(true, undefined);\n\t\t\tdisposableStore.add(this._editorObs.editor.onDidScrollChange(() => h.dispose()));\n\t\t\tdisposableStore.add(h.onDispose(() => {\n\t\t\t\tthis._hoverVisible.set(false, undefined);\n\t\t\t\tdisposableStore.dispose();\n\t\t\t}));\n\t\t} else {\n\t\t\tdisposableStore.dispose();\n\t\t}\n\t}\n\n\tprivate readonly _indicator = n.div({\n\t\tclass: 'inline-edits-view-gutter-indicator',\n\t\tstyle: {\n\t\t\tposition: 'absolute',\n\t\t\toverflow: 'visible',\n\t\t},\n\t}, mapOutFalsy(this._layout).map(layout => !layout ? [] : [\n\t\tn.div({\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tbackground: asCssVariable(inlineEditIndicatorBackground),\n\t\t\t\tborderRadius: `${INLINE_EDITS_BORDER_RADIUS}px`,\n\t\t\t\t...rectToProps(reader => layout.read(reader).gutterEditArea),\n\t\t\t}\n\t\t}),\n\t\tn.div({\n\t\t\tclass: 'icon',\n\t\t\tref: this._iconRef,\n\n\t\t\ttabIndex: 0,\n\t\t\tonclick: () => {\n\t\t\t\tconst layout = this._layout.get();\n\t\t\t\tconst acceptOnClick = layout?.icon.get() === Codicon.check;\n\n\t\t\t\tconst data = this._data.get();\n\t\t\t\tif (!data) { throw new BugIndicatingError('Gutter indicator data not available'); }\n\n\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\tif (acceptOnClick) {\n\t\t\t\t\tdata.model.accept();\n\t\t\t\t} else {\n\t\t\t\t\tdata.model.jump();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tonmouseenter: () => {\n\t\t\t\t// TODO show hover when hovering ghost text etc.\n\t\t\t\tthis._showHover();\n\t\t\t},\n\t\t\tstyle: {\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tzIndex: '20',\n\t\t\t\tposition: 'absolute',\n\t\t\t\tbackgroundColor: this._gutterIndicatorStyles.map(v => v.background),\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t['--vscodeIconForeground' as any]: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\tborder: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\tborderRadius: `${INLINE_EDITS_BORDER_RADIUS}px`,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tjustifyContent: layout.map(l => l.iconDirection === 'bottom' ? 'flex-start' : 'flex-end'),\n\t\t\t\ttransition: this._modifierPressed.map(m => m ? '' : 'background-color 0.2s ease-in-out, width 0.2s ease-in-out'),\n\t\t\t\t...rectToProps(reader => layout.read(reader).pillRect),\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({\n\t\t\t\tclassName: 'line-number',\n\t\t\t\tstyle: {\n\t\t\t\t\tlineHeight: layout.map(l => l.lineNumberRect ? l.lineNumberRect.height : 0),\n\t\t\t\t\tdisplay: layout.map(l => l.lineNumberRect ? 'flex' : 'none'),\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\twidth: layout.map(l => l.lineNumberRect ? l.lineNumberRect.width : 0),\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcolor: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t}\n\t\t\t},\n\t\t\t\tthis._lineNumberToRender\n\t\t\t),\n\t\t\tn.div({\n\t\t\t\tstyle: {\n\t\t\t\t\ttransform: layout.map(l => `rotate(${getRotationFromDirection(l.iconDirection)}deg)`),\n\t\t\t\t\ttransition: 'rotate 0.2s ease-in-out, opacity 0.2s ease-in-out',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\theight: '100%',\n\t\t\t\t\topacity: layout.map(l => l.iconVisible ? '1' : '0'),\n\t\t\t\t\tmarginRight: layout.map(l => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)),\n\t\t\t\t\twidth: layout.map(l => l.iconRect.width),\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\tright: layout.map(l => l.iconDirection === 'top' ? '1px' : '0'),\n\t\t\t\t}\n\t\t\t}, [\n\t\t\t\tlayout.map((l, reader) => withStyles(renderIcon(l.icon.read(reader)), { fontSize: toPx(Math.min(l.iconRect.width - CODICON_PADDING_PX, CODICON_SIZE_PX)) })),\n\t\t\t])\n\t\t]),\n\t]));\n}\n\nfunction getRotationFromDirection(direction: 'top' | 'bottom' | 'right'): number {\n\tswitch (direction) {\n\t\tcase 'top': return 90;\n\t\tcase 'bottom': return -90;\n\t\tcase 'right': return 0;\n\t}\n}\n\nfunction withStyles<T extends HTMLElement>(element: T, styles: { [key: string]: string }): T {\n\tfor (const key in styles) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\telement.style[key as any] = styles[key];\n\t}\n\treturn element;\n}\n\nfunction toPx(n: number): string {\n\treturn `${n}px`;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC1G,OAAO,EAAoC,OAAO,EAAE,eAAe,EA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SAAS,CAAC,CAAC;gBACzC,eAAe,CAAC,OAAO,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACP,eAAe,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;IACF,CAAC;CA0FD,CAAA;AA1eY,0BAA0B;IASpC,WAAA,aAAa,CAAA;IACb,WAAA,qBAAqB,CAAA;IACrB,WAAA,qBAAqB,CAAA;IACrB,WAAA,aAAa,CAAA;GAZH,0BAA0B,CA0etC;;AAED,SAAS,wBAAwB,CAAC,SAAqC;IACtE,QAAQ,SAAS,EAAE,CAAC;QACnB,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,KAAK,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACF,CAAC;AAED,SAAS,UAAU,CAAwB,OAAU,EAAE,MAAiC;IACvF,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1B,mDAAmD;QACnD,OAAO,CAAC,KAAK,CAAC,GAAU,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,IAAI,CAAC,CAAS;IACtB,OAAO,GAAG,CAAC,IAAI,CAAC;AACjB,CAAC","file":"gutterIndicatorView.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 { ModifierKeyEmitter, n, trackFocus } from '../../../../../../../base/browser/dom.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, ISettableObservable, autorun, constObservable, debouncedObservable, derived, observableFromEvent, observableValue, runOnChange } from '../../../../../../../base/common/observable.js';\nimport { IAccessibilityService } from '../../../../../../../platform/accessibility/common/accessibility.js';\nimport { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { IEditorMouseEvent } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { HoverService } from '../../../../../../../platform/hover/browser/hoverService.js';\nimport { HoverWidget } from '../../../../../../../platform/hover/browser/hoverWidget.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getEditorBlendedColor, INLINE_EDITS_BORDER_RADIUS, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorSuccessfulBackground, inlineEditIndicatorSuccessfulBorder, inlineEditIndicatorSuccessfulForeground } from '../theme.js';\nimport { mapOutFalsy, rectToProps } from '../utils/utils.js';\nimport { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';\nimport { assertNever } from '../../../../../../../base/common/assert.js';\nimport { Command, InlineCompletionCommand, IInlineCompletionModelInfo } from '../../../../../../common/languages.js';\nimport { InlineSuggestionItem } from '../../../model/inlineSuggestionItem.js';\nimport { localize } from '../../../../../../../nls.js';\nimport { InlineCompletionsModel } from '../../../model/inlineCompletionsModel.js';\nimport { InlineSuggestAlternativeAction } from '../../../model/InlineSuggestAlternativeAction.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { ThemeIcon } from '../../../../../../../base/common/themables.js';\n\n/**\n * Customization options for the gutter indicator appearance and behavior.\n */\nexport interface GutterIndicatorCustomization {\n\t/** Override the default icon */\n\treadonly icon?: ThemeIcon;\n}\n\nexport class InlineEditsGutterIndicatorData {\n\tconstructor(\n\t\treadonly gutterMenuData: InlineSuggestionGutterMenuData,\n\t\treadonly originalRange: LineRange,\n\t\treadonly model: SimpleInlineSuggestModel,\n\t\treadonly altAction: InlineSuggestAlternativeAction | undefined,\n\t\treadonly customization?: GutterIndicatorCustomization,\n\t) { }\n}\n\nexport class InlineSuggestionGutterMenuData {\n\tpublic static fromInlineSuggestion(suggestion: InlineSuggestionItem): InlineSuggestionGutterMenuData {\n\t\tconst alternativeAction = suggestion.action?.kind === 'edit' ? suggestion.action.alternativeAction : undefined;\n\t\treturn new InlineSuggestionGutterMenuData(\n\t\t\tsuggestion.gutterMenuLinkAction,\n\t\t\tsuggestion.source.provider.displayName ?? localize('inlineSuggestion', \"Inline Suggestion\"),\n\t\t\tsuggestion.source.inlineSuggestions.commands ?? [],\n\t\t\talternativeAction,\n\t\t\tsuggestion.source.provider.modelInfo,\n\t\t\tsuggestion.source.provider.setModelId?.bind(suggestion.source.provider),\n\t\t);\n\t}\n\n\tconstructor(\n\t\treadonly action: Command | undefined,\n\t\treadonly displayName: string,\n\t\treadonly extensionCommands: InlineCompletionCommand[],\n\t\treadonly alternativeAction: InlineSuggestAlternativeAction | undefined,\n\t\treadonly modelInfo: IInlineCompletionModelInfo | undefined,\n\t\treadonly setModelId: ((modelId: string) => Promise<void>) | undefined,\n\t) { }\n}\n\n// TODO this class does not make that much sense yet.\nexport class SimpleInlineSuggestModel {\n\tpublic static fromInlineCompletionModel(model: InlineCompletionsModel): SimpleInlineSuggestModel {\n\t\treturn new SimpleInlineSuggestModel(\n\t\t\t() => model.accept(),\n\t\t\t() => model.jump(),\n\t\t);\n\t}\n\n\tconstructor(\n\t\treadonly accept: () => void,\n\t\treadonly jump: () => void,\n\t) { }\n}\n\nconst CODICON_SIZE_PX = 16;\nconst CODICON_PADDING_PX = 2;\n\nexport class InlineEditsGutterIndicator extends Disposable {\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _data: IObservable<InlineEditsGutterIndicatorData | undefined>,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\tprivate readonly _verticalOffset: IObservable<number>,\n\t\tprivate readonly _isHoveringOverInlineEdit: IObservable<boolean>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\n\t\t@IHoverService private readonly _hoverService: HoverService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IThemeService private readonly _themeService: IThemeService\n\t) {\n\t\tsuper();\n\n\t\tthis._originalRangeObs = mapOutFalsy(this._data.map(d => d?.originalRange));\n\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController\n\t\t\t? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight)\n\t\t\t: constObservable(0);\n\n\t\tconst indicator = this._indicator.keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: indicator.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tconst state = this._state.get();\n\t\t\tif (state === undefined) { return; }\n\n\t\t\tconst el = this._iconRef.element;\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tconst rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height);\n\t\t\tconst point = new Point(e.event.posx, e.event.posy);\n\t\t\tthis._isHoveredOverIcon.set(rectangularArea.containsPoint(point), undefined);\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onDidScrollChange(() => {\n\t\t\tthis._isHoveredOverIcon.set(false, undefined);\n\t\t}));\n\n\t\tthis._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);\n\n\t\t// pulse animation when hovering inline edit\n\t\tthis._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => {\n\t\t\tif (isHovering) {\n\t\t\t\tthis.triggerAnimation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tindicator.readEffect(reader);\n\t\t\tif (indicator.element) {\n\t\t\t\t// For the line number\n\t\t\t\tthis._editorObs.editor.applyFontInfo(indicator.element);\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate readonly _isHoveredOverInlineEditDebounced: IObservable<boolean>;\n\n\tprivate readonly _modifierPressed = observableFromEvent(this, ModifierKeyEmitter.getInstance().event, () => ModifierKeyEmitter.getInstance().keyStatus.shiftKey);\n\tprivate readonly _gutterIndicatorStyles = derived(this, reader => {\n\t\tlet v = this._tabAction.read(reader);\n\n\t\t// TODO: add source of truth for alt action active and key pressed\n\t\tconst altAction = this._data.read(reader)?.altAction;\n\t\tconst modifiedPressed = this._modifierPressed.read(reader);\n\t\tif (altAction && modifiedPressed) {\n\t\t\tv = InlineEditTabAction.Inactive;\n\t\t}\n\n\t\tswitch (v) {\n\t\t\tcase InlineEditTabAction.Inactive: return {\n\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, this._themeService).read(reader).toString(),\n\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, this._themeService).read(reader).toString(),\n\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, this._themeService).read(reader).toString(),\n\t\t\t};\n\t\t\tcase InlineEditTabAction.Jump: return {\n\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, this._themeService).read(reader).toString(),\n\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, this._themeService).read(reader).toString(),\n\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, this._themeService).read(reader).toString()\n\t\t\t};\n\t\t\tcase InlineEditTabAction.Accept: return {\n\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSuccessfulBackground, this._themeService).read(reader).toString(),\n\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSuccessfulForeground, this._themeService).read(reader).toString(),\n\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSuccessfulBorder, this._themeService).read(reader).toString()\n\t\t\t};\n\t\t\tdefault:\n\t\t\t\tassertNever(v);\n\t\t}\n\t});\n\n\tpublic triggerAnimation(): Promise<Animation> {\n\t\tif (this._accessibilityService.isMotionReduced()) {\n\t\t\treturn new Animation(null, null).finished;\n\t\t}\n\n\t\t// PULSE ANIMATION:\n\t\tconst animation = this._iconRef.element.animate([\n\t\t\t{\n\t\t\t\toutline: `2px solid ${this._gutterIndicatorStyles.map(v => v.border).get()}`,\n\t\t\t\toutlineOffset: '-1px',\n\t\t\t\toffset: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\toutline: `2px solid transparent`,\n\t\t\t\toutlineOffset: '10px',\n\t\t\t\toffset: 1\n\t\t\t},\n\t\t], { duration: 500 });\n\n\t\treturn animation.finished;\n\t}\n\n\tprivate readonly _originalRangeObs;\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tconst range = this._originalRangeObs.read(reader);\n\t\tif (!range) { return undefined; }\n\t\treturn {\n\t\t\trange,\n\t\t\tlineOffsetRange: this._editorObs.observeLineOffsetRange(range, reader.store),\n\t\t};\n\t});\n\n\tprivate readonly _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _lineNumberToRender = derived(this, reader => {\n\t\tif (this._verticalOffset.read(reader) !== 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst lineNumber = this._data.read(reader)?.originalRange.startLineNumber;\n\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\n\t\tif (lineNumber === undefined || lineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Interval) {\n\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) {\n\t\t\t\treturn lineNumber.toString();\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative) {\n\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (!cursorPosition) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tconst relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber);\n\t\t\tif (relativeLineNumber === 0) {\n\t\t\t\treturn lineNumber.toString();\n\t\t\t}\n\t\t\treturn relativeLineNumber.toString();\n\t\t}\n\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Custom) {\n\t\t\tif (lineNumberOptions.renderFn) {\n\t\t\t\treturn lineNumberOptions.renderFn(lineNumber);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\treturn lineNumber.toString();\n\t});\n\n\tprivate readonly _availableWidthForIcon = derived(this, reader => {\n\t\tconst textModel = this._editorObs.editor.getModel();\n\t\tconst editor = this._editorObs.editor;\n\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\t\tconst gutterWidth = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft;\n\n\t\tif (!textModel || gutterWidth <= 0) {\n\t\t\treturn () => 0;\n\t\t}\n\n\t\t// no glyph margin => the entire gutter width is available as there is no optimal place to put the icon\n\t\tif (layout.lineNumbersLeft === 0) {\n\t\t\treturn () => gutterWidth;\n\t\t}\n\n\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative || /* likely to flicker */\n\t\t\tlineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\treturn () => gutterWidth;\n\t\t}\n\n\t\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\tconst rightOfLineNumber = layout.lineNumbersLeft + layout.lineNumbersWidth;\n\t\tconst totalLines = textModel.getLineCount();\n\t\tconst totalLinesDigits = (totalLines + 1 /* 0 based to 1 based*/).toString().length;\n\n\t\tconst offsetDigits: {\n\t\t\tfirstLineNumberWithDigitCount: number;\n\t\t\ttopOfLineNumber: number;\n\t\t\tusableWidthLeftOfLineNumber: number;\n\t\t}[] = [];\n\n\t\t// We only need to pre compute the usable width left of the line number for the first line number with a given digit count\n\t\tfor (let digits = 1; digits <= totalLinesDigits; digits++) {\n\t\t\tconst firstLineNumberWithDigitCount = 10 ** (digits - 1);\n\t\t\tconst topOfLineNumber = editor.getTopForLineNumber(firstLineNumberWithDigitCount);\n\t\t\tconst digitsWidth = digits * w;\n\t\t\tconst usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout.glyphMarginLeft));\n\t\t\toffsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber });\n\t\t}\n\n\t\treturn (topOffset: number) => {\n\t\t\tfor (let i = offsetDigits.length - 1; i >= 0; i--) {\n\t\t\t\tif (topOffset >= offsetDigits[i].topOfLineNumber) {\n\t\t\t\t\treturn offsetDigits[i].usableWidthLeftOfLineNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new BugIndicatingError('Could not find avilable width for icon');\n\t\t};\n\t});\n\n\tprivate readonly _layout = derived(this, reader => {\n\t\tconst s = this._state.read(reader);\n\t\tif (!s) { return undefined; }\n\n\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\n\t\tconst lineHeight = this._editorObs.observeLineHeightForLine(s.range.map(r => r.startLineNumber)).read(reader);\n\t\tconst gutterViewPortPaddingLeft = 1;\n\t\tconst gutterViewPortPaddingTop = 2;\n\n\t\t// Entire gutter view from top left to bottom right\n\t\tconst gutterWidthWithoutPadding = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft - 2 * gutterViewPortPaddingLeft;\n\t\tconst gutterHeightWithoutPadding = layout.height - 2 * gutterViewPortPaddingTop;\n\t\tconst gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPaddingLeft, gutterViewPortPaddingTop, gutterWidthWithoutPadding, gutterHeightWithoutPadding);\n\t\tconst gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader));\n\t\tconst gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPaddingTop);\n\n\t\t// The glyph margin area across all relevant lines\n\t\tconst verticalEditRange = s.lineOffsetRange.read(reader);\n\t\tconst gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange);\n\n\t\t// The gutter view container (pill)\n\t\tconst pillHeight = lineHeight;\n\t\tconst pillOffset = this._verticalOffset.read(reader);\n\t\tconst pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset);\n\t\tconst pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect);\n\n\t\t// The icon which will be rendered in the pill\n\t\tconst customIcon = this._data.read(reader)?.customization?.icon;\n\t\tconst iconNoneDocked = customIcon\n\t\t\t? constObservable(customIcon)\n\t\t\t: this._tabAction.map(action => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight);\n\t\tconst iconDocked = customIcon\n\t\t\t? constObservable(customIcon)\n\t\t\t: derived(this, reader => {\n\t\t\t\tif (this._isHoveredOverIconDebounced.read(reader) || this._isHoveredOverInlineEditDebounced.read(reader)) {\n\t\t\t\t\treturn Codicon.check;\n\t\t\t\t}\n\t\t\t\tif (this._tabAction.read(reader) === InlineEditTabAction.Accept) {\n\t\t\t\t\treturn Codicon.keyboardTab;\n\t\t\t\t}\n\t\t\t\tconst cursorLineNumber = this._editorObs.cursorLineNumber.read(reader) ?? 0;\n\t\t\t\tconst editStartLineNumber = s.range.read(reader).startLineNumber;\n\t\t\t\treturn cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow;\n\t\t\t});\n\n\t\tconst idealIconAreaWidth = 22;\n\t\tconst iconWidth = (pillRect: Rect) => {\n\t\t\tconst availableIconAreaWidth = this._availableWidthForIcon.read(undefined)(pillRect.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPaddingLeft;\n\t\t\treturn Math.max(Math.min(availableIconAreaWidth, idealIconAreaWidth), CODICON_SIZE_PX);\n\t\t};\n\n\t\tif (pillIsFullyDocked) {\n\t\t\tconst pillRect = pillFullyDockedRect;\n\n\t\t\tlet widthUntilLineNumberEnd;\n\t\t\tif (layout.lineNumbersWidth === 0) {\n\t\t\t\twidthUntilLineNumberEnd = Math.min(Math.max(layout.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect.width - idealIconAreaWidth);\n\t\t\t} else {\n\t\t\t\twidthUntilLineNumberEnd = Math.max(layout.lineNumbersLeft + layout.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0);\n\t\t\t}\n\n\t\t\tconst lineNumberRect = pillRect.withWidth(widthUntilLineNumberEnd);\n\t\t\tconst minimalIconWidthWithPadding = CODICON_SIZE_PX + CODICON_PADDING_PX;\n\t\t\tconst iconWidth = Math.min(pillRect.width - widthUntilLineNumberEnd, idealIconAreaWidth);\n\t\t\tconst iconRect = pillRect.withWidth(Math.max(iconWidth, minimalIconWidthWithPadding)).translateX(widthUntilLineNumberEnd);\n\t\t\tconst iconVisible = iconWidth >= minimalIconWidthWithPadding;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconDocked,\n\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\ticonRect,\n\t\t\t\ticonVisible,\n\t\t\t\tpillRect,\n\t\t\t\tlineNumberRect,\n\t\t\t};\n\t\t}\n\n\t\tconst pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); // The area in which the pill could be partially docked\n\t\tconst pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight;\n\n\t\tif (pillIsPartiallyDocked) {\n\t\t\t// pillFullyDockedRect is outside viewport, move it into the viewport under sticky scroll as we prefer the pill to not be on top of the sticky scroll\n\t\t\t// then move it into the possible area which will only cause it to move if it has to be rendered on top of the sticky scroll\n\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea);\n\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\tconst iconRect = pillRect;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconDocked,\n\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\ticonRect,\n\t\t\t\tpillRect,\n\t\t\t\ticonVisible: true,\n\t\t\t};\n\t\t}\n\n\t\t// pillFullyDockedRect is outside viewport, so move it into viewport\n\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll);\n\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\tconst iconRect = pillRect;\n\n\t\t// docked = pill was already in the viewport\n\t\tconst iconDirection = pillRect.top < pillFullyDockedRect.top ?\n\t\t\t'top' as const :\n\t\t\t'bottom' as const;\n\n\t\treturn {\n\t\t\tgutterEditArea,\n\t\t\ticon: iconNoneDocked,\n\t\t\ticonDirection,\n\t\t\ticonRect,\n\t\t\tpillRect,\n\t\t\ticonVisible: true,\n\t\t};\n\t});\n\n\n\tprotected readonly _iconRef = n.ref<HTMLDivElement>();\n\n\tpublic readonly isVisible = this._layout.map(l => !!l);\n\n\tprotected readonly _hoverVisible = observableValue(this, false);\n\tpublic readonly isHoverVisible: IObservable<boolean> = this._hoverVisible;\n\n\tprivate readonly _isHoveredOverIcon = observableValue(this, false);\n\tprivate readonly _isHoveredOverIconDebounced: IObservable<boolean> = debouncedObservable(this._isHoveredOverIcon, 100);\n\tpublic readonly isHoveredOverIcon: IObservable<boolean> = this._isHoveredOverIconDebounced;\n\n\tprotected _showHover(): void {\n\t\tif (this._hoverVisible.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst data = this._data.get();\n\t\tif (!data) {\n\t\t\tthrow new BugIndicatingError('Gutter indicator data not available');\n\t\t}\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst content = disposableStore.add(this._instantiationService.createInstance(\n\t\t\tGutterIndicatorMenuContent,\n\t\t\tthis._editorObs,\n\t\t\tdata.gutterMenuData,\n\t\t\t(focusEditor) => {\n\t\t\t\tif (focusEditor) {\n\t\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\t}\n\t\t\t\th?.dispose();\n\t\t\t},\n\t\t).toDisposableLiveElement());\n\n\t\tconst focusTracker = disposableStore.add(trackFocus(content.element)); // TODO@benibenj should this be removed?\n\t\tdisposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, undefined)));\n\t\tdisposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, undefined)));\n\t\tdisposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, undefined)));\n\n\t\tconst h = this._hoverService.showInstantHover({\n\t\t\ttarget: this._iconRef.element,\n\t\t\tcontent: content.element,\n\t\t}) as HoverWidget | undefined;\n\t\tif (h) {\n\t\t\tthis._hoverVisible.set(true, undefined);\n\t\t\tdisposableStore.add(this._editorObs.editor.onDidScrollChange(() => h.dispose()));\n\t\t\tdisposableStore.add(h.onDispose(() => {\n\t\t\t\tthis._hoverVisible.set(false, undefined);\n\t\t\t\tdisposableStore.dispose();\n\t\t\t}));\n\t\t} else {\n\t\t\tdisposableStore.dispose();\n\t\t}\n\t}\n\n\tprivate readonly _indicator = n.div({\n\t\tclass: 'inline-edits-view-gutter-indicator',\n\t\tstyle: {\n\t\t\tposition: 'absolute',\n\t\t\toverflow: 'visible',\n\t\t},\n\t}, mapOutFalsy(this._layout).map(layout => !layout ? [] : [\n\t\tn.div({\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tbackground: asCssVariable(inlineEditIndicatorBackground),\n\t\t\t\tborderRadius: `${INLINE_EDITS_BORDER_RADIUS}px`,\n\t\t\t\t...rectToProps(reader => layout.read(reader).gutterEditArea),\n\t\t\t}\n\t\t}),\n\t\tn.div({\n\t\t\tclass: 'icon',\n\t\t\tref: this._iconRef,\n\n\t\t\ttabIndex: 0,\n\t\t\tonclick: () => {\n\t\t\t\tconst layout = this._layout.get();\n\t\t\t\tconst acceptOnClick = layout?.icon.get() === Codicon.check;\n\n\t\t\t\tconst data = this._data.get();\n\t\t\t\tif (!data) { throw new BugIndicatingError('Gutter indicator data not available'); }\n\n\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\tif (acceptOnClick) {\n\t\t\t\t\tdata.model.accept();\n\t\t\t\t} else {\n\t\t\t\t\tdata.model.jump();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tonmouseenter: () => {\n\t\t\t\t// TODO show hover when hovering ghost text etc.\n\t\t\t\tthis._showHover();\n\t\t\t},\n\t\t\tstyle: {\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tzIndex: '20',\n\t\t\t\tposition: 'absolute',\n\t\t\t\tbackgroundColor: this._gutterIndicatorStyles.map(v => v.background),\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t['--vscodeIconForeground' as any]: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\tborder: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\tborderRadius: `${INLINE_EDITS_BORDER_RADIUS}px`,\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tjustifyContent: layout.map(l => l.iconDirection === 'bottom' ? 'flex-start' : 'flex-end'),\n\t\t\t\ttransition: this._modifierPressed.map(m => m ? '' : 'background-color 0.2s ease-in-out, width 0.2s ease-in-out'),\n\t\t\t\t...rectToProps(reader => layout.read(reader).pillRect),\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({\n\t\t\t\tclassName: 'line-number',\n\t\t\t\tstyle: {\n\t\t\t\t\tlineHeight: layout.map(l => l.lineNumberRect ? l.lineNumberRect.height : 0),\n\t\t\t\t\tdisplay: layout.map(l => l.lineNumberRect ? 'flex' : 'none'),\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\twidth: layout.map(l => l.lineNumberRect ? l.lineNumberRect.width : 0),\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcolor: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t}\n\t\t\t},\n\t\t\t\tthis._lineNumberToRender\n\t\t\t),\n\t\t\tn.div({\n\t\t\t\tstyle: {\n\t\t\t\t\ttransform: layout.map(l => `rotate(${getRotationFromDirection(l.iconDirection)}deg)`),\n\t\t\t\t\ttransition: 'rotate 0.2s ease-in-out, opacity 0.2s ease-in-out',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\theight: '100%',\n\t\t\t\t\topacity: layout.map(l => l.iconVisible ? '1' : '0'),\n\t\t\t\t\tmarginRight: layout.map(l => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)),\n\t\t\t\t\twidth: layout.map(l => l.iconRect.width),\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\tright: layout.map(l => l.iconDirection === 'top' ? '1px' : '0'),\n\t\t\t\t}\n\t\t\t}, [\n\t\t\t\tlayout.map((l, reader) => withStyles(renderIcon(l.icon.read(reader)), { fontSize: toPx(Math.min(l.iconRect.width - CODICON_PADDING_PX, CODICON_SIZE_PX)) })),\n\t\t\t])\n\t\t]),\n\t]));\n}\n\nfunction getRotationFromDirection(direction: 'top' | 'bottom' | 'right'): number {\n\tswitch (direction) {\n\t\tcase 'top': return 90;\n\t\tcase 'bottom': return -90;\n\t\tcase 'right': return 0;\n\t}\n}\n\nfunction withStyles<T extends HTMLElement>(element: T, styles: { [key: string]: string }): T {\n\tfor (const key in styles) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\telement.style[key as any] = styles[key];\n\t}\n\treturn element;\n}\n\nfunction toPx(n: number): string {\n\treturn `${n}px`;\n}\n"]}
|
|
@@ -148,6 +148,7 @@ let InlineSuggestionsView = class InlineSuggestionsView extends Disposable {
|
|
|
148
148
|
};
|
|
149
149
|
}), {
|
|
150
150
|
useSyntaxHighlighting: this._editorObs.getOption(71 /* EditorOption.inlineSuggest */).map(v => v.syntaxHighlightingEnabled),
|
|
151
|
+
highlightShortSuggestions: true,
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
shouldShowHoverAtViewZone(viewZoneId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;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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 { createStyleSheetFromObservable } from '../../../../../base/browser/domStylesheets.js';\nimport { createHotClass } from '../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, mapObservableArrayCached, derivedDisposable, derivedObservableWithCache, IObservable, ISettableObservable, constObservable, observableValue } from '../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { InlineCompletionsHintsWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js';\nimport { GhostTextOrReplacement } from '../model/ghostText.js';\nimport { InlineCompletionsModel } from '../model/inlineCompletionsModel.js';\nimport { InlineCompletionItem } from '../model/inlineSuggestionItem.js';\nimport { convertItemsToStableObservables } from '../utils.js';\nimport { GhostTextView, GhostTextWidgetWarning, IGhostTextWidgetData } from './ghostText/ghostTextView.js';\nimport { InlineEditsGutterIndicator, InlineEditsGutterIndicatorData, InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from './inlineEdits/components/gutterIndicatorView.js';\nimport { InlineEditsOnboardingExperience } from './inlineEdits/inlineEditsNewUsers.js';\nimport { InlineCompletionViewKind, InlineEditTabAction } from './inlineEdits/inlineEditsViewInterface.js';\nimport { InlineEditsViewAndDiffProducer } from './inlineEdits/inlineEditsViewProducer.js';\n\nexport class InlineSuggestionsView extends Disposable {\n\tpublic static hot = createHotClass(this);\n\n\tprivate readonly _ghostTexts = derived(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\treturn model?.ghostTexts.read(reader) ?? [];\n\t});\n\n\tprivate readonly _stablizedGhostTexts;\n\tprivate readonly _editorObs;\n\tprivate readonly _ghostTextWidgets;\n\n\tprivate readonly _inlineEdit = derived(this, reader => this._model.read(reader)?.inlineEditState.read(reader)?.inlineSuggestion);\n\tprivate readonly _everHadInlineEdit = derivedObservableWithCache<boolean>(this,\n\t\t(reader, last) => last || !!this._inlineEdit.read(reader)\n\t\t\t|| !!this._model.read(reader)?.inlineCompletionState.read(reader)?.inlineSuggestion?.showInlineEditMenu\n\t);\n\n\t// To break a cyclic dependency\n\tprivate readonly _indicatorIsHoverVisible = observableValue<IObservable<boolean> | undefined>(this, undefined);\n\n\tprivate readonly _showInlineEditCollapsed = derived(this, reader => {\n\t\tconst s = this._model.read(reader)?.showCollapsed.read(reader) ?? false;\n\t\treturn s && !this._indicatorIsHoverVisible.read(reader)?.read(reader);\n\t});\n\n\tprivate readonly _inlineEditWidget = derivedDisposable(reader => {\n\t\tif (!this._everHadInlineEdit.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._instantiationService.createInstance(InlineEditsViewAndDiffProducer, this._editor, this._model, this._showInlineEditCollapsed);\n\t});\n\n\tprivate readonly _fontFamily;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\n\t\tthis._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextWidgets = mapObservableArrayCached(\n\t\t\tthis,\n\t\t\tthis._stablizedGhostTexts,\n\t\t\t(ghostText, store) => store.add(this._createGhostText(ghostText))\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._inlineEditWidget.recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._fontFamily = this._editorObs.getOption(EditorOption.inlineSuggest).map(val => val.fontFamily);\n\n\t\tthis._register(createStyleSheetFromObservable(derived(reader => {\n\t\t\tconst fontFamily = this._fontFamily.read(reader);\n\t\t\treturn `\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${fontFamily};\n}`;\n\t\t})));\n\n\t\tthis._register(new InlineCompletionsHintsWidget(this._editor, this._model, this._instantiationService));\n\n\t\tthis._indicator = this._register(this._instantiationService.createInstance(\n\t\t\tInlineEditsGutterIndicator,\n\t\t\tthis._editorObs,\n\t\t\tderived(reader => {\n\t\t\t\tconst s = this._gutterIndicatorState.read(reader);\n\t\t\t\tif (!s) { return undefined; }\n\t\t\t\treturn new InlineEditsGutterIndicatorData(\n\t\t\t\t\tInlineSuggestionGutterMenuData.fromInlineSuggestion(s.inlineSuggestion),\n\t\t\t\t\ts.displayRange,\n\t\t\t\t\tSimpleInlineSuggestModel.fromInlineCompletionModel(s.model),\n\t\t\t\t\ts.inlineSuggestion.action?.kind === 'edit' ? s.inlineSuggestion.action.alternativeAction : undefined,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.tabAction.read(reader) ?? InlineEditTabAction.Inactive),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.gutterIndicatorOffset.read(reader) ?? 0),\n\t\t\tthis._inlineEditWidget.map((w, reader) => w?.view.inlineEditsIsHovered.read(reader) ?? false),\n\t\t\tthis._focusIsInMenu,\n\t\t));\n\t\tthis._indicatorIsHoverVisible.set(this._indicator.isHoverVisible, undefined);\n\n\t\tderived(reader => {\n\t\t\tconst w = this._inlineEditWidget.read(reader);\n\t\t\tif (!w) { return undefined; }\n\t\t\treturn reader.store.add(this._instantiationService.createInstance(\n\t\t\t\tInlineEditsOnboardingExperience,\n\t\t\t\tw._inlineEditModel,\n\t\t\t\tconstObservable(this._indicator),\n\t\t\t\tw.view._inlineCollapsedView,\n\t\t\t));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _createGhostText(ghostText: IObservable<GhostTextOrReplacement>): GhostTextView {\n\t\treturn this._instantiationService.createInstance(\n\t\t\tGhostTextView,\n\t\t\tthis._editor,\n\t\t\tderived(reader => {\n\t\t\t\tconst model = this._model.read(reader);\n\t\t\t\tconst inlineCompletion = model?.inlineCompletionState.read(reader)?.inlineSuggestion;\n\t\t\t\tif (!model || !inlineCompletion) {\n\t\t\t\t\t// editor.suggest.preview: true causes situations where we have ghost text, but no suggest preview.\n\t\t\t\t\treturn {\n\t\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\t\thandleInlineCompletionShown: () => { /* no-op */ },\n\t\t\t\t\t\twarning: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\thandleInlineCompletionShown: (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData, Date.now()),\n\t\t\t\t\twarning: GhostTextWidgetWarning.from(model?.warning.read(reader)),\n\t\t\t\t} satisfies IGhostTextWidgetData;\n\t\t\t}),\n\t\t\t{\n\t\t\t\tuseSyntaxHighlighting: this._editorObs.getOption(EditorOption.inlineSuggest).map(v => v.syntaxHighlightingEnabled),\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this._ghostTextWidgets.get()[0]?.ownsViewZone(viewZoneId) ?? false;\n\t}\n\n\tprivate readonly _gutterIndicatorState = derived(reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst state = model.state.read(reader);\n\n\t\tif (state?.kind === 'ghostText' && state.inlineSuggestion?.showInlineEditMenu) {\n\t\t\treturn {\n\t\t\t\tdisplayRange: LineRange.ofLength(state.primaryGhostText.lineNumber, 1),\n\t\t\t\ttabAction: derived<InlineEditTabAction>(this,\n\t\t\t\t\treader => this._editorObs.isFocused.read(reader) ? InlineEditTabAction.Accept : InlineEditTabAction.Inactive\n\t\t\t\t),\n\t\t\t\tgutterIndicatorOffset: constObservable(getGhostTextTopOffset(state.inlineSuggestion, this._editor)),\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tconst inlineEditWidget = this._inlineEditWidget.read(reader)?.view;\n\t\t\tif (!inlineEditWidget) { return undefined; }\n\n\t\t\tconst displayRange = inlineEditWidget.displayRange.read(reader);\n\t\t\tif (!displayRange) { return undefined; }\n\t\t\treturn {\n\t\t\t\tdisplayRange,\n\t\t\t\ttabAction: derived(reader => {\n\t\t\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t\t\t}\n\t\t\t\t\treturn InlineEditTabAction.Inactive;\n\t\t\t\t}),\n\t\t\t\tgutterIndicatorOffset: inlineEditWidget.gutterIndicatorOffset,\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprotected readonly _indicator;\n}\n\nfunction getGhostTextTopOffset(inlineCompletion: InlineCompletionItem, editor: ICodeEditor): number {\n\tconst replacement = inlineCompletion.getSingleTextEdit();\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn 0;\n\t}\n\n\tconst EOL = textModel.getEOL();\n\tif (replacement.range.isEmpty() && replacement.text.startsWith(EOL)) {\n\t\tconst lineHeight = editor.getLineHeightForPosition(replacement.range.getStartPosition());\n\t\treturn countPrefixRepeats(replacement.text, EOL) * lineHeight;\n\t}\n\n\treturn 0;\n}\n\nfunction countPrefixRepeats(str: string, prefix: string): number {\n\tif (!prefix.length) {\n\t\treturn 0;\n\t}\n\tlet count = 0;\n\tlet i = 0;\n\twhile (str.startsWith(prefix, i)) {\n\t\tcount++;\n\t\ti += prefix.length;\n\t}\n\treturn count;\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 { createStyleSheetFromObservable } from '../../../../../base/browser/domStylesheets.js';\nimport { createHotClass } from '../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, mapObservableArrayCached, derivedDisposable, derivedObservableWithCache, IObservable, ISettableObservable, constObservable, observableValue } from '../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { InlineCompletionsHintsWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js';\nimport { GhostTextOrReplacement } from '../model/ghostText.js';\nimport { InlineCompletionsModel } from '../model/inlineCompletionsModel.js';\nimport { InlineCompletionItem } from '../model/inlineSuggestionItem.js';\nimport { convertItemsToStableObservables } from '../utils.js';\nimport { GhostTextView, GhostTextWidgetWarning, IGhostTextWidgetData } from './ghostText/ghostTextView.js';\nimport { InlineEditsGutterIndicator, InlineEditsGutterIndicatorData, InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from './inlineEdits/components/gutterIndicatorView.js';\nimport { InlineEditsOnboardingExperience } from './inlineEdits/inlineEditsNewUsers.js';\nimport { InlineCompletionViewKind, InlineEditTabAction } from './inlineEdits/inlineEditsViewInterface.js';\nimport { InlineEditsViewAndDiffProducer } from './inlineEdits/inlineEditsViewProducer.js';\n\nexport class InlineSuggestionsView extends Disposable {\n\tpublic static hot = createHotClass(this);\n\n\tprivate readonly _ghostTexts = derived(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\treturn model?.ghostTexts.read(reader) ?? [];\n\t});\n\n\tprivate readonly _stablizedGhostTexts;\n\tprivate readonly _editorObs;\n\tprivate readonly _ghostTextWidgets;\n\n\tprivate readonly _inlineEdit = derived(this, reader => this._model.read(reader)?.inlineEditState.read(reader)?.inlineSuggestion);\n\tprivate readonly _everHadInlineEdit = derivedObservableWithCache<boolean>(this,\n\t\t(reader, last) => last || !!this._inlineEdit.read(reader)\n\t\t\t|| !!this._model.read(reader)?.inlineCompletionState.read(reader)?.inlineSuggestion?.showInlineEditMenu\n\t);\n\n\t// To break a cyclic dependency\n\tprivate readonly _indicatorIsHoverVisible = observableValue<IObservable<boolean> | undefined>(this, undefined);\n\n\tprivate readonly _showInlineEditCollapsed = derived(this, reader => {\n\t\tconst s = this._model.read(reader)?.showCollapsed.read(reader) ?? false;\n\t\treturn s && !this._indicatorIsHoverVisible.read(reader)?.read(reader);\n\t});\n\n\tprivate readonly _inlineEditWidget = derivedDisposable(reader => {\n\t\tif (!this._everHadInlineEdit.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._instantiationService.createInstance(InlineEditsViewAndDiffProducer, this._editor, this._model, this._showInlineEditCollapsed);\n\t});\n\n\tprivate readonly _fontFamily;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\n\t\tthis._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextWidgets = mapObservableArrayCached(\n\t\t\tthis,\n\t\t\tthis._stablizedGhostTexts,\n\t\t\t(ghostText, store) => store.add(this._createGhostText(ghostText))\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._inlineEditWidget.recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._fontFamily = this._editorObs.getOption(EditorOption.inlineSuggest).map(val => val.fontFamily);\n\n\t\tthis._register(createStyleSheetFromObservable(derived(reader => {\n\t\t\tconst fontFamily = this._fontFamily.read(reader);\n\t\t\treturn `\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${fontFamily};\n}`;\n\t\t})));\n\n\t\tthis._register(new InlineCompletionsHintsWidget(this._editor, this._model, this._instantiationService));\n\n\t\tthis._indicator = this._register(this._instantiationService.createInstance(\n\t\t\tInlineEditsGutterIndicator,\n\t\t\tthis._editorObs,\n\t\t\tderived(reader => {\n\t\t\t\tconst s = this._gutterIndicatorState.read(reader);\n\t\t\t\tif (!s) { return undefined; }\n\t\t\t\treturn new InlineEditsGutterIndicatorData(\n\t\t\t\t\tInlineSuggestionGutterMenuData.fromInlineSuggestion(s.inlineSuggestion),\n\t\t\t\t\ts.displayRange,\n\t\t\t\t\tSimpleInlineSuggestModel.fromInlineCompletionModel(s.model),\n\t\t\t\t\ts.inlineSuggestion.action?.kind === 'edit' ? s.inlineSuggestion.action.alternativeAction : undefined,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.tabAction.read(reader) ?? InlineEditTabAction.Inactive),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.gutterIndicatorOffset.read(reader) ?? 0),\n\t\t\tthis._inlineEditWidget.map((w, reader) => w?.view.inlineEditsIsHovered.read(reader) ?? false),\n\t\t\tthis._focusIsInMenu,\n\t\t));\n\t\tthis._indicatorIsHoverVisible.set(this._indicator.isHoverVisible, undefined);\n\n\t\tderived(reader => {\n\t\t\tconst w = this._inlineEditWidget.read(reader);\n\t\t\tif (!w) { return undefined; }\n\t\t\treturn reader.store.add(this._instantiationService.createInstance(\n\t\t\t\tInlineEditsOnboardingExperience,\n\t\t\t\tw._inlineEditModel,\n\t\t\t\tconstObservable(this._indicator),\n\t\t\t\tw.view._inlineCollapsedView,\n\t\t\t));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _createGhostText(ghostText: IObservable<GhostTextOrReplacement>): GhostTextView {\n\t\treturn this._instantiationService.createInstance(\n\t\t\tGhostTextView,\n\t\t\tthis._editor,\n\t\t\tderived(reader => {\n\t\t\t\tconst model = this._model.read(reader);\n\t\t\t\tconst inlineCompletion = model?.inlineCompletionState.read(reader)?.inlineSuggestion;\n\t\t\t\tif (!model || !inlineCompletion) {\n\t\t\t\t\t// editor.suggest.preview: true causes situations where we have ghost text, but no suggest preview.\n\t\t\t\t\treturn {\n\t\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\t\thandleInlineCompletionShown: () => { /* no-op */ },\n\t\t\t\t\t\twarning: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\thandleInlineCompletionShown: (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData, Date.now()),\n\t\t\t\t\twarning: GhostTextWidgetWarning.from(model?.warning.read(reader)),\n\t\t\t\t} satisfies IGhostTextWidgetData;\n\t\t\t}),\n\t\t\t{\n\t\t\t\tuseSyntaxHighlighting: this._editorObs.getOption(EditorOption.inlineSuggest).map(v => v.syntaxHighlightingEnabled),\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this._ghostTextWidgets.get()[0]?.ownsViewZone(viewZoneId) ?? false;\n\t}\n\n\tprivate readonly _gutterIndicatorState = derived(reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst state = model.state.read(reader);\n\n\t\tif (state?.kind === 'ghostText' && state.inlineSuggestion?.showInlineEditMenu) {\n\t\t\treturn {\n\t\t\t\tdisplayRange: LineRange.ofLength(state.primaryGhostText.lineNumber, 1),\n\t\t\t\ttabAction: derived<InlineEditTabAction>(this,\n\t\t\t\t\treader => this._editorObs.isFocused.read(reader) ? InlineEditTabAction.Accept : InlineEditTabAction.Inactive\n\t\t\t\t),\n\t\t\t\tgutterIndicatorOffset: constObservable(getGhostTextTopOffset(state.inlineSuggestion, this._editor)),\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tconst inlineEditWidget = this._inlineEditWidget.read(reader)?.view;\n\t\t\tif (!inlineEditWidget) { return undefined; }\n\n\t\t\tconst displayRange = inlineEditWidget.displayRange.read(reader);\n\t\t\tif (!displayRange) { return undefined; }\n\t\t\treturn {\n\t\t\t\tdisplayRange,\n\t\t\t\ttabAction: derived(reader => {\n\t\t\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t\t\t}\n\t\t\t\t\treturn InlineEditTabAction.Inactive;\n\t\t\t\t}),\n\t\t\t\tgutterIndicatorOffset: inlineEditWidget.gutterIndicatorOffset,\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprotected readonly _indicator;\n}\n\nfunction getGhostTextTopOffset(inlineCompletion: InlineCompletionItem, editor: ICodeEditor): number {\n\tconst replacement = inlineCompletion.getSingleTextEdit();\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn 0;\n\t}\n\n\tconst EOL = textModel.getEOL();\n\tif (replacement.range.isEmpty() && replacement.text.startsWith(EOL)) {\n\t\tconst lineHeight = editor.getLineHeightForPosition(replacement.range.getStartPosition());\n\t\treturn countPrefixRepeats(replacement.text, EOL) * lineHeight;\n\t}\n\n\treturn 0;\n}\n\nfunction countPrefixRepeats(str: string, prefix: string): number {\n\tif (!prefix.length) {\n\t\treturn 0;\n\t}\n\tlet count = 0;\n\tlet i = 0;\n\twhile (str.startsWith(prefix, i)) {\n\t\tcount++;\n\t\ti += prefix.length;\n\t}\n\treturn count;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,0BAA0B,EAAoC,eAAe,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChN,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAEtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAI9F,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAwB,MAAM,8BAA8B,CAAC;AAC3G,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;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kBAAkB,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC;IAC/D,CAAC;IAED,OAAO,CAAC,CAAC;AACV,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAW,EAAE,MAAc;IACtD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC;IACV,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;QAClC,KAAK,EAAE,CAAC;QACR,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","file":"inlineSuggestionsView.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 { createStyleSheetFromObservable } from '../../../../../base/browser/domStylesheets.js';\nimport { createHotClass } from '../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, mapObservableArrayCached, derivedDisposable, derivedObservableWithCache, IObservable, ISettableObservable, constObservable, observableValue } from '../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { InlineCompletionsHintsWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js';\nimport { GhostTextOrReplacement } from '../model/ghostText.js';\nimport { InlineCompletionsModel } from '../model/inlineCompletionsModel.js';\nimport { InlineCompletionItem } from '../model/inlineSuggestionItem.js';\nimport { convertItemsToStableObservables } from '../utils.js';\nimport { GhostTextView, GhostTextWidgetWarning, IGhostTextWidgetData } from './ghostText/ghostTextView.js';\nimport { InlineEditsGutterIndicator, InlineEditsGutterIndicatorData, InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from './inlineEdits/components/gutterIndicatorView.js';\nimport { InlineEditsOnboardingExperience } from './inlineEdits/inlineEditsNewUsers.js';\nimport { InlineCompletionViewKind, InlineEditTabAction } from './inlineEdits/inlineEditsViewInterface.js';\nimport { InlineEditsViewAndDiffProducer } from './inlineEdits/inlineEditsViewProducer.js';\n\nexport class InlineSuggestionsView extends Disposable {\n\tpublic static hot = createHotClass(this);\n\n\tprivate readonly _ghostTexts = derived(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\treturn model?.ghostTexts.read(reader) ?? [];\n\t});\n\n\tprivate readonly _stablizedGhostTexts;\n\tprivate readonly _editorObs;\n\tprivate readonly _ghostTextWidgets;\n\n\tprivate readonly _inlineEdit = derived(this, reader => this._model.read(reader)?.inlineEditState.read(reader)?.inlineSuggestion);\n\tprivate readonly _everHadInlineEdit = derivedObservableWithCache<boolean>(this,\n\t\t(reader, last) => last || !!this._inlineEdit.read(reader)\n\t\t\t|| !!this._model.read(reader)?.inlineCompletionState.read(reader)?.inlineSuggestion?.showInlineEditMenu\n\t);\n\n\t// To break a cyclic dependency\n\tprivate readonly _indicatorIsHoverVisible = observableValue<IObservable<boolean> | undefined>(this, undefined);\n\n\tprivate readonly _showInlineEditCollapsed = derived(this, reader => {\n\t\tconst s = this._model.read(reader)?.showCollapsed.read(reader) ?? false;\n\t\treturn s && !this._indicatorIsHoverVisible.read(reader)?.read(reader);\n\t});\n\n\tprivate readonly _inlineEditWidget = derivedDisposable(reader => {\n\t\tif (!this._everHadInlineEdit.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._instantiationService.createInstance(InlineEditsViewAndDiffProducer, this._editor, this._model, this._showInlineEditCollapsed);\n\t});\n\n\tprivate readonly _fontFamily;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\n\t\tthis._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextWidgets = mapObservableArrayCached(\n\t\t\tthis,\n\t\t\tthis._stablizedGhostTexts,\n\t\t\t(ghostText, store) => store.add(this._createGhostText(ghostText))\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._inlineEditWidget.recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._fontFamily = this._editorObs.getOption(EditorOption.inlineSuggest).map(val => val.fontFamily);\n\n\t\tthis._register(createStyleSheetFromObservable(derived(reader => {\n\t\t\tconst fontFamily = this._fontFamily.read(reader);\n\t\t\treturn `\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${fontFamily};\n}`;\n\t\t})));\n\n\t\tthis._register(new InlineCompletionsHintsWidget(this._editor, this._model, this._instantiationService));\n\n\t\tthis._indicator = this._register(this._instantiationService.createInstance(\n\t\t\tInlineEditsGutterIndicator,\n\t\t\tthis._editorObs,\n\t\t\tderived(reader => {\n\t\t\t\tconst s = this._gutterIndicatorState.read(reader);\n\t\t\t\tif (!s) { return undefined; }\n\t\t\t\treturn new InlineEditsGutterIndicatorData(\n\t\t\t\t\tInlineSuggestionGutterMenuData.fromInlineSuggestion(s.inlineSuggestion),\n\t\t\t\t\ts.displayRange,\n\t\t\t\t\tSimpleInlineSuggestModel.fromInlineCompletionModel(s.model),\n\t\t\t\t\ts.inlineSuggestion.action?.kind === 'edit' ? s.inlineSuggestion.action.alternativeAction : undefined,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.tabAction.read(reader) ?? InlineEditTabAction.Inactive),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.gutterIndicatorOffset.read(reader) ?? 0),\n\t\t\tthis._inlineEditWidget.map((w, reader) => w?.view.inlineEditsIsHovered.read(reader) ?? false),\n\t\t\tthis._focusIsInMenu,\n\t\t));\n\t\tthis._indicatorIsHoverVisible.set(this._indicator.isHoverVisible, undefined);\n\n\t\tderived(reader => {\n\t\t\tconst w = this._inlineEditWidget.read(reader);\n\t\t\tif (!w) { return undefined; }\n\t\t\treturn reader.store.add(this._instantiationService.createInstance(\n\t\t\t\tInlineEditsOnboardingExperience,\n\t\t\t\tw._inlineEditModel,\n\t\t\t\tconstObservable(this._indicator),\n\t\t\t\tw.view._inlineCollapsedView,\n\t\t\t));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _createGhostText(ghostText: IObservable<GhostTextOrReplacement>): GhostTextView {\n\t\treturn this._instantiationService.createInstance(\n\t\t\tGhostTextView,\n\t\t\tthis._editor,\n\t\t\tderived(reader => {\n\t\t\t\tconst model = this._model.read(reader);\n\t\t\t\tconst inlineCompletion = model?.inlineCompletionState.read(reader)?.inlineSuggestion;\n\t\t\t\tif (!model || !inlineCompletion) {\n\t\t\t\t\t// editor.suggest.preview: true causes situations where we have ghost text, but no suggest preview.\n\t\t\t\t\treturn {\n\t\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\t\thandleInlineCompletionShown: () => { /* no-op */ },\n\t\t\t\t\t\twarning: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\thandleInlineCompletionShown: (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData, Date.now()),\n\t\t\t\t\twarning: GhostTextWidgetWarning.from(model?.warning.read(reader)),\n\t\t\t\t} satisfies IGhostTextWidgetData;\n\t\t\t}),\n\t\t\t{\n\t\t\t\tuseSyntaxHighlighting: this._editorObs.getOption(EditorOption.inlineSuggest).map(v => v.syntaxHighlightingEnabled),\n\t\t\t\thighlightShortSuggestions: true,\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this._ghostTextWidgets.get()[0]?.ownsViewZone(viewZoneId) ?? false;\n\t}\n\n\tprivate readonly _gutterIndicatorState = derived(reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst state = model.state.read(reader);\n\n\t\tif (state?.kind === 'ghostText' && state.inlineSuggestion?.showInlineEditMenu) {\n\t\t\treturn {\n\t\t\t\tdisplayRange: LineRange.ofLength(state.primaryGhostText.lineNumber, 1),\n\t\t\t\ttabAction: derived<InlineEditTabAction>(this,\n\t\t\t\t\treader => this._editorObs.isFocused.read(reader) ? InlineEditTabAction.Accept : InlineEditTabAction.Inactive\n\t\t\t\t),\n\t\t\t\tgutterIndicatorOffset: constObservable(getGhostTextTopOffset(state.inlineSuggestion, this._editor)),\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tconst inlineEditWidget = this._inlineEditWidget.read(reader)?.view;\n\t\t\tif (!inlineEditWidget) { return undefined; }\n\n\t\t\tconst displayRange = inlineEditWidget.displayRange.read(reader);\n\t\t\tif (!displayRange) { return undefined; }\n\t\t\treturn {\n\t\t\t\tdisplayRange,\n\t\t\t\ttabAction: derived(reader => {\n\t\t\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t\t\t}\n\t\t\t\t\treturn InlineEditTabAction.Inactive;\n\t\t\t\t}),\n\t\t\t\tgutterIndicatorOffset: inlineEditWidget.gutterIndicatorOffset,\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprotected readonly _indicator;\n}\n\nfunction getGhostTextTopOffset(inlineCompletion: InlineCompletionItem, editor: ICodeEditor): number {\n\tconst replacement = inlineCompletion.getSingleTextEdit();\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn 0;\n\t}\n\n\tconst EOL = textModel.getEOL();\n\tif (replacement.range.isEmpty() && replacement.text.startsWith(EOL)) {\n\t\tconst lineHeight = editor.getLineHeightForPosition(replacement.range.getStartPosition());\n\t\treturn countPrefixRepeats(replacement.text, EOL) * lineHeight;\n\t}\n\n\treturn 0;\n}\n\nfunction countPrefixRepeats(str: string, prefix: string): number {\n\tif (!prefix.length) {\n\t\treturn 0;\n\t}\n\tlet count = 0;\n\tlet i = 0;\n\twhile (str.startsWith(prefix, i)) {\n\t\tcount++;\n\t\ti += prefix.length;\n\t}\n\treturn count;\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 { createStyleSheetFromObservable } from '../../../../../base/browser/domStylesheets.js';\nimport { createHotClass } from '../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, mapObservableArrayCached, derivedDisposable, derivedObservableWithCache, IObservable, ISettableObservable, constObservable, observableValue } from '../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { InlineCompletionsHintsWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js';\nimport { GhostTextOrReplacement } from '../model/ghostText.js';\nimport { InlineCompletionsModel } from '../model/inlineCompletionsModel.js';\nimport { InlineCompletionItem } from '../model/inlineSuggestionItem.js';\nimport { convertItemsToStableObservables } from '../utils.js';\nimport { GhostTextView, GhostTextWidgetWarning, IGhostTextWidgetData } from './ghostText/ghostTextView.js';\nimport { InlineEditsGutterIndicator, InlineEditsGutterIndicatorData, InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from './inlineEdits/components/gutterIndicatorView.js';\nimport { InlineEditsOnboardingExperience } from './inlineEdits/inlineEditsNewUsers.js';\nimport { InlineCompletionViewKind, InlineEditTabAction } from './inlineEdits/inlineEditsViewInterface.js';\nimport { InlineEditsViewAndDiffProducer } from './inlineEdits/inlineEditsViewProducer.js';\n\nexport class InlineSuggestionsView extends Disposable {\n\tpublic static hot = createHotClass(this);\n\n\tprivate readonly _ghostTexts = derived(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\treturn model?.ghostTexts.read(reader) ?? [];\n\t});\n\n\tprivate readonly _stablizedGhostTexts;\n\tprivate readonly _editorObs;\n\tprivate readonly _ghostTextWidgets;\n\n\tprivate readonly _inlineEdit = derived(this, reader => this._model.read(reader)?.inlineEditState.read(reader)?.inlineSuggestion);\n\tprivate readonly _everHadInlineEdit = derivedObservableWithCache<boolean>(this,\n\t\t(reader, last) => last || !!this._inlineEdit.read(reader)\n\t\t\t|| !!this._model.read(reader)?.inlineCompletionState.read(reader)?.inlineSuggestion?.showInlineEditMenu\n\t);\n\n\t// To break a cyclic dependency\n\tprivate readonly _indicatorIsHoverVisible = observableValue<IObservable<boolean> | undefined>(this, undefined);\n\n\tprivate readonly _showInlineEditCollapsed = derived(this, reader => {\n\t\tconst s = this._model.read(reader)?.showCollapsed.read(reader) ?? false;\n\t\treturn s && !this._indicatorIsHoverVisible.read(reader)?.read(reader);\n\t});\n\n\tprivate readonly _inlineEditWidget = derivedDisposable(reader => {\n\t\tif (!this._everHadInlineEdit.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._instantiationService.createInstance(InlineEditsViewAndDiffProducer, this._editor, this._model, this._showInlineEditCollapsed);\n\t});\n\n\tprivate readonly _fontFamily;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService\n\t) {\n\t\tsuper();\n\n\t\tthis._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._ghostTextWidgets = mapObservableArrayCached(\n\t\t\tthis,\n\t\t\tthis._stablizedGhostTexts,\n\t\t\t(ghostText, store) => store.add(this._createGhostText(ghostText))\n\t\t).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._inlineEditWidget.recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._fontFamily = this._editorObs.getOption(EditorOption.inlineSuggest).map(val => val.fontFamily);\n\n\t\tthis._register(createStyleSheetFromObservable(derived(reader => {\n\t\t\tconst fontFamily = this._fontFamily.read(reader);\n\t\t\treturn `\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${fontFamily};\n}`;\n\t\t})));\n\n\t\tthis._register(new InlineCompletionsHintsWidget(this._editor, this._model, this._instantiationService));\n\n\t\tthis._indicator = this._register(this._instantiationService.createInstance(\n\t\t\tInlineEditsGutterIndicator,\n\t\t\tthis._editorObs,\n\t\t\tderived(reader => {\n\t\t\t\tconst s = this._gutterIndicatorState.read(reader);\n\t\t\t\tif (!s) { return undefined; }\n\t\t\t\treturn new InlineEditsGutterIndicatorData(\n\t\t\t\t\tInlineSuggestionGutterMenuData.fromInlineSuggestion(s.inlineSuggestion),\n\t\t\t\t\ts.displayRange,\n\t\t\t\t\tSimpleInlineSuggestModel.fromInlineCompletionModel(s.model),\n\t\t\t\t\ts.inlineSuggestion.action?.kind === 'edit' ? s.inlineSuggestion.action.alternativeAction : undefined,\n\t\t\t\t);\n\t\t\t}),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.tabAction.read(reader) ?? InlineEditTabAction.Inactive),\n\t\t\tthis._gutterIndicatorState.map((s, reader) => s?.gutterIndicatorOffset.read(reader) ?? 0),\n\t\t\tthis._inlineEditWidget.map((w, reader) => w?.view.inlineEditsIsHovered.read(reader) ?? false),\n\t\t\tthis._focusIsInMenu,\n\t\t));\n\t\tthis._indicatorIsHoverVisible.set(this._indicator.isHoverVisible, undefined);\n\n\t\tderived(reader => {\n\t\t\tconst w = this._inlineEditWidget.read(reader);\n\t\t\tif (!w) { return undefined; }\n\t\t\treturn reader.store.add(this._instantiationService.createInstance(\n\t\t\t\tInlineEditsOnboardingExperience,\n\t\t\t\tw._inlineEditModel,\n\t\t\t\tconstObservable(this._indicator),\n\t\t\t\tw.view._inlineCollapsedView,\n\t\t\t));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _createGhostText(ghostText: IObservable<GhostTextOrReplacement>): GhostTextView {\n\t\treturn this._instantiationService.createInstance(\n\t\t\tGhostTextView,\n\t\t\tthis._editor,\n\t\t\tderived(reader => {\n\t\t\t\tconst model = this._model.read(reader);\n\t\t\t\tconst inlineCompletion = model?.inlineCompletionState.read(reader)?.inlineSuggestion;\n\t\t\t\tif (!model || !inlineCompletion) {\n\t\t\t\t\t// editor.suggest.preview: true causes situations where we have ghost text, but no suggest preview.\n\t\t\t\t\treturn {\n\t\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\t\thandleInlineCompletionShown: () => { /* no-op */ },\n\t\t\t\t\t\twarning: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tghostText: ghostText.read(reader),\n\t\t\t\t\thandleInlineCompletionShown: (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData, Date.now()),\n\t\t\t\t\twarning: GhostTextWidgetWarning.from(model?.warning.read(reader)),\n\t\t\t\t} satisfies IGhostTextWidgetData;\n\t\t\t}),\n\t\t\t{\n\t\t\t\tuseSyntaxHighlighting: this._editorObs.getOption(EditorOption.inlineSuggest).map(v => v.syntaxHighlightingEnabled),\n\t\t\t\thighlightShortSuggestions: true,\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this._ghostTextWidgets.get()[0]?.ownsViewZone(viewZoneId) ?? false;\n\t}\n\n\tprivate readonly _gutterIndicatorState = derived(reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst state = model.state.read(reader);\n\n\t\tif (state?.kind === 'ghostText' && state.inlineSuggestion?.showInlineEditMenu) {\n\t\t\treturn {\n\t\t\t\tdisplayRange: LineRange.ofLength(state.primaryGhostText.lineNumber, 1),\n\t\t\t\ttabAction: derived<InlineEditTabAction>(this,\n\t\t\t\t\treader => this._editorObs.isFocused.read(reader) ? InlineEditTabAction.Accept : InlineEditTabAction.Inactive\n\t\t\t\t),\n\t\t\t\tgutterIndicatorOffset: constObservable(getGhostTextTopOffset(state.inlineSuggestion, this._editor)),\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tconst inlineEditWidget = this._inlineEditWidget.read(reader)?.view;\n\t\t\tif (!inlineEditWidget) { return undefined; }\n\n\t\t\tconst displayRange = inlineEditWidget.displayRange.read(reader);\n\t\t\tif (!displayRange) { return undefined; }\n\t\t\treturn {\n\t\t\t\tdisplayRange,\n\t\t\t\ttabAction: derived(reader => {\n\t\t\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t\t\t}\n\t\t\t\t\treturn InlineEditTabAction.Inactive;\n\t\t\t\t}),\n\t\t\t\tgutterIndicatorOffset: inlineEditWidget.gutterIndicatorOffset,\n\t\t\t\tinlineSuggestion: state.inlineSuggestion,\n\t\t\t\tmodel,\n\t\t\t};\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprotected readonly _indicator;\n}\n\nfunction getGhostTextTopOffset(inlineCompletion: InlineCompletionItem, editor: ICodeEditor): number {\n\tconst replacement = inlineCompletion.getSingleTextEdit();\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn 0;\n\t}\n\n\tconst EOL = textModel.getEOL();\n\tif (replacement.range.isEmpty() && replacement.text.startsWith(EOL)) {\n\t\tconst lineHeight = editor.getLineHeightForPosition(replacement.range.getStartPosition());\n\t\treturn countPrefixRepeats(replacement.text, EOL) * lineHeight;\n\t}\n\n\treturn 0;\n}\n\nfunction countPrefixRepeats(str: string, prefix: string): number {\n\tif (!prefix.length) {\n\t\treturn 0;\n\t}\n\tlet count = 0;\n\tlet i = 0;\n\twhile (str.startsWith(prefix, i)) {\n\t\tcount++;\n\t\ti += prefix.length;\n\t}\n\treturn count;\n}\n"]}
|
|
@@ -1745,7 +1745,7 @@ export namespace editor {
|
|
|
1745
1745
|
*/
|
|
1746
1746
|
glyphMargin?: IModelDecorationGlyphMarginOptions | null;
|
|
1747
1747
|
/**
|
|
1748
|
-
* If set, the decoration will override the line height of the lines it spans.
|
|
1748
|
+
* If set, the decoration will override the line height of the lines it spans. This value is a multiplier to the default line height.
|
|
1749
1749
|
*/
|
|
1750
1750
|
lineHeight?: number | null;
|
|
1751
1751
|
/**
|
|
@@ -6387,6 +6387,10 @@ export namespace editor {
|
|
|
6387
6387
|
* Force an editor render now.
|
|
6388
6388
|
*/
|
|
6389
6389
|
render(forceRedraw?: boolean): void;
|
|
6390
|
+
/**
|
|
6391
|
+
* Render the editor at the next animation frame.
|
|
6392
|
+
*/
|
|
6393
|
+
renderAsync(forceRedraw?: boolean): void;
|
|
6390
6394
|
/**
|
|
6391
6395
|
* Get the hit test target at coordinates `clientX` and `clientY`.
|
|
6392
6396
|
* The coordinates are relative to the top-left of the viewport.
|
|
@@ -16,7 +16,7 @@ import { KeybindingLabel } from '../../../base/browser/ui/keybindingLabel/keybin
|
|
|
16
16
|
import { List } from '../../../base/browser/ui/list/listWidget.js';
|
|
17
17
|
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
|
|
18
18
|
import { Codicon } from '../../../base/common/codicons.js';
|
|
19
|
-
import { Disposable } from '../../../base/common/lifecycle.js';
|
|
19
|
+
import { Disposable, MutableDisposable } from '../../../base/common/lifecycle.js';
|
|
20
20
|
import { OS } from '../../../base/common/platform.js';
|
|
21
21
|
import { ThemeIcon } from '../../../base/common/themables.js';
|
|
22
22
|
import './actionWidget.css';
|
|
@@ -26,6 +26,8 @@ import { IKeybindingService } from '../../keybinding/common/keybinding.js';
|
|
|
26
26
|
import { defaultListStyles } from '../../theme/browser/defaultStyles.js';
|
|
27
27
|
import { asCssVariable } from '../../theme/common/colorRegistry.js';
|
|
28
28
|
import { ILayoutService } from '../../layout/browser/layoutService.js';
|
|
29
|
+
import { IHoverService } from '../../hover/browser/hover.js';
|
|
30
|
+
import { MarkdownString } from '../../../base/common/htmlContent.js';
|
|
29
31
|
export const acceptSelectedActionCommand = 'acceptSelectedCodeAction';
|
|
30
32
|
export const previewSelectedActionCommand = 'previewSelectedCodeAction';
|
|
31
33
|
class HeaderRenderer {
|
|
@@ -117,6 +119,10 @@ let ActionItemRenderer = class ActionItemRenderer {
|
|
|
117
119
|
else if (element.disabled) {
|
|
118
120
|
data.container.title = element.label;
|
|
119
121
|
}
|
|
122
|
+
else if (element.hover?.content) {
|
|
123
|
+
// Don't show tooltip when hover content is configured - the rich hover will show instead
|
|
124
|
+
data.container.title = '';
|
|
125
|
+
}
|
|
120
126
|
else if (actionTitle && previewTitle) {
|
|
121
127
|
if (this._supportsPreview && element.canPreview) {
|
|
122
128
|
data.container.title = localize(1668, "{0} to Apply, {1} to Preview", actionTitle, previewTitle);
|
|
@@ -150,16 +156,18 @@ function getKeyboardNavigationLabel(item) {
|
|
|
150
156
|
return undefined;
|
|
151
157
|
}
|
|
152
158
|
let ActionList = class ActionList extends Disposable {
|
|
153
|
-
constructor(user, preview, items, _delegate, accessibilityProvider, _contextViewService, _keybindingService, _layoutService) {
|
|
159
|
+
constructor(user, preview, items, _delegate, accessibilityProvider, _contextViewService, _keybindingService, _layoutService, _hoverService) {
|
|
154
160
|
super();
|
|
155
161
|
this._delegate = _delegate;
|
|
156
162
|
this._contextViewService = _contextViewService;
|
|
157
163
|
this._keybindingService = _keybindingService;
|
|
158
164
|
this._layoutService = _layoutService;
|
|
165
|
+
this._hoverService = _hoverService;
|
|
159
166
|
this._actionLineHeight = 28;
|
|
160
167
|
this._headerLineHeight = 28;
|
|
161
168
|
this._separatorLineHeight = 8;
|
|
162
169
|
this.cts = this._register(new CancellationTokenSource());
|
|
170
|
+
this._hover = this._register(new MutableDisposable());
|
|
163
171
|
this.domNode = document.createElement('div');
|
|
164
172
|
this.domNode.classList.add('actionList');
|
|
165
173
|
const virtualDelegate = {
|
|
@@ -229,6 +237,7 @@ let ActionList = class ActionList extends Disposable {
|
|
|
229
237
|
hide(didCancel) {
|
|
230
238
|
this._delegate.onHide(didCancel);
|
|
231
239
|
this.cts.cancel();
|
|
240
|
+
this._hover.clear();
|
|
232
241
|
this._contextViewService.hideContextView();
|
|
233
242
|
}
|
|
234
243
|
layout(minWidth) {
|
|
@@ -246,8 +255,7 @@ let ActionList = class ActionList extends Disposable {
|
|
|
246
255
|
else {
|
|
247
256
|
// For finding width dynamically (not using resize observer)
|
|
248
257
|
const itemWidths = this._allMenuItems.map((_, index) => {
|
|
249
|
-
|
|
250
|
-
const element = this.domNode.ownerDocument.getElementById(this._list.getElementID(index));
|
|
258
|
+
const element = this._getRowElement(index);
|
|
251
259
|
if (element) {
|
|
252
260
|
element.style.width = 'auto';
|
|
253
261
|
const width = element.getBoundingClientRect().width;
|
|
@@ -305,6 +313,37 @@ let ActionList = class ActionList extends Disposable {
|
|
|
305
313
|
const focusIndex = focused[0];
|
|
306
314
|
const element = this._list.element(focusIndex);
|
|
307
315
|
this._delegate.onFocus?.(element.item);
|
|
316
|
+
// Show hover on focus change
|
|
317
|
+
this._showHoverForElement(element, focusIndex);
|
|
318
|
+
}
|
|
319
|
+
_getRowElement(index) {
|
|
320
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
321
|
+
return this.domNode.ownerDocument.getElementById(this._list.getElementID(index));
|
|
322
|
+
}
|
|
323
|
+
_showHoverForElement(element, index) {
|
|
324
|
+
let newHover;
|
|
325
|
+
// Show hover if the element has hover content
|
|
326
|
+
if (element.hover?.content && this.focusCondition(element)) {
|
|
327
|
+
// The List widget separates data models from DOM elements, so we need to
|
|
328
|
+
// look up the actual DOM node to use as the hover target.
|
|
329
|
+
const rowElement = this._getRowElement(index);
|
|
330
|
+
if (rowElement) {
|
|
331
|
+
const markdown = element.hover.content ? new MarkdownString(element.hover.content) : undefined;
|
|
332
|
+
newHover = this._hoverService.showDelayedHover({
|
|
333
|
+
content: markdown ?? '',
|
|
334
|
+
target: rowElement,
|
|
335
|
+
additionalClasses: ['action-widget-hover'],
|
|
336
|
+
position: {
|
|
337
|
+
hoverPosition: 0 /* HoverPosition.LEFT */,
|
|
338
|
+
forcePosition: false,
|
|
339
|
+
},
|
|
340
|
+
appearance: {
|
|
341
|
+
showPointer: true,
|
|
342
|
+
},
|
|
343
|
+
}, { groupId: `actionListHover` });
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
this._hover.value = newHover;
|
|
308
347
|
}
|
|
309
348
|
async onListHover(e) {
|
|
310
349
|
const element = e.element;
|
|
@@ -316,8 +355,8 @@ let ActionList = class ActionList extends Disposable {
|
|
|
316
355
|
if (e.index) {
|
|
317
356
|
this._list.splice(e.index, 1, [element]);
|
|
318
357
|
}
|
|
358
|
+
this._list.setFocus(typeof e.index === 'number' ? [e.index] : []);
|
|
319
359
|
}
|
|
320
|
-
this._list.setFocus(typeof e.index === 'number' ? [e.index] : []);
|
|
321
360
|
}
|
|
322
361
|
onListClick(e) {
|
|
323
362
|
if (e.element && this.focusCondition(e.element)) {
|
|
@@ -328,7 +367,8 @@ let ActionList = class ActionList extends Disposable {
|
|
|
328
367
|
ActionList = __decorate([
|
|
329
368
|
__param(5, IContextViewService),
|
|
330
369
|
__param(6, IKeybindingService),
|
|
331
|
-
__param(7, ILayoutService)
|
|
370
|
+
__param(7, ILayoutService),
|
|
371
|
+
__param(8, IHoverService)
|
|
332
372
|
], ActionList);
|
|
333
373
|
export { ActionList };
|
|
334
374
|
function stripNewlines(str) {
|