microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.05k stars 29.22k forks source link

Chat: User can attach an untitled file to chat requests but there's no way for extensions to get the file's contents #233128

Open bwateratmsft opened 18 hours ago

bwateratmsft commented 18 hours ago

Does this issue occur when all extensions are disabled?: N/A

Steps to Reproduce:

  1. Open a new, untitled file--don't save it, but keep it as the focused tab
  2. Initiate a chat request to GitHub Copilot Chat or any participant--the untitled file will be auto-attached
  3. In the code, the participant receives a ChatRequest, including a reference for the untitled file, but there's no way to access its contents--vscode.workspace.fs.readFile() will fail.
bwateratmsft commented 18 hours ago

/cc @isidorn being able to attach an untitled file caused https://github.com/microsoft/GitHub-Copilot-for-Azure/issues/12. We're working on a fix but it's easily worked around.

isidorn commented 4 hours ago

We should support being able to access content from untitled file. Assigning to Ben since he has this item on the plan. fyi @roblourens