zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.85k stars 3.06k forks source link

Can't get the inline assist to generate diffs. It generates new code just fine, but whatever phrases I try, it won't generate a diff #19235

Open a-non-a-mouse opened 1 month ago

a-non-a-mouse commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Title. I can't get the inline assist to generate diffs, only new code. I've followed the video on zed.dev's homepage as closely as I can, and tried with and without the assist panel, and various phrases.

Environment

Zed: v0.156.2 (Zed) OS: macOS 15.0.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

https://github.com/user-attachments/assets/b498ea81-fda5-4343-8517-f40d0275f92d

If applicable, attach your Zed.log file to this issue.

Zed.log


notpeter commented 4 weeks ago

You may have better results if you select the entire object as context before opening the inline assist. ctrl-shift-right (editor::SelectLargerSyntaxNode) can make this quick.

a-non-a-mouse commented 3 weeks ago

Thanks. That finally gives me a diff! And going back to the video on zed.dev, I just noticed that the entire file is selected for a moment; that's easy to miss.

I'd suggest that a better experience would be giving the AI the context it needs by default. Maybe that context is the entire file if your cursor is on line 1, or the next block following the cursor if it's anywhere else? At least in an opt-in scenario (config flag? /tab in the assist pane?)