Add open files to chat (cmd+L)

Hello,

Lets say I have 5 files open and I do cmd+L for some AI chat.

The AI has the context of the one file that I am working in but not the 4 others.

I can add by @ mentioning, but is there a way I can do something like @open-files??

5 Likes

Strangely, there is still no function like that. Sometimes I use Composer to have the possibility to discuss all open files, but Composer is not for discussingā€¦

Please devs consider implementing I donā€™t think itā€™s too difficult. Iā€™d prefer to add all files from context every time I open a chat by defaultā€¦ Or at least an easy option to add them would be great.

2 Likes

I actually just figured out a way to do something like this.

  1. Make sure you have the file explorer pane open on the left with the ā€œOpen Editorsā€ section open, and the chat pane open on the right.
  2. In the Open Editors pane, select the files you want to reference. You can click the first one and then shift-click the last one to select them all, or select them individually by Ctrl-clicking on Windows or Command-clicking on Mac.
  3. Drag them over to the chat pane.

Having a one-button shortcut to do this would be great, but this gets the job done for now.

3 Likes

Similar and related posts for reference:

2 Likes

Dragging from file explorer doesnā€™t work if itā€™s a ā€œWorking Treeā€ type of editor (with diff).

Mentioning all open editors is now possible with / and ā€œReference open editorsā€ in both chat and Composer.

One small issue: if there is text already present in the input field, pressing / does nothing

4 Likes

perfect, thanks!

@chuckblake ,

friendly fyi, looks like there might be a bug with this feature at the moment: