Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Not relevant <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.87.2 OS Version: MacOS Sonoma 14.3 (23D56) Steps to Reproduce: Use word-by-word/line-by-line accepts for an . I re-serve the same completion from cache after word-by-word accepts (with already accepted text filtered out). The completion suggestion flashes even though the ghost text did not change. This did not use to happen on VSCode 1.86 (downgraded and tested with the same VSIX). Example of text flashing on VSCode 1.87 gif: ! mov:
Can you give me reproduction steps? Cannot reproduce with copilot. Would be awesome if it reproduces .
Yeah let me try to figure this out and see if I can reproduce it with this! Unfortunately I wasn't able to reproduce it for CoPilot too, but with my organization's extension the behaviour changed after 1.87. The expected implementation for word-by-word/line-by-line completion is to re-serve the text from the old completion (with matching prefix removed) as a new right? Thanks for your help!
Yes
I created a mock example where I can still reproduce this on 1.87, and confirm that the text does not flash on 1.86. Still trying to investigate further if there's any link with other extensions or anything that could conflict, but a bit perplexed since it's very much reproducible with 1.87
On another interesting note, if I replace the full line (i.e including the prefix in the suggestion), it does not flash. Maybe it's not reproducible with CoPilot if that's the approach they're taking?
Can you translate this example into a ? That way, if it is really a bug, it will significantly reduce the time I need to fix this (and for other team members to verify a bug-fix).
here's a repro on . If you type and then select code word-by-word, the text flashes. On this doesn't occur. I can repro the bug on 0.47.0 too. Hope this helps! Edit: Looks like it broke between v0.46.0-dev- and v0.46.0-dev-

Discussion:
editor.executeEdits( 'inlineSuggestion.accept', [ <del> EditOperation.replaceMove(completion.range, ''), </del> <ins> EditOperation.replace(completion.range, ''), </ins> ...completion.additionalTextEdits ] );

const edits = state.edits; const selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p)); editor.executeEdits('inlineSuggestion.accept', [ <del> ...edits.map(edit => EditOperation.replaceMove(edit.range, edit.text)), </del> <ins> ...edits.map(edit => EditOperation.replace(edit.range, edit.text)), </ins> ...completion.additionalTextEdits ]); editor.setSelections(selections, 'inlineCompletionAccept');

const primaryEdit = new SingleTextEdit(replaceRange, newText); const edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)]; const selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p)); <del> editor.executeEdits('inlineSuggestion.accept', edits.map(edit => EditOperation.replaceMove(edit.range, edit.text))); </del> <ins> editor.executeEdits('inlineSuggestion.accept', edits.map(edit => EditOperation.replace(edit.range, edit.text))); </ins> editor.setSelections(selections, 'inlineCompletionPartialAccept'); } finally { this._isAcceptingPartially = false;