Skip to content

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

#1570 (closed)

How has this been tested?

  1. Check out this branch & run the test extension host.
  2. Select some code.
  3. Open Quick Chat (Option + C) or (Command + Shift + P --> GitLab Duo Chat: Open Quick Chat)
  4. Write "refactor this code" and hit enter.
  5. Wait for the response to complete, and find a code block.
  6. Select the "Insert Snippet" link above the code block.

Screenshots (if appropriate)

quick_chat_insert

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

Merge request reports

Loading