monaco-editor-core 0.56.0-dev-20251218 → 0.56.0-dev-20251220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/common/fuzzyScorer.js +3 -2
- package/esm/vs/base/common/fuzzyScorer.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +3 -3
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +4 -15
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +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 +13 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +5 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +14 -9
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +5 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +3 -37
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +1 -0
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- 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/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAe,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAE7H,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mGAAmG,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AC,aAAa,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,SAAS,yBAAyB,CAAC,KAAiB;IACnD,OAAO,mBAAmB,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAChE,CAAC","file":"originalEditorInlineDiffView.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 { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { autorunWithStore, derived, IObservable, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { rangeIsSingleLine } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { AbstractText } from '../../../../../../common/core/text/abstractText.js';\nimport { DetailedLineRangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, InjectedTextCursorStops, ITextModel } from '../../../../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../../../../common/model/textModel.js';\nimport { IInlineEditsView, InlineEditClickEvent } from '../inlineEditsViewInterface.js';\nimport { classNames } from '../utils/utils.js';\n\nexport interface IOriginalEditorInlineDiffViewState {\n\tdiff: DetailedLineRangeMapping[];\n\tmodifiedText: AbstractText;\n\tmode: 'insertionInline' | 'sideBySide' | 'deletion' | 'lineReplacement';\n\tisInDiffEditor: boolean;\n\n\tmodifiedCodeEditor: ICodeEditor;\n}\n\nexport class OriginalEditorInlineDiffView extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\treadonly isHovered;\n\n\tprivate readonly _tokenizationFinished;\n\n\tconstructor(\n\t\tprivate readonly _originalEditor: ICodeEditor,\n\t\tprivate readonly _state: IObservable<IOriginalEditorInlineDiffViewState | undefined>,\n\t\tprivate readonly _modifiedTextModel: ITextModel,\n\t) {\n\t\tsuper();\n\t\tthis.isHovered = observableCodeEditor(this._originalEditor).isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof InlineEditAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis._tokenizationFinished = modelTokenizationFinished(this._modifiedTextModel);\n\t\tthis._decorations = derived(this, reader => {\n\t\t\tconst diff = this._state.read(reader);\n\t\t\tif (!diff) { return undefined; }\n\n\t\t\tconst modified = diff.modifiedText;\n\t\t\tconst showInline = diff.mode === 'insertionInline';\n\t\t\tconst hasOneInnerChange = diff.diff.length === 1 && diff.diff[0].innerChanges?.length === 1;\n\n\t\t\tconst showEmptyDecorations = true;\n\n\t\t\tconst originalDecorations: IModelDeltaDecoration[] = [];\n\t\t\tconst modifiedDecorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst diffLineAddDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-insert',\n\t\t\t\tdescription: 'line-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-insert',\n\t\t\t});\n\n\t\t\tconst diffLineDeleteDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-delete',\n\t\t\t\tdescription: 'line-delete',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-delete',\n\t\t\t});\n\n\t\t\tconst diffWholeLineDeleteDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-delete',\n\t\t\t\tdescription: 'char-delete',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tzIndex: 1, // be on top of diff background decoration\n\t\t\t});\n\n\t\t\tconst diffWholeLineAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecorationEmpty = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert diff-range-empty',\n\t\t\t\tdescription: 'char-insert diff-range-empty',\n\t\t\t});\n\n\t\t\tconst NESOriginalBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-original-lines',\n\t\t\t\tdescription: 'inlineCompletions-original-lines',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst showFullLineDecorations = diff.mode !== 'sideBySide' && diff.mode !== 'deletion' && diff.mode !== 'insertionInline' && diff.mode !== 'lineReplacement';\n\t\t\tconst hideEmptyInnerDecorations = diff.mode === 'lineReplacement';\n\t\t\tfor (const m of diff.diff) {\n\t\t\t\tif (showFullLineDecorations) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineDeleteDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\trange: m.modified.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineAddDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (m.modified.isEmpty || m.original.isEmpty) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({ range: m.original.toInclusiveRange()!, options: diffWholeLineDeleteDecoration });\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({ range: m.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration });\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst useInlineDiff = showInline && allowsTrueInlineDiffRendering(m);\n\t\t\t\t\tfor (const i of m.innerChanges || []) {\n\t\t\t\t\t\t// Don't show empty markers outside the line range\n\t\t\t\t\t\tif (m.original.contains(i.originalRange.startLineNumber) && !(hideEmptyInnerDecorations && i.originalRange.isEmpty())) {\n\t\t\t\t\t\t\tconst replacedText = this._originalEditor.getModel()?.getValueInRange(i.originalRange, EndOfLinePreference.LF);\n\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\trange: i.originalRange,\n\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\tdescription: 'char-delete',\n\t\t\t\t\t\t\t\t\tshouldFillLineOnLineBreak: false,\n\t\t\t\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-delete',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isEmpty() && 'empty',\n\t\t\t\t\t\t\t\t\t\t((i.originalRange.isEmpty() && hasOneInnerChange || diff.mode === 'deletion' && replacedText === '\\n') && showEmptyDecorations && !useInlineDiff) && 'diff-range-empty'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tinlineClassName: useInlineDiff ? classNames('strike-through', 'inlineCompletions') : null,\n\t\t\t\t\t\t\t\t\tzIndex: 1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m.modified.contains(i.modifiedRange.startLineNumber)) {\n\t\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\t\trange: i.modifiedRange,\n\t\t\t\t\t\t\t\toptions: (i.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff && hasOneInnerChange)\n\t\t\t\t\t\t\t\t\t? diffAddDecorationEmpty\n\t\t\t\t\t\t\t\t\t: diffAddDecoration\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (useInlineDiff) {\n\t\t\t\t\t\t\tconst insertedText = modified.getValueOfRange(i.modifiedRange);\n\t\t\t\t\t\t\t// when the injected text becomes long, the editor will split it into multiple spans\n\t\t\t\t\t\t\t// to be able to get the border around the start and end of the text, we need to split it into multiple segments\n\t\t\t\t\t\t\tconst textSegments = insertedText.length > 3 ?\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(0, 1), extraClasses: ['start'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.startColumn) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(1, -1), extraClasses: [], offsetRange: new OffsetRange(i.modifiedRange.startColumn, i.modifiedRange.endColumn - 2) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(-1), extraClasses: ['end'], offsetRange: new OffsetRange(i.modifiedRange.endColumn - 2, i.modifiedRange.endColumn - 1) }\n\t\t\t\t\t\t\t\t] :\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText, extraClasses: ['start', 'end'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.endColumn) }\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t// Tokenization\n\t\t\t\t\t\t\tthis._tokenizationFinished.read(reader); // reconsider when tokenization is finished\n\t\t\t\t\t\t\tconst lineTokens = this._modifiedTextModel.tokenization.getLineTokens(i.modifiedRange.startLineNumber);\n\n\t\t\t\t\t\t\tfor (const { text, extraClasses, offsetRange } of textSegments) {\n\t\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\t\trange: Range.fromPositions(i.originalRange.getEndPosition()),\n\t\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\t\tdescription: 'inserted-text',\n\t\t\t\t\t\t\t\t\t\tbefore: {\n\t\t\t\t\t\t\t\t\t\t\ttokens: lineTokens.getTokensInRange(offsetRange),\n\t\t\t\t\t\t\t\t\t\t\tcontent: text,\n\t\t\t\t\t\t\t\t\t\t\tinlineClassName: classNames(\n\t\t\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-insert',\n\t\t\t\t\t\t\t\t\t\t\t\ti.modifiedRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\t\t\t...extraClasses // include extraClasses for additional styling if provided\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.None,\n\t\t\t\t\t\t\t\t\t\t\tattachedData: new InlineEditAttachedData(this),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tzIndex: 2,\n\t\t\t\t\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (diff.isInDiffEditor) {\n\t\t\t\tfor (const m of diff.diff) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toExclusiveRange(),\n\t\t\t\t\t\t\toptions: NESOriginalBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { originalDecorations, modifiedDecorations };\n\t\t});\n\n\t\tthis._register(observableCodeEditor(this._originalEditor).setDecorations(this._decorations.map(d => d?.originalDecorations ?? [])));\n\n\t\tconst modifiedCodeEditor = this._state.map(s => s?.modifiedCodeEditor);\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst e = modifiedCodeEditor.read(reader);\n\t\t\tif (e) {\n\t\t\t\tstore.add(observableCodeEditor(e).setDecorations(this._decorations.map(d => d?.modifiedDecorations ?? [])));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._originalEditor.onMouseUp(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\tif (a instanceof InlineEditAttachedData && a.owner === this) {\n\t\t\t\tthis._onDidClick.fire(new InlineEditClickEvent(e.event));\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate readonly _decorations;\n}\n\nclass InlineEditAttachedData {\n\tconstructor(public readonly owner: OriginalEditorInlineDiffView) { }\n}\n\nfunction allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange)));\n}\n\nlet i = 0;\nfunction modelTokenizationFinished(model: ITextModel): IObservable<number> {\n\treturn observableFromEvent(model.onDidChangeTokens, () => i++);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { autorunWithStore, derived, IObservable, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { rangeIsSingleLine } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { AbstractText } from '../../../../../../common/core/text/abstractText.js';\nimport { DetailedLineRangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, InjectedTextCursorStops, ITextModel } from '../../../../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../../../../common/model/textModel.js';\nimport { IInlineEditsView, InlineEditClickEvent } from '../inlineEditsViewInterface.js';\nimport { classNames } from '../utils/utils.js';\n\nexport interface IOriginalEditorInlineDiffViewState {\n\tdiff: DetailedLineRangeMapping[];\n\tmodifiedText: AbstractText;\n\tmode: 'insertionInline' | 'sideBySide' | 'deletion' | 'lineReplacement';\n\tisInDiffEditor: boolean;\n\n\tmodifiedCodeEditor: ICodeEditor;\n}\n\nexport class OriginalEditorInlineDiffView extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\treadonly isHovered;\n\n\tprivate readonly _tokenizationFinished;\n\n\tconstructor(\n\t\tprivate readonly _originalEditor: ICodeEditor,\n\t\tprivate readonly _state: IObservable<IOriginalEditorInlineDiffViewState | undefined>,\n\t\tprivate readonly _modifiedTextModel: ITextModel,\n\t) {\n\t\tsuper();\n\t\tthis.isHovered = observableCodeEditor(this._originalEditor).isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof InlineEditAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis._tokenizationFinished = modelTokenizationFinished(this._modifiedTextModel);\n\t\tthis._decorations = derived(this, reader => {\n\t\t\tconst diff = this._state.read(reader);\n\t\t\tif (!diff) { return undefined; }\n\n\t\t\tconst modified = diff.modifiedText;\n\t\t\tconst showInline = diff.mode === 'insertionInline';\n\t\t\tconst hasOneInnerChange = diff.diff.length === 1 && diff.diff[0].innerChanges?.length === 1;\n\n\t\t\tconst showEmptyDecorations = true;\n\n\t\t\tconst originalDecorations: IModelDeltaDecoration[] = [];\n\t\t\tconst modifiedDecorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst diffLineAddDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-insert',\n\t\t\t\tdescription: 'line-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-insert',\n\t\t\t});\n\n\t\t\tconst diffLineDeleteDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-delete',\n\t\t\t\tdescription: 'line-delete',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-delete',\n\t\t\t});\n\n\t\t\tconst diffWholeLineDeleteDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-delete',\n\t\t\t\tdescription: 'char-delete',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tzIndex: 1, // be on top of diff background decoration\n\t\t\t});\n\n\t\t\tconst diffWholeLineAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecorationEmpty = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert diff-range-empty',\n\t\t\t\tdescription: 'char-insert diff-range-empty',\n\t\t\t});\n\n\t\t\tconst NESOriginalBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-original-lines',\n\t\t\t\tdescription: 'inlineCompletions-original-lines',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst showFullLineDecorations = diff.mode !== 'sideBySide' && diff.mode !== 'deletion' && diff.mode !== 'insertionInline' && diff.mode !== 'lineReplacement';\n\t\t\tconst hideEmptyInnerDecorations = diff.mode === 'lineReplacement';\n\t\t\tfor (const m of diff.diff) {\n\t\t\t\tif (showFullLineDecorations) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineDeleteDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\trange: m.modified.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineAddDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (m.modified.isEmpty || m.original.isEmpty) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({ range: m.original.toInclusiveRange()!, options: diffWholeLineDeleteDecoration });\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({ range: m.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration });\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst useInlineDiff = showInline && allowsTrueInlineDiffRendering(m);\n\t\t\t\t\tfor (const i of m.innerChanges || []) {\n\t\t\t\t\t\t// Don't show empty markers outside the line range\n\t\t\t\t\t\tif (m.original.contains(i.originalRange.startLineNumber) && !(hideEmptyInnerDecorations && i.originalRange.isEmpty())) {\n\t\t\t\t\t\t\tconst replacedText = this._originalEditor.getModel()?.getValueInRange(i.originalRange, EndOfLinePreference.LF);\n\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\trange: i.originalRange,\n\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\tdescription: 'char-delete',\n\t\t\t\t\t\t\t\t\tshouldFillLineOnLineBreak: false,\n\t\t\t\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-delete',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isEmpty() && 'empty',\n\t\t\t\t\t\t\t\t\t\t((i.originalRange.isEmpty() && hasOneInnerChange || diff.mode === 'deletion' && replacedText === '\\n') && showEmptyDecorations && !useInlineDiff) && 'diff-range-empty'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tinlineClassName: useInlineDiff ? classNames('strike-through', 'inlineCompletions') : null,\n\t\t\t\t\t\t\t\t\tzIndex: 1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m.modified.contains(i.modifiedRange.startLineNumber)) {\n\t\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\t\trange: i.modifiedRange,\n\t\t\t\t\t\t\t\toptions: (i.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff && hasOneInnerChange)\n\t\t\t\t\t\t\t\t\t? diffAddDecorationEmpty\n\t\t\t\t\t\t\t\t\t: diffAddDecoration\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (useInlineDiff) {\n\t\t\t\t\t\t\tconst insertedText = modified.getValueOfRange(i.modifiedRange);\n\t\t\t\t\t\t\t// when the injected text becomes long, the editor will split it into multiple spans\n\t\t\t\t\t\t\t// to be able to get the border around the start and end of the text, we need to split it into multiple segments\n\t\t\t\t\t\t\tconst textSegments = insertedText.length > 3 ?\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(0, 1), extraClasses: ['start'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.startColumn) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(1, -1), extraClasses: [], offsetRange: new OffsetRange(i.modifiedRange.startColumn, i.modifiedRange.endColumn - 2) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(-1), extraClasses: ['end'], offsetRange: new OffsetRange(i.modifiedRange.endColumn - 2, i.modifiedRange.endColumn - 1) }\n\t\t\t\t\t\t\t\t] :\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText, extraClasses: ['start', 'end'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.endColumn) }\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t// Tokenization\n\t\t\t\t\t\t\tthis._tokenizationFinished.read(reader); // reconsider when tokenization is finished\n\t\t\t\t\t\t\tconst lineTokens = this._modifiedTextModel.tokenization.getLineTokens(i.modifiedRange.startLineNumber);\n\n\t\t\t\t\t\t\tfor (const { text, extraClasses, offsetRange } of textSegments) {\n\t\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\t\trange: Range.fromPositions(i.originalRange.getEndPosition()),\n\t\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\t\tdescription: 'inserted-text',\n\t\t\t\t\t\t\t\t\t\tbefore: {\n\t\t\t\t\t\t\t\t\t\t\ttokens: lineTokens.getTokensInRange(offsetRange),\n\t\t\t\t\t\t\t\t\t\t\tcontent: text,\n\t\t\t\t\t\t\t\t\t\t\tinlineClassName: classNames(\n\t\t\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-insert',\n\t\t\t\t\t\t\t\t\t\t\t\ti.modifiedRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\t\t\t...extraClasses // include extraClasses for additional styling if provided\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.None,\n\t\t\t\t\t\t\t\t\t\t\tattachedData: new InlineEditAttachedData(this),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tzIndex: 2,\n\t\t\t\t\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (diff.isInDiffEditor) {\n\t\t\t\tfor (const m of diff.diff) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toExclusiveRange(),\n\t\t\t\t\t\t\toptions: NESOriginalBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { originalDecorations, modifiedDecorations };\n\t\t});\n\n\t\tthis._register(observableCodeEditor(this._originalEditor).setDecorations(this._decorations.map(d => d?.originalDecorations ?? [])));\n\n\t\tconst modifiedCodeEditor = this._state.map(s => s?.modifiedCodeEditor);\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst e = modifiedCodeEditor.read(reader);\n\t\t\tif (e) {\n\t\t\t\tstore.add(observableCodeEditor(e).setDecorations(this._decorations.map(d => d?.modifiedDecorations ?? [])));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._originalEditor.onMouseUp(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\tif (a instanceof InlineEditAttachedData && a.owner === this) {\n\t\t\t\tthis._onDidClick.fire(new InlineEditClickEvent(e.event));\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate readonly _decorations;\n}\n\nclass InlineEditAttachedData {\n\tconstructor(public readonly owner: OriginalEditorInlineDiffView) { }\n}\n\nfunction allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange)));\n}\n\nlet i = 0;\nfunction modelTokenizationFinished(model: ITextModel): IObservable<number> {\n\treturn observableFromEvent(model.onDidChangeTokens, () => i++);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAe,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAE7H,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mGAAmG,CAAC;AACtI,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,KAAK,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AAC,aAAa,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,SAAS,yBAAyB,CAAC,KAAiB;IACnD,OAAO,mBAAmB,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAChE,CAAC","file":"originalEditorInlineDiffView.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 { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { autorunWithStore, derived, IObservable, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { rangeIsSingleLine } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { AbstractText } from '../../../../../../common/core/text/abstractText.js';\nimport { DetailedLineRangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, InjectedTextCursorStops, ITextModel } from '../../../../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../../../../common/model/textModel.js';\nimport { IInlineEditsView, InlineEditClickEvent } from '../inlineEditsViewInterface.js';\nimport { classNames } from '../utils/utils.js';\nimport { InlineCompletionEditorType } from '../../../model/provideInlineCompletions.js';\n\nexport interface IOriginalEditorInlineDiffViewState {\n\tdiff: DetailedLineRangeMapping[];\n\tmodifiedText: AbstractText;\n\tmode: 'insertionInline' | 'sideBySide' | 'deletion' | 'lineReplacement';\n\teditorType: InlineCompletionEditorType;\n\n\tmodifiedCodeEditor: ICodeEditor;\n}\n\nexport class OriginalEditorInlineDiffView extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\treadonly isHovered;\n\n\tprivate readonly _tokenizationFinished;\n\n\tconstructor(\n\t\tprivate readonly _originalEditor: ICodeEditor,\n\t\tprivate readonly _state: IObservable<IOriginalEditorInlineDiffViewState | undefined>,\n\t\tprivate readonly _modifiedTextModel: ITextModel,\n\t) {\n\t\tsuper();\n\t\tthis.isHovered = observableCodeEditor(this._originalEditor).isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof InlineEditAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis._tokenizationFinished = modelTokenizationFinished(this._modifiedTextModel);\n\t\tthis._decorations = derived(this, reader => {\n\t\t\tconst diff = this._state.read(reader);\n\t\t\tif (!diff) { return undefined; }\n\n\t\t\tconst modified = diff.modifiedText;\n\t\t\tconst showInline = diff.mode === 'insertionInline';\n\t\t\tconst hasOneInnerChange = diff.diff.length === 1 && diff.diff[0].innerChanges?.length === 1;\n\n\t\t\tconst showEmptyDecorations = true;\n\n\t\t\tconst originalDecorations: IModelDeltaDecoration[] = [];\n\t\t\tconst modifiedDecorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst diffLineAddDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-insert',\n\t\t\t\tdescription: 'line-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-insert',\n\t\t\t});\n\n\t\t\tconst diffLineDeleteDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-delete',\n\t\t\t\tdescription: 'line-delete',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-delete',\n\t\t\t});\n\n\t\t\tconst diffWholeLineDeleteDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-delete',\n\t\t\t\tdescription: 'char-delete',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tzIndex: 1, // be on top of diff background decoration\n\t\t\t});\n\n\t\t\tconst diffWholeLineAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecorationEmpty = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert diff-range-empty',\n\t\t\t\tdescription: 'char-insert diff-range-empty',\n\t\t\t});\n\n\t\t\tconst NESOriginalBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-original-lines',\n\t\t\t\tdescription: 'inlineCompletions-original-lines',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst showFullLineDecorations = diff.mode !== 'sideBySide' && diff.mode !== 'deletion' && diff.mode !== 'insertionInline' && diff.mode !== 'lineReplacement';\n\t\t\tconst hideEmptyInnerDecorations = diff.mode === 'lineReplacement';\n\t\t\tfor (const m of diff.diff) {\n\t\t\t\tif (showFullLineDecorations) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineDeleteDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\trange: m.modified.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineAddDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (m.modified.isEmpty || m.original.isEmpty) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({ range: m.original.toInclusiveRange()!, options: diffWholeLineDeleteDecoration });\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({ range: m.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration });\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst useInlineDiff = showInline && allowsTrueInlineDiffRendering(m);\n\t\t\t\t\tfor (const i of m.innerChanges || []) {\n\t\t\t\t\t\t// Don't show empty markers outside the line range\n\t\t\t\t\t\tif (m.original.contains(i.originalRange.startLineNumber) && !(hideEmptyInnerDecorations && i.originalRange.isEmpty())) {\n\t\t\t\t\t\t\tconst replacedText = this._originalEditor.getModel()?.getValueInRange(i.originalRange, EndOfLinePreference.LF);\n\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\trange: i.originalRange,\n\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\tdescription: 'char-delete',\n\t\t\t\t\t\t\t\t\tshouldFillLineOnLineBreak: false,\n\t\t\t\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-delete',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isEmpty() && 'empty',\n\t\t\t\t\t\t\t\t\t\t((i.originalRange.isEmpty() && hasOneInnerChange || diff.mode === 'deletion' && replacedText === '\\n') && showEmptyDecorations && !useInlineDiff) && 'diff-range-empty'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tinlineClassName: useInlineDiff ? classNames('strike-through', 'inlineCompletions') : null,\n\t\t\t\t\t\t\t\t\tzIndex: 1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m.modified.contains(i.modifiedRange.startLineNumber)) {\n\t\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\t\trange: i.modifiedRange,\n\t\t\t\t\t\t\t\toptions: (i.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff && hasOneInnerChange)\n\t\t\t\t\t\t\t\t\t? diffAddDecorationEmpty\n\t\t\t\t\t\t\t\t\t: diffAddDecoration\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (useInlineDiff) {\n\t\t\t\t\t\t\tconst insertedText = modified.getValueOfRange(i.modifiedRange);\n\t\t\t\t\t\t\t// when the injected text becomes long, the editor will split it into multiple spans\n\t\t\t\t\t\t\t// to be able to get the border around the start and end of the text, we need to split it into multiple segments\n\t\t\t\t\t\t\tconst textSegments = insertedText.length > 3 ?\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(0, 1), extraClasses: ['start'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.startColumn) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(1, -1), extraClasses: [], offsetRange: new OffsetRange(i.modifiedRange.startColumn, i.modifiedRange.endColumn - 2) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(-1), extraClasses: ['end'], offsetRange: new OffsetRange(i.modifiedRange.endColumn - 2, i.modifiedRange.endColumn - 1) }\n\t\t\t\t\t\t\t\t] :\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText, extraClasses: ['start', 'end'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.endColumn) }\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t// Tokenization\n\t\t\t\t\t\t\tthis._tokenizationFinished.read(reader); // reconsider when tokenization is finished\n\t\t\t\t\t\t\tconst lineTokens = this._modifiedTextModel.tokenization.getLineTokens(i.modifiedRange.startLineNumber);\n\n\t\t\t\t\t\t\tfor (const { text, extraClasses, offsetRange } of textSegments) {\n\t\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\t\trange: Range.fromPositions(i.originalRange.getEndPosition()),\n\t\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\t\tdescription: 'inserted-text',\n\t\t\t\t\t\t\t\t\t\tbefore: {\n\t\t\t\t\t\t\t\t\t\t\ttokens: lineTokens.getTokensInRange(offsetRange),\n\t\t\t\t\t\t\t\t\t\t\tcontent: text,\n\t\t\t\t\t\t\t\t\t\t\tinlineClassName: classNames(\n\t\t\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-insert',\n\t\t\t\t\t\t\t\t\t\t\t\ti.modifiedRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\t\t\t...extraClasses // include extraClasses for additional styling if provided\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.None,\n\t\t\t\t\t\t\t\t\t\t\tattachedData: new InlineEditAttachedData(this),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tzIndex: 2,\n\t\t\t\t\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (diff.editorType === InlineCompletionEditorType.DiffEditor) {\n\t\t\t\tfor (const m of diff.diff) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toExclusiveRange(),\n\t\t\t\t\t\t\toptions: NESOriginalBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { originalDecorations, modifiedDecorations };\n\t\t});\n\n\t\tthis._register(observableCodeEditor(this._originalEditor).setDecorations(this._decorations.map(d => d?.originalDecorations ?? [])));\n\n\t\tconst modifiedCodeEditor = this._state.map(s => s?.modifiedCodeEditor);\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst e = modifiedCodeEditor.read(reader);\n\t\t\tif (e) {\n\t\t\t\tstore.add(observableCodeEditor(e).setDecorations(this._decorations.map(d => d?.modifiedDecorations ?? [])));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._originalEditor.onMouseUp(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\tif (a instanceof InlineEditAttachedData && a.owner === this) {\n\t\t\t\tthis._onDidClick.fire(new InlineEditClickEvent(e.event));\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate readonly _decorations;\n}\n\nclass InlineEditAttachedData {\n\tconstructor(public readonly owner: OriginalEditorInlineDiffView) { }\n}\n\nfunction allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange)));\n}\n\nlet i = 0;\nfunction modelTokenizationFinished(model: ITextModel): IObservable<number> {\n\treturn observableFromEvent(model.onDidChangeTokens, () => i++);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter } from '../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../base/common/lifecycle.js';\nimport { autorunWithStore, derived, IObservable, observableFromEvent } from '../../../../../../../base/common/observable.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { rangeIsSingleLine } from '../../../../../../browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { AbstractText } from '../../../../../../common/core/text/abstractText.js';\nimport { DetailedLineRangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, InjectedTextCursorStops, ITextModel } from '../../../../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../../../../common/model/textModel.js';\nimport { IInlineEditsView, InlineEditClickEvent } from '../inlineEditsViewInterface.js';\nimport { classNames } from '../utils/utils.js';\nimport { InlineCompletionEditorType } from '../../../model/provideInlineCompletions.js';\n\nexport interface IOriginalEditorInlineDiffViewState {\n\tdiff: DetailedLineRangeMapping[];\n\tmodifiedText: AbstractText;\n\tmode: 'insertionInline' | 'sideBySide' | 'deletion' | 'lineReplacement';\n\teditorType: InlineCompletionEditorType;\n\n\tmodifiedCodeEditor: ICodeEditor;\n}\n\nexport class OriginalEditorInlineDiffView extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _onDidClick = this._register(new Emitter<InlineEditClickEvent>());\n\treadonly onDidClick = this._onDidClick.event;\n\n\treadonly isHovered;\n\n\tprivate readonly _tokenizationFinished;\n\n\tconstructor(\n\t\tprivate readonly _originalEditor: ICodeEditor,\n\t\tprivate readonly _state: IObservable<IOriginalEditorInlineDiffViewState | undefined>,\n\t\tprivate readonly _modifiedTextModel: ITextModel,\n\t) {\n\t\tsuper();\n\t\tthis.isHovered = observableCodeEditor(this._originalEditor).isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof InlineEditAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\t\tthis._tokenizationFinished = modelTokenizationFinished(this._modifiedTextModel);\n\t\tthis._decorations = derived(this, reader => {\n\t\t\tconst diff = this._state.read(reader);\n\t\t\tif (!diff) { return undefined; }\n\n\t\t\tconst modified = diff.modifiedText;\n\t\t\tconst showInline = diff.mode === 'insertionInline';\n\t\t\tconst hasOneInnerChange = diff.diff.length === 1 && diff.diff[0].innerChanges?.length === 1;\n\n\t\t\tconst showEmptyDecorations = true;\n\n\t\t\tconst originalDecorations: IModelDeltaDecoration[] = [];\n\t\t\tconst modifiedDecorations: IModelDeltaDecoration[] = [];\n\n\t\t\tconst diffLineAddDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-insert',\n\t\t\t\tdescription: 'line-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-insert',\n\t\t\t});\n\n\t\t\tconst diffLineDeleteDecorationBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-line-delete',\n\t\t\t\tdescription: 'line-delete',\n\t\t\t\tisWholeLine: true,\n\t\t\t\tmarginClassName: 'gutter-delete',\n\t\t\t});\n\n\t\t\tconst diffWholeLineDeleteDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-delete',\n\t\t\t\tdescription: 'char-delete',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tzIndex: 1, // be on top of diff background decoration\n\t\t\t});\n\n\t\t\tconst diffWholeLineAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tisWholeLine: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecoration = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert',\n\t\t\t\tdescription: 'char-insert',\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst diffAddDecorationEmpty = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-char-insert diff-range-empty',\n\t\t\t\tdescription: 'char-insert diff-range-empty',\n\t\t\t});\n\n\t\t\tconst NESOriginalBackground = ModelDecorationOptions.register({\n\t\t\t\tclassName: 'inlineCompletions-original-lines',\n\t\t\t\tdescription: 'inlineCompletions-original-lines',\n\t\t\t\tisWholeLine: false,\n\t\t\t\tshouldFillLineOnLineBreak: true,\n\t\t\t});\n\n\t\t\tconst showFullLineDecorations = diff.mode !== 'sideBySide' && diff.mode !== 'deletion' && diff.mode !== 'insertionInline' && diff.mode !== 'lineReplacement';\n\t\t\tconst hideEmptyInnerDecorations = diff.mode === 'lineReplacement';\n\t\t\tfor (const m of diff.diff) {\n\t\t\t\tif (showFullLineDecorations) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineDeleteDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\trange: m.modified.toInclusiveRange()!,\n\t\t\t\t\t\t\toptions: diffLineAddDecorationBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (m.modified.isEmpty || m.original.isEmpty) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({ range: m.original.toInclusiveRange()!, options: diffWholeLineDeleteDecoration });\n\t\t\t\t\t}\n\t\t\t\t\tif (!m.modified.isEmpty) {\n\t\t\t\t\t\tmodifiedDecorations.push({ range: m.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration });\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst useInlineDiff = showInline && allowsTrueInlineDiffRendering(m);\n\t\t\t\t\tfor (const i of m.innerChanges || []) {\n\t\t\t\t\t\t// Don't show empty markers outside the line range\n\t\t\t\t\t\tif (m.original.contains(i.originalRange.startLineNumber) && !(hideEmptyInnerDecorations && i.originalRange.isEmpty())) {\n\t\t\t\t\t\t\tconst replacedText = this._originalEditor.getModel()?.getValueInRange(i.originalRange, EndOfLinePreference.LF);\n\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\trange: i.originalRange,\n\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\tdescription: 'char-delete',\n\t\t\t\t\t\t\t\t\tshouldFillLineOnLineBreak: false,\n\t\t\t\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-delete',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\ti.originalRange.isEmpty() && 'empty',\n\t\t\t\t\t\t\t\t\t\t((i.originalRange.isEmpty() && hasOneInnerChange || diff.mode === 'deletion' && replacedText === '\\n') && showEmptyDecorations && !useInlineDiff) && 'diff-range-empty'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tinlineClassName: useInlineDiff ? classNames('strike-through', 'inlineCompletions') : null,\n\t\t\t\t\t\t\t\t\tzIndex: 1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m.modified.contains(i.modifiedRange.startLineNumber)) {\n\t\t\t\t\t\t\tmodifiedDecorations.push({\n\t\t\t\t\t\t\t\trange: i.modifiedRange,\n\t\t\t\t\t\t\t\toptions: (i.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff && hasOneInnerChange)\n\t\t\t\t\t\t\t\t\t? diffAddDecorationEmpty\n\t\t\t\t\t\t\t\t\t: diffAddDecoration\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (useInlineDiff) {\n\t\t\t\t\t\t\tconst insertedText = modified.getValueOfRange(i.modifiedRange);\n\t\t\t\t\t\t\t// when the injected text becomes long, the editor will split it into multiple spans\n\t\t\t\t\t\t\t// to be able to get the border around the start and end of the text, we need to split it into multiple segments\n\t\t\t\t\t\t\tconst textSegments = insertedText.length > 3 ?\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(0, 1), extraClasses: ['start'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.startColumn) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(1, -1), extraClasses: [], offsetRange: new OffsetRange(i.modifiedRange.startColumn, i.modifiedRange.endColumn - 2) },\n\t\t\t\t\t\t\t\t\t{ text: insertedText.slice(-1), extraClasses: ['end'], offsetRange: new OffsetRange(i.modifiedRange.endColumn - 2, i.modifiedRange.endColumn - 1) }\n\t\t\t\t\t\t\t\t] :\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t{ text: insertedText, extraClasses: ['start', 'end'], offsetRange: new OffsetRange(i.modifiedRange.startColumn - 1, i.modifiedRange.endColumn) }\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t// Tokenization\n\t\t\t\t\t\t\tthis._tokenizationFinished.read(reader); // reconsider when tokenization is finished\n\t\t\t\t\t\t\tconst lineTokens = this._modifiedTextModel.tokenization.getLineTokens(i.modifiedRange.startLineNumber);\n\n\t\t\t\t\t\t\tfor (const { text, extraClasses, offsetRange } of textSegments) {\n\t\t\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\t\t\trange: Range.fromPositions(i.originalRange.getEndPosition()),\n\t\t\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\t\t\tdescription: 'inserted-text',\n\t\t\t\t\t\t\t\t\t\tbefore: {\n\t\t\t\t\t\t\t\t\t\t\ttokens: lineTokens.getTokensInRange(offsetRange),\n\t\t\t\t\t\t\t\t\t\t\tcontent: text,\n\t\t\t\t\t\t\t\t\t\t\tinlineClassName: classNames(\n\t\t\t\t\t\t\t\t\t\t\t\t'inlineCompletions-char-insert',\n\t\t\t\t\t\t\t\t\t\t\t\ti.modifiedRange.isSingleLine() && diff.mode === 'insertionInline' && 'single-line-inline',\n\t\t\t\t\t\t\t\t\t\t\t\t...extraClasses // include extraClasses for additional styling if provided\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.None,\n\t\t\t\t\t\t\t\t\t\t\tattachedData: new InlineEditAttachedData(this),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tzIndex: 2,\n\t\t\t\t\t\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (diff.editorType === InlineCompletionEditorType.DiffEditor) {\n\t\t\t\tfor (const m of diff.diff) {\n\t\t\t\t\tif (!m.original.isEmpty) {\n\t\t\t\t\t\toriginalDecorations.push({\n\t\t\t\t\t\t\trange: m.original.toExclusiveRange(),\n\t\t\t\t\t\t\toptions: NESOriginalBackground,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { originalDecorations, modifiedDecorations };\n\t\t});\n\n\t\tthis._register(observableCodeEditor(this._originalEditor).setDecorations(this._decorations.map(d => d?.originalDecorations ?? [])));\n\n\t\tconst modifiedCodeEditor = this._state.map(s => s?.modifiedCodeEditor);\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tconst e = modifiedCodeEditor.read(reader);\n\t\t\tif (e) {\n\t\t\t\tstore.add(observableCodeEditor(e).setDecorations(this._decorations.map(d => d?.modifiedDecorations ?? [])));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._originalEditor.onMouseUp(e => {\n\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\tif (a instanceof InlineEditAttachedData && a.owner === this) {\n\t\t\t\tthis._onDidClick.fire(new InlineEditClickEvent(e.event));\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate readonly _decorations;\n}\n\nclass InlineEditAttachedData {\n\tconstructor(public readonly owner: OriginalEditorInlineDiffView) { }\n}\n\nfunction allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange)));\n}\n\nlet i = 0;\nfunction modelTokenizationFinished(model: ITextModel): IObservable<number> {\n\treturn observableFromEvent(model.onDidChangeTokens, () => i++);\n}\n"]}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { assertNever } from '../../../../../../base/common/assert.js';
|
|
5
6
|
import { BugIndicatingError } from '../../../../../../base/common/errors.js';
|
|
6
7
|
import { observableFromEventOpts } from '../../../../../../base/common/observable.js';
|
|
7
8
|
import { localize } from '../../../../../../nls.js';
|
|
8
9
|
import { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';
|
|
9
|
-
import { darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';
|
|
10
|
+
import { asCssVariable, darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';
|
|
11
|
+
import { InlineCompletionEditorType } from '../../model/provideInlineCompletions.js';
|
|
10
12
|
import { InlineEditTabAction } from './inlineEditsViewInterface.js';
|
|
11
13
|
export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(1234, 'Background color for the original text in inline edits.'), true);
|
|
12
14
|
export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(1235, 'Background color for the modified text in inline edits.'), true);
|
|
@@ -82,6 +84,23 @@ export function getEditorBlendedColor(colorIdentifier, themeService) {
|
|
|
82
84
|
const backgroundColor = observeColor(editorBackground, themeService);
|
|
83
85
|
return color.map((c, reader) => /** @description makeOpaque */ c.makeOpaque(backgroundColor.read(reader)));
|
|
84
86
|
}
|
|
87
|
+
export function getEditorBackgroundColor(editorType) {
|
|
88
|
+
let color;
|
|
89
|
+
switch (editorType) {
|
|
90
|
+
case InlineCompletionEditorType.TextEditor:
|
|
91
|
+
color = editorBackground;
|
|
92
|
+
break;
|
|
93
|
+
case InlineCompletionEditorType.DiffEditor:
|
|
94
|
+
color = editorBackground;
|
|
95
|
+
break;
|
|
96
|
+
case InlineCompletionEditorType.Notebook:
|
|
97
|
+
color = 'notebook.cellEditorBackground';
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
assertNever(editorType, 'Not supported editor type yet');
|
|
101
|
+
}
|
|
102
|
+
return asCssVariable(color);
|
|
103
|
+
}
|
|
85
104
|
export function observeColor(colorIdentifier, themeService) {
|
|
86
105
|
return observableFromEventOpts({
|
|
87
106
|
owner: { observeColor: colorIdentifier },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAG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AAS;AACT,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,CAAC,wBAAwB","file":"theme.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 { Color } from '../../../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../../../base/common/errors.js';\nimport { IObservable, observableFromEventOpts } from '../../../../../../base/common/observable.js';\nimport { localize } from '../../../../../../nls.js';\nimport { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';\nimport { ColorIdentifier, darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../platform/theme/common/themeService.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport const originalBackgroundColor = registerColor(\n\t'inlineEdit.originalBackground',\n\ttransparent(diffRemoved, 0.2),\n\tlocalize('inlineEdit.originalBackground', 'Background color for the original text in inline edits.'),\n\ttrue\n);\nexport const modifiedBackgroundColor = registerColor(\n\t'inlineEdit.modifiedBackground',\n\ttransparent(diffInserted, 0.3),\n\tlocalize('inlineEdit.modifiedBackground', 'Background color for the modified text in inline edits.'),\n\ttrue\n);\n\nexport const originalChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.originalChangedLineBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedLineBackground', 'Background color for the changed lines in the original text of inline edits.'),\n\ttrue\n);\n\nexport const originalChangedTextOverlayColor = registerColor(\n\t'inlineEdit.originalChangedTextBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedTextBackground', 'Overlay color for the changed text in the original text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.modifiedChangedLineBackground',\n\t{\n\t\tlight: transparent(diffInsertedLine, 0.7),\n\t\tdark: transparent(diffInsertedLine, 0.7),\n\t\thcDark: diffInsertedLine,\n\t\thcLight: diffInsertedLine\n\t},\n\tlocalize('inlineEdit.modifiedChangedLineBackground', 'Background color for the changed lines in the modified text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedTextOverlayColor = registerColor(\n\t'inlineEdit.modifiedChangedTextBackground',\n\ttransparent(diffInserted, 0.7),\n\tlocalize('inlineEdit.modifiedChangedTextBackground', 'Overlay color for the changed text in the modified text of inline edits.'),\n\ttrue\n);\n\n// ------- GUTTER INDICATOR -------\n\nexport const inlineEditIndicatorPrimaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.primaryForeground', 'Foreground color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.primaryBorder', 'Border color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBackground',\n\t{\n\t\tlight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t\tdark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t},\n\tlocalize('inlineEdit.gutterIndicator.primaryBackground', 'Background color for the primary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSecondaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryForeground',\n\tbuttonSecondaryForeground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryForeground', 'Foreground color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBorder',\n\tbuttonSecondaryBackground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBorder', 'Border color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBackground',\n\tinlineEditIndicatorSecondaryBorder,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBackground', 'Background color for the secondary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSuccessfulForeground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.successfulForeground', 'Foreground color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSuccessfulBorder = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.successfulBorder', 'Border color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSuccessfulBackground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBackground',\n\tinlineEditIndicatorSuccessfulBorder,\n\tlocalize('inlineEdit.gutterIndicator.successfulBackground', 'Background color for the successful inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorBackground = registerColor(\n\t'inlineEdit.gutterIndicator.background',\n\t{\n\t\thcDark: transparent('tab.inactiveBackground', 0.5),\n\t\thcLight: transparent('tab.inactiveBackground', 0.5),\n\t\tdark: transparent('tab.inactiveBackground', 0.5),\n\t\tlight: '#5f5f5f18',\n\t},\n\tlocalize('inlineEdit.gutterIndicator.background', 'Background color for the inline edit gutter indicator.')\n);\n\n// ------- BORDER COLORS -------\n\nconst originalBorder = registerColor(\n\t'inlineEdit.originalBorder',\n\t{\n\t\tlight: diffRemoved,\n\t\tdark: diffRemoved,\n\t\thcDark: diffRemoved,\n\t\thcLight: diffRemoved\n\t},\n\tlocalize('inlineEdit.originalBorder', 'Border color for the original text in inline edits.')\n);\n\nconst modifiedBorder = registerColor(\n\t'inlineEdit.modifiedBorder',\n\t{\n\t\tlight: darken(diffInserted, 0.6),\n\t\tdark: diffInserted,\n\t\thcDark: diffInserted,\n\t\thcLight: diffInserted\n\t},\n\tlocalize('inlineEdit.modifiedBorder', 'Border color for the modified text in inline edits.')\n);\n\nconst tabWillAcceptModifiedBorder = registerColor(\n\t'inlineEdit.tabWillAcceptModifiedBorder',\n\t{\n\t\tlight: darken(modifiedBorder, 0),\n\t\tdark: darken(modifiedBorder, 0),\n\t\thcDark: darken(modifiedBorder, 0),\n\t\thcLight: darken(modifiedBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptModifiedBorder', 'Modified border color for the inline edits widget when tab will accept it.')\n);\n\nconst tabWillAcceptOriginalBorder = registerColor(\n\t'inlineEdit.tabWillAcceptOriginalBorder',\n\t{\n\t\tlight: darken(originalBorder, 0),\n\t\tdark: darken(originalBorder, 0),\n\t\thcDark: darken(originalBorder, 0),\n\t\thcLight: darken(originalBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptOriginalBorder', 'Original border color for the inline edits widget over the original text when tab will accept it.')\n);\n\nexport function getModifiedBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);\n}\n\nexport function getOriginalBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptOriginalBorder : originalBorder);\n}\n\nexport function getEditorBlendedColor(colorIdentifier: ColorIdentifier | IObservable<ColorIdentifier>, themeService: IThemeService): IObservable<Color> {\n\tlet color: IObservable<Color>;\n\tif (typeof colorIdentifier === 'string') {\n\t\tcolor = observeColor(colorIdentifier, themeService);\n\t} else {\n\t\tcolor = colorIdentifier.map((identifier, reader) => observeColor(identifier, themeService).read(reader));\n\t}\n\n\tconst backgroundColor = observeColor(editorBackground, themeService);\n\n\treturn color.map((c, reader) => /** @description makeOpaque */ c.makeOpaque(backgroundColor.read(reader)));\n}\n\nexport function observeColor(colorIdentifier: ColorIdentifier, themeService: IThemeService): IObservable<Color> {\n\treturn observableFromEventOpts(\n\t\t{\n\t\t\towner: { observeColor: colorIdentifier },\n\t\t\tequalsFn: (a: Color, b: Color) => a.equals(b),\n\t\t\tdebugName: () => `observeColor(${colorIdentifier})`\n\t\t},\n\t\tthemeService.onDidColorThemeChange,\n\t\t() => {\n\t\t\tconst color = themeService.getColorTheme().getColor(colorIdentifier);\n\t\t\tif (!color) {\n\t\t\t\tthrow new BugIndicatingError(`Missing color: ${colorIdentifier}`);\n\t\t\t}\n\t\t\treturn color;\n\t\t}\n\t);\n}\n\n// Styles\nexport const INLINE_EDITS_BORDER_RADIUS = 3; // also used in CSS file\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAe,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AACnO,OAAO,EAAE,aAAa,EAAmB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAC;AAE3I,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,uBAAuB,GAA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AAM,0BAA0B,GAAG,CAAC,CAAC,CAAC,wBAAwB","file":"theme.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 { assertNever } from '../../../../../../base/common/assert.js';\nimport { Color } from '../../../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../../../base/common/errors.js';\nimport { IObservable, observableFromEventOpts } from '../../../../../../base/common/observable.js';\nimport { localize } from '../../../../../../nls.js';\nimport { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';\nimport { asCssVariable, ColorIdentifier, darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../platform/theme/common/themeService.js';\nimport { InlineCompletionEditorType } from '../../model/provideInlineCompletions.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport const originalBackgroundColor = registerColor(\n\t'inlineEdit.originalBackground',\n\ttransparent(diffRemoved, 0.2),\n\tlocalize('inlineEdit.originalBackground', 'Background color for the original text in inline edits.'),\n\ttrue\n);\nexport const modifiedBackgroundColor = registerColor(\n\t'inlineEdit.modifiedBackground',\n\ttransparent(diffInserted, 0.3),\n\tlocalize('inlineEdit.modifiedBackground', 'Background color for the modified text in inline edits.'),\n\ttrue\n);\n\nexport const originalChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.originalChangedLineBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedLineBackground', 'Background color for the changed lines in the original text of inline edits.'),\n\ttrue\n);\n\nexport const originalChangedTextOverlayColor = registerColor(\n\t'inlineEdit.originalChangedTextBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedTextBackground', 'Overlay color for the changed text in the original text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.modifiedChangedLineBackground',\n\t{\n\t\tlight: transparent(diffInsertedLine, 0.7),\n\t\tdark: transparent(diffInsertedLine, 0.7),\n\t\thcDark: diffInsertedLine,\n\t\thcLight: diffInsertedLine\n\t},\n\tlocalize('inlineEdit.modifiedChangedLineBackground', 'Background color for the changed lines in the modified text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedTextOverlayColor = registerColor(\n\t'inlineEdit.modifiedChangedTextBackground',\n\ttransparent(diffInserted, 0.7),\n\tlocalize('inlineEdit.modifiedChangedTextBackground', 'Overlay color for the changed text in the modified text of inline edits.'),\n\ttrue\n);\n\n// ------- GUTTER INDICATOR -------\n\nexport const inlineEditIndicatorPrimaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.primaryForeground', 'Foreground color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.primaryBorder', 'Border color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBackground',\n\t{\n\t\tlight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t\tdark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t},\n\tlocalize('inlineEdit.gutterIndicator.primaryBackground', 'Background color for the primary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSecondaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryForeground',\n\tbuttonSecondaryForeground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryForeground', 'Foreground color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBorder',\n\tbuttonSecondaryBackground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBorder', 'Border color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBackground',\n\tinlineEditIndicatorSecondaryBorder,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBackground', 'Background color for the secondary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSuccessfulForeground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.successfulForeground', 'Foreground color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSuccessfulBorder = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.successfulBorder', 'Border color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSuccessfulBackground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBackground',\n\tinlineEditIndicatorSuccessfulBorder,\n\tlocalize('inlineEdit.gutterIndicator.successfulBackground', 'Background color for the successful inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorBackground = registerColor(\n\t'inlineEdit.gutterIndicator.background',\n\t{\n\t\thcDark: transparent('tab.inactiveBackground', 0.5),\n\t\thcLight: transparent('tab.inactiveBackground', 0.5),\n\t\tdark: transparent('tab.inactiveBackground', 0.5),\n\t\tlight: '#5f5f5f18',\n\t},\n\tlocalize('inlineEdit.gutterIndicator.background', 'Background color for the inline edit gutter indicator.')\n);\n\n// ------- BORDER COLORS -------\n\nconst originalBorder = registerColor(\n\t'inlineEdit.originalBorder',\n\t{\n\t\tlight: diffRemoved,\n\t\tdark: diffRemoved,\n\t\thcDark: diffRemoved,\n\t\thcLight: diffRemoved\n\t},\n\tlocalize('inlineEdit.originalBorder', 'Border color for the original text in inline edits.')\n);\n\nconst modifiedBorder = registerColor(\n\t'inlineEdit.modifiedBorder',\n\t{\n\t\tlight: darken(diffInserted, 0.6),\n\t\tdark: diffInserted,\n\t\thcDark: diffInserted,\n\t\thcLight: diffInserted\n\t},\n\tlocalize('inlineEdit.modifiedBorder', 'Border color for the modified text in inline edits.')\n);\n\nconst tabWillAcceptModifiedBorder = registerColor(\n\t'inlineEdit.tabWillAcceptModifiedBorder',\n\t{\n\t\tlight: darken(modifiedBorder, 0),\n\t\tdark: darken(modifiedBorder, 0),\n\t\thcDark: darken(modifiedBorder, 0),\n\t\thcLight: darken(modifiedBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptModifiedBorder', 'Modified border color for the inline edits widget when tab will accept it.')\n);\n\nconst tabWillAcceptOriginalBorder = registerColor(\n\t'inlineEdit.tabWillAcceptOriginalBorder',\n\t{\n\t\tlight: darken(originalBorder, 0),\n\t\tdark: darken(originalBorder, 0),\n\t\thcDark: darken(originalBorder, 0),\n\t\thcLight: darken(originalBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptOriginalBorder', 'Original border color for the inline edits widget over the original text when tab will accept it.')\n);\n\nexport function getModifiedBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);\n}\n\nexport function getOriginalBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptOriginalBorder : originalBorder);\n}\n\nexport function getEditorBlendedColor(colorIdentifier: ColorIdentifier | IObservable<ColorIdentifier>, themeService: IThemeService): IObservable<Color> {\n\tlet color: IObservable<Color>;\n\tif (typeof colorIdentifier === 'string') {\n\t\tcolor = observeColor(colorIdentifier, themeService);\n\t} else {\n\t\tcolor = colorIdentifier.map((identifier, reader) => observeColor(identifier, themeService).read(reader));\n\t}\n\n\tconst backgroundColor = observeColor(editorBackground, themeService);\n\n\treturn color.map((c, reader) => /** @description makeOpaque */ c.makeOpaque(backgroundColor.read(reader)));\n}\n\nexport function getEditorBackgroundColor(editorType: InlineCompletionEditorType): string {\n\tlet color;\n\tswitch (editorType) {\n\t\tcase InlineCompletionEditorType.TextEditor:\n\t\t\tcolor = editorBackground; break;\n\t\tcase InlineCompletionEditorType.DiffEditor:\n\t\t\tcolor = editorBackground; break;\n\t\tcase InlineCompletionEditorType.Notebook:\n\t\t\tcolor = 'notebook.cellEditorBackground'; break;\n\t\tdefault:\n\t\t\tassertNever(editorType, 'Not supported editor type yet');\n\t}\n\treturn asCssVariable(color);\n}\n\n\nexport function observeColor(colorIdentifier: ColorIdentifier, themeService: IThemeService): IObservable<Color> {\n\treturn observableFromEventOpts(\n\t\t{\n\t\t\towner: { observeColor: colorIdentifier },\n\t\t\tequalsFn: (a: Color, b: Color) => a.equals(b),\n\t\t\tdebugName: () => `observeColor(${colorIdentifier})`\n\t\t},\n\t\tthemeService.onDidColorThemeChange,\n\t\t() => {\n\t\t\tconst color = themeService.getColorTheme().getColor(colorIdentifier);\n\t\t\tif (!color) {\n\t\t\t\tthrow new BugIndicatingError(`Missing color: ${colorIdentifier}`);\n\t\t\t}\n\t\t\treturn color;\n\t\t}\n\t);\n}\n\n// Styles\nexport const INLINE_EDITS_BORDER_RADIUS = 3; // also used in CSS file\n"]}
|
|
@@ -13,7 +13,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
import * as dom from '../../../base/browser/dom.js';
|
|
15
15
|
import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';
|
|
16
|
-
import { Toggle } from '../../../base/browser/ui/toggle/toggle.js';
|
|
17
16
|
import { equals } from '../../../base/common/arrays.js';
|
|
18
17
|
import { TimeoutTimer } from '../../../base/common/async.js';
|
|
19
18
|
import { Codicon } from '../../../base/common/codicons.js';
|
|
@@ -51,7 +50,6 @@ export class QuickInput extends Disposable {
|
|
|
51
50
|
super();
|
|
52
51
|
this.ui = ui;
|
|
53
52
|
this._visible = observableValue('visible', false);
|
|
54
|
-
this._widgetUpdated = false;
|
|
55
53
|
this._enabled = true;
|
|
56
54
|
this._busy = false;
|
|
57
55
|
this._ignoreFocusOut = false;
|
|
@@ -60,8 +58,6 @@ export class QuickInput extends Disposable {
|
|
|
60
58
|
this._inlineButtons = [];
|
|
61
59
|
this._inputButtons = [];
|
|
62
60
|
this.buttonsUpdated = false;
|
|
63
|
-
this._toggles = [];
|
|
64
|
-
this.togglesUpdated = false;
|
|
65
61
|
this.noValidationMessage = QuickInput.noPromptMessage;
|
|
66
62
|
this._severity = Severity.Ignore;
|
|
67
63
|
this.onDidTriggerButtonEmitter = this._register(new Emitter());
|
|
@@ -177,14 +173,6 @@ export class QuickInput extends Disposable {
|
|
|
177
173
|
this.buttonsUpdated = true;
|
|
178
174
|
this.update();
|
|
179
175
|
}
|
|
180
|
-
get toggles() {
|
|
181
|
-
return this._toggles;
|
|
182
|
-
}
|
|
183
|
-
set toggles(toggles) {
|
|
184
|
-
this._toggles = toggles ?? [];
|
|
185
|
-
this.togglesUpdated = true;
|
|
186
|
-
this.update();
|
|
187
|
-
}
|
|
188
176
|
get validationMessage() {
|
|
189
177
|
return this._validationMessage;
|
|
190
178
|
}
|
|
@@ -220,11 +208,6 @@ export class QuickInput extends Disposable {
|
|
|
220
208
|
// rerender them.
|
|
221
209
|
this.buttonsUpdated = true;
|
|
222
210
|
}
|
|
223
|
-
if (this.toggles.length) {
|
|
224
|
-
// if there are toggles, the ui.show() clears them out of the UI so we should
|
|
225
|
-
// rerender them.
|
|
226
|
-
this.togglesUpdated = true;
|
|
227
|
-
}
|
|
228
211
|
this.update();
|
|
229
212
|
}
|
|
230
213
|
hide() {
|
|
@@ -259,15 +242,6 @@ export class QuickInput extends Disposable {
|
|
|
259
242
|
if (this.ui.description2.textContent !== description) {
|
|
260
243
|
this.ui.description2.textContent = description;
|
|
261
244
|
}
|
|
262
|
-
if (this._widgetUpdated) {
|
|
263
|
-
this._widgetUpdated = false;
|
|
264
|
-
if (this._widget) {
|
|
265
|
-
dom.reset(this.ui.widget, this._widget);
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
dom.reset(this.ui.widget);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
245
|
if (this.busy && !this.busyDelay) {
|
|
272
246
|
this.busyDelay = new TimeoutTimer();
|
|
273
247
|
this.busyDelay.setIfNotSet(() => {
|
|
@@ -297,20 +271,12 @@ export class QuickInput extends Disposable {
|
|
|
297
271
|
const inlineButtons = this._inlineButtons
|
|
298
272
|
.map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button)));
|
|
299
273
|
this.ui.inlineActionBar.push(inlineButtons, { icon: true, label: false });
|
|
274
|
+
// Adjust count badge position based on input buttons (each button/toggle is ~22px wide)
|
|
275
|
+
const inputButtonOffset = this._inputButtons.length * 22;
|
|
276
|
+
this.ui.countContainer.style.right = inputButtonOffset > 0 ? `${4 + inputButtonOffset}px` : '4px';
|
|
300
277
|
this.ui.inputBox.actions = this._inputButtons
|
|
301
278
|
.map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button)));
|
|
302
279
|
}
|
|
303
|
-
if (this.togglesUpdated) {
|
|
304
|
-
this.togglesUpdated = false;
|
|
305
|
-
// HACK: Filter out toggles here that are not concrete Toggle objects. This is to workaround
|
|
306
|
-
// a layering issue as quick input's interface is in common but Toggle is in browser and
|
|
307
|
-
// it requires a HTMLElement on its interface
|
|
308
|
-
const concreteToggles = this.toggles?.filter(opts => opts instanceof Toggle) ?? [];
|
|
309
|
-
this.ui.inputBox.toggles = concreteToggles;
|
|
310
|
-
// Adjust count badge position based on number of toggles (each toggle is ~22px wide)
|
|
311
|
-
const toggleOffset = concreteToggles.length * 22;
|
|
312
|
-
this.ui.countContainer.style.right = toggleOffset > 0 ? `${4 + toggleOffset}px` : '4px';
|
|
313
|
-
}
|
|
314
280
|
this.ui.ignoreFocusOut = this.ignoreFocusOut;
|
|
315
281
|
this.ui.setEnabled(this.enabled);
|
|
316
282
|
this.ui.setContextKey(this.contextKey);
|