zed icon indicating copy to clipboard operation
zed copied to clipboard

AI: unable to add selection to context for unsaved/untitled buffers without a filename

Open hmemcpy opened this issue 7 months ago • 1 comments

Summary

I wanted to run a quick AI-assisted fixup for some json. I created a new buffer, pasted the text, manually selected the language to be Json.

I selected the relevant part of the json, and tried to use the AI panel, but it wouldn't add the selection to the context. Only after saving the file I was able to use it (with or without selection)

Description

Steps to trigger the problem:

  1. Create a new untitled buffer
  2. Select some text, try adding it to the AI context via Selection

Actual Behavior: Nothing is added to the AI context

Expected Behavior: Selected text is added to the AI context even for an unsaved buffer without a filename.

Zed Version and System Specs

Zed: v0.187.6 (Zed) OS: Linux Wayland nixos 25.11 Memory: 27.1 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV PHOENIX) || radv || Mesa 25.1.1

hmemcpy avatar May 29 '25 07:05 hmemcpy

I can reproduce. Thanks for reporting. Steps to reproduce:

cmd-n (new buffer) type something: foobar cmd-a (select all) cmd-shift-> (assistant: quote selection) Result: No-op

cmd-s (save) and specify a filename cmd-shift-> Result: Works as expected

notpeter avatar May 29 '25 18:05 notpeter

Closing this as it seems to be fixed/working already!

danilo-leal avatar Nov 10 '25 21:11 danilo-leal