tomiaa
V2EX  ›  问与答

想问下 cursor 改完代码之后,展示代码变更的差异,手动 点接受拒绝的实现原理是什么?

  •  
  •   tomiaa · Sep 19 · 1273 views
    This topic created in 47 days ago, the information mentioned may be changed or developed.

    最近在用 cursor cli 等各种 agent 工具去修改本地代码文件,在一次对话问答中,AI 改了代码,我想在界面上展示与 cursor 一样的差异,能让用户点接受 或者 拒绝某一块的改动

    实际实现试了很多种方法,都没有达到 cursor 的效果

    多次问答改动之后,在之前的一次提问进行重新编辑发送,可以恢复上一次提问前的改动

    tomchen
    tomchen
    Sep 19
    1
    最简单的,叫 AI 每修改一次都 git commit ,然后就能在 Cursor 等编辑器里面看 diff 、取消部分、全取消了

    之后需要的话再修改 commit history
    xue777hua
    xue777hua
    Sep 20
    2
    - Copy on Write
    - Compare and Swap
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1754 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:00 · PVG 01:00 · LAX 09:00 · JFK 12:00
    ♥ Do have faith in what you're doing.