[Backport vscode-v1.60.x] feat(auto-edits): fix the suffix duplication on inline accept #6590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
For the
auto-edits
feature, the suffix is duplicated on every inline suffix. This is a regression from the current pre-release, and this is affecting almost every inline completion suggestion spanning multiple lines. This is happening because, for inline completion item acceptance:Linear Issue Link
Before
Suggestion:
<img width="325" alt="image" src="https://github.com/user-attachments/assets/76835430-f6aa-4b03-9407-bce25e28badf" />
On Acceptance:
<img width="312" alt="image" src="https://github.com/user-attachments/assets/1c18168a-dc8f-44af-9c09-5ae8e401e41f" />
After
Replaces the correct suggestion without suffix duplication:
<img width="279" alt="image" src="https://github.com/user-attachments/assets/b8505644-5686-4171-8351-8d054bf0946c" />
Test plan
Inline Examples from the cody-chat-eval repo
Backport e56f4f7 from #6583