microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
309 stars 28 forks source link

Selective Code Insertion in Chat Dialog #1316

Open GregorBiswanger opened 2 months ago

GregorBiswanger commented 2 months ago

When suggesting source code in the chat dialog, I want to be able to mark only specific parts of the suggested code and insert them at the current cursor position in the source code. However, currently, the entire generated code block is being inserted.

Steps to Reproduce

  1. Open the chat dialog in Visual Studio Code.
  2. Request a code suggestion from GitHub Copilot.
  3. Highlight a specific portion of the suggested code.
  4. Click the button to insert the code at the current cursor position in the source file.

Expected Behavior

Only the highlighted portion of the suggested code should be inserted at the current cursor position in the source file.

Actual Behavior

The entire generated code block is inserted instead of just the highlighted portion.

Environment

Additional Information

Screenshot / Video

19-06-2024_11-06-07

roblourens commented 2 months ago

Copy/pasting the selection should also work

GregorBiswanger commented 2 months ago

It's about the flow of just being able to click on the button because the cursor is in exactly the right place.