Edit: Explore using decorations to show diff output, without requiring “Show diff”
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.
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?
I like how our JetBrains extension shows it (from https://www.loom.com/share/c49dd1f60dcf406a91ddcd3947fc94bf):
Even just showing the lines that were added/changed in green would be a nice win.
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.