monaco-editor-core 0.54.0 → 0.55.0-dev-20251008
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.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.ru.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/canIUse.js +1 -0
- package/esm/vs/base/browser/canIUse.js.map +1 -1
- package/esm/vs/base/browser/dom.js +9 -0
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/fastDomNode.js.map +1 -1
- package/esm/vs/base/browser/mouseEvent.js +3 -0
- package/esm/vs/base/browser/mouseEvent.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js +2 -0
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +5 -5
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/sash/sash.css +1 -1
- package/esm/vs/base/browser/ui/sash/sash.js +4 -0
- package/esm/vs/base/browser/ui/sash/sash.js.map +1 -1
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +1 -1
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
- package/esm/vs/base/browser/ui/table/table.css +2 -2
- package/esm/vs/base/browser/ui/tree/abstractTree.js +5 -4
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +6 -4
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/indexTreeModel.js +1 -1
- package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/media/tree.css +2 -2
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/webWorkerFactory.js +3 -0
- package/esm/vs/base/browser/webWorkerFactory.js.map +1 -1
- package/esm/vs/base/common/buffer.js.map +1 -1
- package/esm/vs/base/common/decorators.js +1 -0
- package/esm/vs/base/common/decorators.js.map +1 -1
- package/esm/vs/base/common/errors.js +1 -0
- package/esm/vs/base/common/errors.js.map +1 -1
- package/esm/vs/base/common/glob.js +1 -1
- package/esm/vs/base/common/glob.js.map +1 -1
- package/esm/vs/base/common/hash.js.map +1 -1
- package/esm/vs/base/common/hotReload.js +2 -0
- package/esm/vs/base/common/hotReload.js.map +1 -1
- package/esm/vs/base/common/hotReloadHelpers.js +1 -0
- package/esm/vs/base/common/hotReloadHelpers.js.map +1 -1
- package/esm/vs/base/common/lifecycle.js +19 -0
- package/esm/vs/base/common/lifecycle.js.map +1 -1
- package/esm/vs/base/common/map.js.map +1 -1
- package/esm/vs/base/common/marshalling.js +4 -0
- package/esm/vs/base/common/marshalling.js.map +1 -1
- package/esm/vs/base/common/network.js +1 -0
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/normalization.js +39 -0
- package/esm/vs/base/common/normalization.js.map +1 -0
- package/esm/vs/base/common/objects.js +1 -0
- package/esm/vs/base/common/objects.js.map +1 -1
- package/esm/vs/base/common/observableInternal/changeTracker.js +4 -0
- package/esm/vs/base/common/observableInternal/changeTracker.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugLocation.js +1 -0
- package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugName.js +1 -0
- package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js +1 -0
- package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js +1 -0
- package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js +1 -0
- package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derived.js +7 -1
- package/esm/vs/base/common/observableInternal/observables/derived.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +2 -0
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -0
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +1 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/base/common/process.js.map +1 -1
- package/esm/vs/base/common/product.js.map +1 -1
- package/esm/vs/base/common/types.js +2 -0
- package/esm/vs/base/common/types.js.map +1 -1
- package/esm/vs/base/common/worker/webWorker.js +26 -14
- package/esm/vs/base/common/worker/webWorker.js.map +1 -1
- package/esm/vs/base/parts/sandbox/common/sandboxTypes.js +2 -0
- package/esm/vs/base/parts/sandbox/common/sandboxTypes.js.map +1 -0
- package/esm/vs/editor/browser/config/editorConfiguration.js +3 -2
- package/esm/vs/editor/browser/config/editorConfiguration.js.map +1 -1
- package/esm/vs/editor/browser/config/migrateOptions.js +1 -1
- package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/editContextFactory.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +2 -0
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +2 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js +7 -0
- package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
- package/esm/vs/editor/browser/controller/pointerHandler.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorDom.js.map +1 -1
- package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
- package/esm/vs/editor/browser/gpu/gpuUtils.js +1 -0
- package/esm/vs/editor/browser/gpu/gpuUtils.js.map +1 -1
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -0
- package/esm/vs/editor/browser/gpu/viewGpuContext.js.map +1 -1
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/services/bulkEditService.js.map +1 -1
- package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/hoverService/hover.css +2 -0
- package/esm/vs/editor/browser/services/hoverService/hoverService.js.map +1 -1
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
- package/esm/vs/editor/browser/services/inlineCompletionsService.js +8 -8
- package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/viewLayer.js +1 -1
- package/esm/vs/editor/browser/view/viewLayer.js.map +1 -1
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -0
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +1 -0
- package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorContributions.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +4 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/utils.js +2 -0
- package/esm/vs/editor/browser/widget/diffEditor/utils.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +122 -68
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/config/fontInfo.js +32 -16
- package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
- package/esm/vs/editor/common/config/fontInfoFromSettings.js +16 -0
- package/esm/vs/editor/common/config/fontInfoFromSettings.js.map +1 -0
- package/esm/vs/editor/common/core/edits/edit.js +1 -0
- package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/stringEdit.js +2 -0
- package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
- package/esm/vs/editor/common/core/position.js +1 -1
- package/esm/vs/editor/common/core/position.js.map +1 -1
- package/esm/vs/editor/common/core/range.js +1 -1
- package/esm/vs/editor/common/core/range.js.map +1 -1
- package/esm/vs/editor/common/core/selection.js +1 -1
- package/esm/vs/editor/common/core/selection.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/editorCommon.js.map +1 -1
- package/esm/vs/editor/common/languages.js +1 -1
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js +14 -0
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js +2 -0
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +1 -1
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model.js +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/services/editorBaseApi.js.map +1 -1
- package/esm/vs/editor/common/services/editorWebWorker.js +1 -0
- package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
- package/esm/vs/editor/common/services/editorWorkerHost.js.map +1 -1
- package/esm/vs/editor/common/services/modelService.js +14 -21
- package/esm/vs/editor/common/services/modelService.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +2 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +40 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +2 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js.map +1 -1
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +1 -1
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +1 -0
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -0
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findModel.js +1 -0
- package/esm/vs/editor/contrib/find/browser/findModel.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -5
- package/esm/vs/editor/contrib/folding/browser/folding.css +4 -4
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js.map +1 -1
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +30 -14
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +5 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +56 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +2 -0
- 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 +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +27 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.css +2 -0
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +2 -0
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +8 -8
- package/esm/vs/editor/editor.api.js +4 -0
- package/esm/vs/editor/editor.api.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneEditor.js +37 -0
- package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js +37 -0
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchCompile.js +3 -0
- package/esm/vs/editor/standalone/common/monarch/monarchCompile.js.map +1 -1
- package/esm/vs/platform/accessibility/browser/accessibilityService.js +2 -2
- package/esm/vs/platform/accessibility/browser/accessibilityService.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/commands/common/commands.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +5 -0
- package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
- package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js +1 -1
- package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js.map +1 -1
- package/esm/vs/platform/dnd/browser/dnd.js +1 -1
- package/esm/vs/platform/dnd/browser/dnd.js.map +1 -1
- package/esm/vs/platform/instantiation/common/descriptors.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -0
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/list/browser/listService.js +5 -0
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- package/esm/vs/platform/log/common/log.js.map +1 -1
- package/esm/vs/platform/log/common/logService.js.map +1 -1
- package/esm/vs/platform/observable/common/wrapInHotClass.js +2 -0
- package/esm/vs/platform/observable/common/wrapInHotClass.js.map +1 -1
- package/esm/vs/platform/observable/common/wrapInReloadableClass.js +3 -0
- package/esm/vs/platform/observable/common/wrapInReloadableClass.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +68 -0
- package/esm/vs/platform/product/common/product.js.map +1 -0
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +26 -2
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/monaco.d.ts +8 -8
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser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,EACxD,QAAQ,CAAC,8BAA8B,EACvC,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,WAAW,EACX,CAAC,EACD,UAAU,EACV,QAAQ,CAAC,WAAW,EACpB,OAAO,EACP,CAAC,EACD,QAAQ,CAAC,UAAU,EACnB,QAAQ,CAAC,WAAW,EACpB,QAAQ,CAAC,aAAa,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,KAAK,mBAAmB,CAAC,GAAG,EACzC,IAAI,EACJ,IAAI,EACJ,CAAC,CACD,EAAE,EAAE,CAAC,CAAC;QAEP,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAE1B,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,OAAO,CAAC,SAAS,GAAG,WAAqB,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC","file":"ghostTextView.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 { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { sum } from '../../../../../../base/common/arrays.js';\n\nexport interface IGhostTextWidgetModel {\n\treadonly targetTextModel: IObservable<ITextModel | undefined>;\n\treadonly ghostText: IObservable<GhostText | GhostTextReplacement | undefined>;\n\treadonly warning: IObservable<{ icon: IconPath | undefined } | undefined>;\n\treadonly minReservedLineCount: IObservable<number>;\n\n\treadonly handleInlineCompletionShown: IObservable<(viewData: InlineCompletionViewData) => void>;\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed;\n\tprivate readonly _editorObs;\n\tpublic static hot = createHotClass(GhostTextView);\n\n\tprivate _warningState;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IGhostTextWidgetModel,\n\t\tprivate readonly _options: IObservable<{\n\t\t\textraClasses?: string[];\n\t\t\tsyntaxHighlightingEnabled: boolean;\n\t\t}>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\t\tthis._isDisposed = observableValue(this, false);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._warningState = derived(reader => {\n\t\t\tconst gt = this._model.ghostText.read(reader);\n\t\t\tif (!gt) { return undefined; }\n\t\t\tconst warning = this._model.warning.read(reader);\n\t\t\tif (!warning) { return undefined; }\n\t\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t\t});\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._useSyntaxHighlighting = this._options.map(o => o.syntaxHighlightingEnabled);\n\t\tthis._extraClassNames = derived(this, reader => {\n\t\t\tconst extraClasses = [...this._options.read(reader).extraClasses ?? []];\n\t\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\t\textraClasses.push('syntax-highlighted');\n\t\t\t}\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\t\textraClasses.push('warning');\n\t\t\t}\n\t\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\t\treturn extraClassNames;\n\t\t});\n\t\tthis.uiState = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\t\t\tconst textModel = this._editorObs.model.read(reader);\n\t\t\tif (textModel !== this._model.targetTextModel.read(reader)) { return undefined; }\n\t\t\tconst ghostText = this._model.ghostText.read(reader);\n\t\t\tif (!ghostText) { return undefined; }\n\n\t\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\t\tconst newRanges = edit.getNewRanges();\n\t\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tcontent,\n\t\t\t\t\tdecorations: l.decorations,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\t\tconst renderData: InlineCompletionViewData = {\n\t\t\t\tcursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\t\tcursorLineDistance: hasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\t\tlineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0,\n\t\t\t\tlineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\t\tcharacterCountOriginal: 0,\n\t\t\t\tcharacterCountModified: sum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\t\tdisjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\t\tsameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined,\n\t\t\t};\n\t\t\tthis._model.handleInlineCompletionShown.read(reader)?.(renderData);\n\n\t\t\treturn {\n\t\t\t\treplacedRange,\n\t\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\t\thiddenRange,\n\t\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\t\tadditionalReservedLineCount: this._model.minReservedLineCount.read(reader),\n\t\t\t\ttargetTextModel: textModel,\n\t\t\t\tsyntaxHighlightingEnabled,\n\t\t\t};\n\t\t});\n\t\tthis.decorations = derived(this, reader => {\n\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\tif (!uiState) { return []; }\n\n\t\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\t\tif (uiState.replacedRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (uiState.hiddenRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const p of uiState.inlineTexts) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\t\tafter: {\n\t\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn decorations;\n\t\t});\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderived(reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\t\t\treturn uiState ? {\n\t\t\t\t\t\tlineNumber: uiState.lineNumber,\n\t\t\t\t\t\tadditionalLines: uiState.additionalLines,\n\t\t\t\t\t\tminReservedLineCount: uiState.additionalReservedLineCount,\n\t\t\t\t\t\ttargetTextModel: uiState.targetTextModel,\n\t\t\t\t\t} : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis.isHovered = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t\t});\n\t\tthis.height = derived(this, reader => {\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t\t});\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this.decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t}, [\n\t\t\t\t\t\trenderIcon((state.icon && 'id' in state.icon) ? state.icon : Codicon.warning),\n\t\t\t\t\t])\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _useSyntaxHighlighting;\n\n\tprivate readonly _extraClassNames;\n\n\tprivate readonly uiState;\n\n\tprivate readonly decorations;\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly height;\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<{\n\t\t\ttargetTextModel: ITextModel;\n\t\t\tlineNumber: number;\n\t\t\tadditionalLines: LineData[];\n\t\t\tminReservedLineCount: number;\n\t\t} | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\tif (this._isClickable) {\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t}));\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t}\n\n\t\t\tthis._viewZoneListener.value = store;\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport interface LineData {\n\tcontent: LineTokens; // Must not contain a linebreak!\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\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 { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { sum } from '../../../../../../base/common/arrays.js';\n\nexport interface IGhostTextWidgetModel {\n\treadonly targetTextModel: IObservable<ITextModel | undefined>;\n\treadonly ghostText: IObservable<GhostText | GhostTextReplacement | undefined>;\n\treadonly warning: IObservable<{ icon: IconPath | undefined } | undefined>;\n\treadonly minReservedLineCount: IObservable<number>;\n\n\treadonly handleInlineCompletionShown: IObservable<(viewData: InlineCompletionViewData) => void>;\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed;\n\tprivate readonly _editorObs;\n\tpublic static hot = createHotClass(GhostTextView);\n\n\tprivate _warningState;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IGhostTextWidgetModel,\n\t\tprivate readonly _options: IObservable<{\n\t\t\textraClasses?: string[];\n\t\t\tsyntaxHighlightingEnabled: boolean;\n\t\t}>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\t\tthis._isDisposed = observableValue(this, false);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._warningState = derived(reader => {\n\t\t\tconst gt = this._model.ghostText.read(reader);\n\t\t\tif (!gt) { return undefined; }\n\t\t\tconst warning = this._model.warning.read(reader);\n\t\t\tif (!warning) { return undefined; }\n\t\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t\t});\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._useSyntaxHighlighting = this._options.map(o => o.syntaxHighlightingEnabled);\n\t\tthis._extraClassNames = derived(this, reader => {\n\t\t\tconst extraClasses = [...this._options.read(reader).extraClasses ?? []];\n\t\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\t\textraClasses.push('syntax-highlighted');\n\t\t\t}\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\t\textraClasses.push('warning');\n\t\t\t}\n\t\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\t\treturn extraClassNames;\n\t\t});\n\t\tthis.uiState = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\t\t\tconst textModel = this._editorObs.model.read(reader);\n\t\t\tif (textModel !== this._model.targetTextModel.read(reader)) { return undefined; }\n\t\t\tconst ghostText = this._model.ghostText.read(reader);\n\t\t\tif (!ghostText) { return undefined; }\n\n\t\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\t\tconst newRanges = edit.getNewRanges();\n\t\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tcontent,\n\t\t\t\t\tdecorations: l.decorations,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\t\tconst renderData: InlineCompletionViewData = {\n\t\t\t\tcursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\t\tcursorLineDistance: hasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\t\tlineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0,\n\t\t\t\tlineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\t\tcharacterCountOriginal: 0,\n\t\t\t\tcharacterCountModified: sum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\t\tdisjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\t\tsameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined,\n\t\t\t};\n\t\t\tthis._model.handleInlineCompletionShown.read(reader)?.(renderData);\n\n\t\t\treturn {\n\t\t\t\treplacedRange,\n\t\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\t\thiddenRange,\n\t\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\t\tadditionalReservedLineCount: this._model.minReservedLineCount.read(reader),\n\t\t\t\ttargetTextModel: textModel,\n\t\t\t\tsyntaxHighlightingEnabled,\n\t\t\t};\n\t\t});\n\t\tthis.decorations = derived(this, reader => {\n\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\tif (!uiState) { return []; }\n\n\t\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\t\tif (uiState.replacedRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (uiState.hiddenRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const p of uiState.inlineTexts) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\t\tafter: {\n\t\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn decorations;\n\t\t});\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderived(reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\t\t\treturn uiState ? {\n\t\t\t\t\t\tlineNumber: uiState.lineNumber,\n\t\t\t\t\t\tadditionalLines: uiState.additionalLines,\n\t\t\t\t\t\tminReservedLineCount: uiState.additionalReservedLineCount,\n\t\t\t\t\t\ttargetTextModel: uiState.targetTextModel,\n\t\t\t\t\t} : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis.isHovered = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t\t});\n\t\tthis.height = derived(this, reader => {\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t\t});\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this.decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t}, [\n\t\t\t\t\t\trenderIcon((state.icon && 'id' in state.icon) ? state.icon : Codicon.warning),\n\t\t\t\t\t])\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _useSyntaxHighlighting;\n\n\tprivate readonly _extraClassNames;\n\n\tprivate readonly uiState;\n\n\tprivate readonly decorations;\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly height;\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<{\n\t\t\ttargetTextModel: ITextModel;\n\t\t\tlineNumber: number;\n\t\t\tadditionalLines: LineData[];\n\t\t\tminReservedLineCount: number;\n\t\t} | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\tif (this._isClickable) {\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t}));\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t}\n\n\t\t\tthis._viewZoneListener.value = store;\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport interface LineData {\n\tcontent: LineTokens; // Must not contain a linebreak!\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts","vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1H,OAAO,EAAe,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC3K,OAAO,KAAK,OAAO,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE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GAAG,WAAqB,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC","file":"ghostTextView.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 { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { sum } from '../../../../../../base/common/arrays.js';\n\nexport interface IGhostTextWidgetModel {\n\treadonly targetTextModel: IObservable<ITextModel | undefined>;\n\treadonly ghostText: IObservable<GhostText | GhostTextReplacement | undefined>;\n\treadonly warning: IObservable<{ icon: IconPath | undefined } | undefined>;\n\treadonly minReservedLineCount: IObservable<number>;\n\n\treadonly handleInlineCompletionShown: IObservable<(viewData: InlineCompletionViewData) => void>;\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed;\n\tprivate readonly _editorObs;\n\tpublic static hot = createHotClass(GhostTextView);\n\n\tprivate _warningState;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IGhostTextWidgetModel,\n\t\tprivate readonly _options: IObservable<{\n\t\t\textraClasses?: string[];\n\t\t\tsyntaxHighlightingEnabled: boolean;\n\t\t}>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\t\tthis._isDisposed = observableValue(this, false);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._warningState = derived(reader => {\n\t\t\tconst gt = this._model.ghostText.read(reader);\n\t\t\tif (!gt) { return undefined; }\n\t\t\tconst warning = this._model.warning.read(reader);\n\t\t\tif (!warning) { return undefined; }\n\t\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t\t});\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._useSyntaxHighlighting = this._options.map(o => o.syntaxHighlightingEnabled);\n\t\tthis._extraClassNames = derived(this, reader => {\n\t\t\tconst extraClasses = [...this._options.read(reader).extraClasses ?? []];\n\t\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\t\textraClasses.push('syntax-highlighted');\n\t\t\t}\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\t\textraClasses.push('warning');\n\t\t\t}\n\t\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\t\treturn extraClassNames;\n\t\t});\n\t\tthis.uiState = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\t\t\tconst textModel = this._editorObs.model.read(reader);\n\t\t\tif (textModel !== this._model.targetTextModel.read(reader)) { return undefined; }\n\t\t\tconst ghostText = this._model.ghostText.read(reader);\n\t\t\tif (!ghostText) { return undefined; }\n\n\t\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\t\tconst newRanges = edit.getNewRanges();\n\t\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tcontent,\n\t\t\t\t\tdecorations: l.decorations,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\t\tconst renderData: InlineCompletionViewData = {\n\t\t\t\tcursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\t\tcursorLineDistance: hasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\t\tlineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0,\n\t\t\t\tlineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\t\tcharacterCountOriginal: 0,\n\t\t\t\tcharacterCountModified: sum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\t\tdisjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\t\tsameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined,\n\t\t\t};\n\t\t\tthis._model.handleInlineCompletionShown.read(reader)?.(renderData);\n\n\t\t\treturn {\n\t\t\t\treplacedRange,\n\t\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\t\thiddenRange,\n\t\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\t\tadditionalReservedLineCount: this._model.minReservedLineCount.read(reader),\n\t\t\t\ttargetTextModel: textModel,\n\t\t\t\tsyntaxHighlightingEnabled,\n\t\t\t};\n\t\t});\n\t\tthis.decorations = derived(this, reader => {\n\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\tif (!uiState) { return []; }\n\n\t\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\t\tif (uiState.replacedRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (uiState.hiddenRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const p of uiState.inlineTexts) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\t\tafter: {\n\t\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn decorations;\n\t\t});\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderived(reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\t\t\treturn uiState ? {\n\t\t\t\t\t\tlineNumber: uiState.lineNumber,\n\t\t\t\t\t\tadditionalLines: uiState.additionalLines,\n\t\t\t\t\t\tminReservedLineCount: uiState.additionalReservedLineCount,\n\t\t\t\t\t\ttargetTextModel: uiState.targetTextModel,\n\t\t\t\t\t} : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis.isHovered = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t\t});\n\t\tthis.height = derived(this, reader => {\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t\t});\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this.decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t}, [\n\t\t\t\t\t\trenderIcon((state.icon && 'id' in state.icon) ? state.icon : Codicon.warning),\n\t\t\t\t\t])\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _useSyntaxHighlighting;\n\n\tprivate readonly _extraClassNames;\n\n\tprivate readonly uiState;\n\n\tprivate readonly decorations;\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly height;\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<{\n\t\t\ttargetTextModel: ITextModel;\n\t\t\tlineNumber: number;\n\t\t\tadditionalLines: LineData[];\n\t\t\tminReservedLineCount: number;\n\t\t} | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\tif (this._isClickable) {\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t}));\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t}\n\n\t\t\tthis._viewZoneListener.value = store;\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport interface LineData {\n\tcontent: LineTokens; // Must not contain a linebreak!\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\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 { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { sum } from '../../../../../../base/common/arrays.js';\n\nexport interface IGhostTextWidgetModel {\n\treadonly targetTextModel: IObservable<ITextModel | undefined>;\n\treadonly ghostText: IObservable<GhostText | GhostTextReplacement | undefined>;\n\treadonly warning: IObservable<{ icon: IconPath | undefined } | undefined>;\n\treadonly minReservedLineCount: IObservable<number>;\n\n\treadonly handleInlineCompletionShown: IObservable<(viewData: InlineCompletionViewData) => void>;\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed;\n\tprivate readonly _editorObs;\n\tpublic static hot = createHotClass(GhostTextView);\n\n\tprivate _warningState;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _model: IGhostTextWidgetModel,\n\t\tprivate readonly _options: IObservable<{\n\t\t\textraClasses?: string[];\n\t\t\tsyntaxHighlightingEnabled: boolean;\n\t\t}>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t\t@ILanguageService private readonly _languageService: ILanguageService,\n\t) {\n\t\tsuper();\n\t\tthis._isDisposed = observableValue(this, false);\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._warningState = derived(reader => {\n\t\t\tconst gt = this._model.ghostText.read(reader);\n\t\t\tif (!gt) { return undefined; }\n\t\t\tconst warning = this._model.warning.read(reader);\n\t\t\tif (!warning) { return undefined; }\n\t\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t\t});\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._useSyntaxHighlighting = this._options.map(o => o.syntaxHighlightingEnabled);\n\t\tthis._extraClassNames = derived(this, reader => {\n\t\t\tconst extraClasses = [...this._options.read(reader).extraClasses ?? []];\n\t\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\t\textraClasses.push('syntax-highlighted');\n\t\t\t}\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\t\textraClasses.push('warning');\n\t\t\t}\n\t\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\t\treturn extraClassNames;\n\t\t});\n\t\tthis.uiState = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\t\t\tconst textModel = this._editorObs.model.read(reader);\n\t\t\tif (textModel !== this._model.targetTextModel.read(reader)) { return undefined; }\n\t\t\tconst ghostText = this._model.ghostText.read(reader);\n\t\t\tif (!ghostText) { return undefined; }\n\n\t\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\t\tconst newRanges = edit.getNewRanges();\n\t\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tcontent,\n\t\t\t\t\tdecorations: l.decorations,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\t\tconst renderData: InlineCompletionViewData = {\n\t\t\t\tcursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\t\tcursorLineDistance: hasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\t\tlineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0,\n\t\t\t\tlineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\t\tcharacterCountOriginal: 0,\n\t\t\t\tcharacterCountModified: sum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\t\tdisjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\t\tsameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined,\n\t\t\t};\n\t\t\tthis._model.handleInlineCompletionShown.read(reader)?.(renderData);\n\n\t\t\treturn {\n\t\t\t\treplacedRange,\n\t\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\t\thiddenRange,\n\t\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\t\tadditionalReservedLineCount: this._model.minReservedLineCount.read(reader),\n\t\t\t\ttargetTextModel: textModel,\n\t\t\t\tsyntaxHighlightingEnabled,\n\t\t\t};\n\t\t});\n\t\tthis.decorations = derived(this, reader => {\n\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\tif (!uiState) { return []; }\n\n\t\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\t\tif (uiState.replacedRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (uiState.hiddenRange) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const p of uiState.inlineTexts) {\n\t\t\t\tdecorations.push({\n\t\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\t\tafter: {\n\t\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn decorations;\n\t\t});\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderived(reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this.uiState.read(reader);\n\t\t\t\t\treturn uiState ? {\n\t\t\t\t\t\tlineNumber: uiState.lineNumber,\n\t\t\t\t\t\tadditionalLines: uiState.additionalLines,\n\t\t\t\t\t\tminReservedLineCount: uiState.additionalReservedLineCount,\n\t\t\t\t\t\ttargetTextModel: uiState.targetTextModel,\n\t\t\t\t\t} : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis.isHovered = derived(this, reader => {\n\t\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t\t});\n\t\tthis.height = derived(this, reader => {\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t\t});\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this.decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t}, [\n\t\t\t\t\t\trenderIcon((state.icon && 'id' in state.icon) ? state.icon : Codicon.warning),\n\t\t\t\t\t])\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _useSyntaxHighlighting;\n\n\tprivate readonly _extraClassNames;\n\n\tprivate readonly uiState;\n\n\tprivate readonly decorations;\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered;\n\n\tpublic readonly height;\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<{\n\t\t\ttargetTextModel: ITextModel;\n\t\t\tlineNumber: number;\n\t\t\tadditionalLines: LineData[];\n\t\t\tminReservedLineCount: number;\n\t\t} | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\tif (this._isClickable) {\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t}));\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t}\n\n\t\t\tthis._viewZoneListener.value = store;\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport interface LineData {\n\tcontent: LineTokens; // Must not contain a linebreak!\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n"]}
|
|
@@ -308,6 +308,7 @@ let InlineEditsGutterIndicator = class InlineEditsGutterIndicator extends Dispos
|
|
|
308
308
|
zIndex: '20',
|
|
309
309
|
position: 'absolute',
|
|
310
310
|
backgroundColor: this._gutterIndicatorStyles.map(v => v.background),
|
|
311
|
+
// eslint-disable-next-line local/code-no-any-casts
|
|
311
312
|
['--vscodeIconForeground']: this._gutterIndicatorStyles.map(v => v.foreground),
|
|
312
313
|
border: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),
|
|
313
314
|
boxSizing: 'border-box',
|