News for hackers. Stuff that matters.
Re:Zed AI by forrestthewoods on Tuesday August 20, 2024 @03:18PM (#41303072)
Hrm. Still not quite what I crave.

Here's roughly what I want. I want to be able to highlight some block of code, ask the AI to modify it in some way, and then I want to see a diff view of before/after that lets me accept or reject changes.

LLMs often get code slightly wrong. That's fine! Doesn't bother me at all. What I need is an interface that allows me to iterate on code AND helps me understand the changes.

As a concrete example I recently used Claude to help me write some Python matplotlib code. It took me roughly a dozen plus iterations. I had to use a separate diff tool so that I could understand what changes were being made. Blindly copy/pasting LLM code is insufficient.

Re:Zed AI by simonw on Tuesday August 20, 2024 @03:40PM (#41303282)
"Here's roughly what I want. I want to be able to highlight some block of code, ask the AI to modify it in some way, and then I want to see a diff view of before/after that lets me accept or reject changes."

That's exactly what this new set of Zed features lets you do.

Here's an animated GIF demo: https://gist.github.com/simonw/520fcd8ad5580e538ad16ed2d8b87...

Re:Zed AI by iamnbutler on Tuesday August 20, 2024 @03:45PM (#41303325)
Hey, this is Nate from Zed. Give the inline assistant a try. Here is a little demo: https://share.cleanshot.com/F2mg2lXy

You can even edit the prompt after the fact if the diff doesn't show what you want and regenerate without having to start all over.

Re:Zed AI by forrestthewoods on Tuesday August 20, 2024 @04:24PM (#41303700)
Ah interesting. I missed that when browsing the page.

Can you make the diff side-by-side? I’ve always hated the “inline” terminal style diff view. My brain just can’t parse it. I need the side-by-side view that lets me see what the actual before/after code is.

Re:Zed AI by iamnbutler on Tuesday August 20, 2024 @04:37PM (#41303810)
Haha I actually agree – I always prefer them side by side.

We don't have side-by-side diffs yet, but once we do I'll make sure it works here :)

Re:Zed AI by rtfeldman on Tuesday August 20, 2024 @03:35PM (#41303229)
> I want to be able to highlight some block of code, ask the AI to modify it in some way, and then I want to see a diff view of before/after that lets me accept or reject changes.

Zed does that - here's a clip of it on some Python code:

https://youtu.be/6OdI6jYpw9M?t=66

Re:Zed AI by brewski on Tuesday August 20, 2024 @03:41PM (#41303292)
Re:Zed AI by garbanz0 on Tuesday August 20, 2024 @03:21PM (#41303095)
FWIW, that's what cursor does: https://www.trycursor.com/
Re:Zed AI by zackproser on Tuesday August 20, 2024 @07:12PM (#41305036)
Excited to try Zed, but FWIW, this is exactly Cursor's default behavior if you use the side chat panel
Re:Zed AI by Terretta on Wednesday August 21, 2024 @10:31AM (#41310688)
> I want to be able to highlight some block of code, ask the AI to modify it in some way, and then I want to see a diff view of before/after that lets me accept or reject changes.

If you squint, that's the same as using an IDE with first class git support and co-editing with a (junior) pair programmer that commits each thing you ask them to do locally, or just saves the file and lets you see stageable diffs you can reject instead of push.

Try the /commit workflow using aider.chat as a REPL in your terminal, with the same git repo open in whatever IDE you like that supports real time git sync.

The REPL talks to you in diffs, and you can undo commits, and of course your IDE shows you any Aider changes the same as it would show you any other devs' changes.

That said, I use Zed and while it doesn't have all the smarts of Aider, its inline integration is fantastic.