cody icon indicating copy to clipboard operation
cody copied to clipboard

Edit: Explore using decorations to show diff output, without requiring “Show diff”

Open umpox opened this issue 1 year ago • 2 comments

What:

  • We apply edits by default, but it can be difficult for users to see exactly what has changed.
  • Users rely on the “Show diff” CTA in the codelens to view a full diff of the edit.
  • This is inefficient, ideally we could show the diff output as part of the produced edit.

How:

  • We should use decorations to attempt to show the diff directly in the editor.
  • Insertions are easy, as we can just decorate those characters or lines.
  • Changes/Deletions are tricker. Decorations are only supported on existing lines.
    • Can we inject empty lines and do a line-level diff to do this? When we clear the decorations we can remove these lines.
  • We should also explore other options:
    • Opening the diff view automatically whilst the edit is ongoing
    • Other? Look for prior art on this.

umpox avatar Mar 22 '24 15:03 umpox

Can we inject empty lines and do a line-level diff to do this? When we clear the decorations we can remove these lines.

Would be cool to explore this for sure, my worry is that this messes too much with the undo stack but maybe we can work around this?

philipp-spiess avatar Mar 22 '24 15:03 philipp-spiess

I like how our JetBrains extension shows it (from https://www.loom.com/share/c49dd1f60dcf406a91ddcd3947fc94bf):

image

Even just showing the lines that were added/changed in green would be a nice win.

sqs avatar Apr 29 '24 04:04 sqs

This issue is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.

github-actions[bot] avatar Sep 01 '24 02:09 github-actions[bot]