[VS Code] Allow inserting a generated code snippet into editor
User problem to solve
As a developer using Duo Chat, I want a seamless way to integrate generated code snippets into my editor without manual copy-pasting, so I can maintain my workflow and focus.
MVC Proposal
- Provide a simple
Insert
button next to each generated code block. -
Insert
button is to the left of theCopy
button. - Insert code block at the current cursor position in the active editor.
- If there is not an active editor when the user clicks Insert, display a tooltip: "No active editor. Open a file to insert code."
-
Insert
button is in a disabled state and grayed out.
-
- If insert is successful, show an in-IDE notification in the bottom right of the editor: "Code inserted successfully"
- If insert is not successful, show an in-IDE notification in the bottom right of the editor: "Failed to insert code. Please try again."
GitLab UI
Edited by Dasha Adushkina