feat(quick-chat): Add one-click button to insert code snippet
Description
Adds a button to quick chat that allows users to quickly insert code snippets.
Known issues: Selecting and inserting code while Quick Chat is open can cause the focus / scroll to jump around the page more than expected. This is due to an issue in VSCode itself. More info here: #1696 (comment 2254744757) and on !2195 (merged).
Related Issues
How has this been tested?
- Check out this branch & run the test extension host.
- Select some code.
- Open Quick Chat (Option + C) or (Command + Shift + P --> GitLab Duo Chat: Open Quick Chat)
- Write "refactor this code" and hit enter.
- Wait for the response to complete, and find a code block.
- Select the "Insert Snippet" link above the code block.
Screenshots (if appropriate)
What CHANGELOG entry will this MR create?
-
fix:
Bug fix fixes - a user-facing issue in production - included in changelog -
feature:
New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:
(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes
Edited by Tristan Read