We auto-accept the task whenever there is any change within the selectionRange.
This was primarily useful for tracking if the user immediately does "Undo" on a change, so we update the UI and clear out the diff.
With the new inline diff view, doing this means that it's difficult for users' to modify Cody's response. As any change they make immediately removes all deleted lines and hide decorations.
Solution:
Allow making edits within the selection range. We can ensure decorations do not expand so it's still clear exactly what edits Cody made.
Track specifically for the edit being restored back to its original state. This will work to ensure we still capture when a user does an "Undo"
Test plan
Make Edits (Generate, Edit, Test, Fix, Document)
Make changes to the diff
Check everything looks ok
Try to undo some of the changes you made
Check the entire edit is not removed, as we're only undoing additional changes
Undo all the changes made after the edit
Check the entire edit is removed (e.g. codelens, injected whitespace, etc)
Description
closes https://github.com/sourcegraph/cody/issues/4671
https://github.com/sourcegraph/cody/assets/9516420/7d468713-c928-461b-b0f0-192a91560d44
Problem:
selectionRange
.Solution:
Test plan