diff --git a/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts index d1e6cbd300450..2d39e288ecc7c 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts @@ -56,7 +56,8 @@ export class InlineCompletionsModel extends Disposable { private readonly _editorObs = observableCodeEditor(this._editor); private readonly _acceptCompletionDecorationTimer = this._register(new MutableDisposable()); - private readonly _acceptCompletionDecoration: IModelDecorationOptions = { + private readonly _acceptCompletionDecorationCollection = this._editor.createDecorationsCollection(); + private readonly _acceptCompletionDecorationOptions: IModelDecorationOptions = { description: 'inline-completion-accepted', className: 'inline-completion-accepted', stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges @@ -581,8 +582,6 @@ export class InlineCompletionsModel extends Disposable { completion.source.addRef(); } - this._acceptCompletionDecorationTimer.clear(); - editor.pushUndoStop(); if (completion.snippetInfo) { editor.executeEdits( @@ -605,8 +604,8 @@ export class InlineCompletionsModel extends Disposable { editor.setSelections(selections, 'inlineCompletionAccept'); if (state.kind === 'inlineEdit') { - const acceptEditsDecorations = editor.createDecorationsCollection(modifiedRanges.map(r => ({ range: r, options: this._acceptCompletionDecoration }))); - this._acceptCompletionDecorationTimer.value = disposableTimeout(() => acceptEditsDecorations.clear(), 2500); + this._acceptCompletionDecorationCollection.set(modifiedRanges.map(r => ({ range: r, options: this._acceptCompletionDecorationOptions }))); + this._acceptCompletionDecorationTimer.value = disposableTimeout(() => this._acceptCompletionDecorationCollection.clear(), 2500); } } diff --git a/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts b/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts index 67c8dfb38fa51..1894f06327bd2 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts @@ -99,12 +99,12 @@ export const modifiedBorder = registerColor( export const acceptedDecorationBackgroundColor = registerColor( 'inlineEdit.acceptedBackground', { - light: transparent(modifiedChangedTextOverlayColor, 0.5), - dark: transparent(modifiedChangedTextOverlayColor, 0.5), + light: transparent(modifiedChangedTextOverlayColor, 0.75), + dark: transparent(modifiedChangedTextOverlayColor, 0.75), hcDark: modifiedChangedTextOverlayColor, hcLight: modifiedChangedTextOverlayColor }, - localize('inlineEdit.acceptedBackground', 'Background color for the accepted text after appying an inline edit.'), + localize('inlineEdit.acceptedBackground', 'Background color for the accepted text after applying an inline edit.'), true );