-
-
Notifications
You must be signed in to change notification settings - Fork 48
Add diff viewing #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add diff viewing #91
Conversation
| @@ -0,0 +1,14 @@ | |||
| -- Debug helper: Add this to your Neovim config temporarily to see ALL opencode events | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: ignore this file, only for debugging, will be removed
4684c3a to
1c8f8f0
Compare
I didn't test this super extensively, especially with new providers. lmk if you find a cause or fix along the way! |
3001781 to
cafdc6f
Compare
|
Hi, how is this going? |
|
@froats , still in testing mode, i havent had too much chance to work on this. Theres something wrong with opening the current version, treesitter sometimes is not correctly attached. Other than that and some QoL stuff, i have been using it without a problem. Although i dont really use the diff features(accept hunk/reject hunk)that often(hunk definition is not that accurate). Please give it a try if you are interested. It is 80% there. I also just attached a screenshot as well. |
Summary
Add PR-style diff review UI for
opencodechanges.This is my rough draft based on some discussion here. I'll be honest and that the
session_diff.luawas mostly AI coded, but was verified and checked for accuracy.Please pull it if you are interested, its been working well for me so far
Screenshots
Key Points
message.updatedevent (contains only current cycle diffs, unlikesession.diffwhichaccumulates everything) for capturing the
before, andafterfor only files touched in the current cycle.vim.diff()unified viewpr reviewstyle enhanced diff view that works withhunk stagingnote:
DiffView.nvimsadly does not really support what we want, since it only works with git rev not local temp files(we are not usinggit, we dont get much fromDiffView.nvimother than the nice UIScreenshot of enhanced diff
Files
lua/opencode/diff.lua- Core review logicplugin/events/session_diff.lua- Event listenerDIFF_FEATURE.md- Full documentationTODOs
planmode should show diff but non-editableBugs
Nice to have?