aws / aws/aws-toolkit-vscode

Improve copy + paste formatting for Q responses

Open
#4,991 0 comments 2 reactions 0 assignees View on GitHub
amazon-q bug codewhisperer partner-team
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem

When copying + pasting responses from Q, newlines are added whenever text formatted as `code` (enclosed in backticks) is met.

## Steps to reproduce the issue

1. Ask Q a question. For instance:

> Could you explain the `secretValueFromJson` method offered by the `Secret` construct in CDK?

2. Await for Q's response:

> The `secretValueFromJson` method is part of the `ISecret` interface in the AWS Cloud Development Kit (CDK). [...]

3. Copy + paste the response. The pasted text contains newlines for each time `code` is encountered:

> The
secretValueFromJson
method is part of the
ISecret
interface in the AWS Cloud Development Kit (CDK).

![Screenshot 2024-05-14 at 3 00 45 PM](https://github.com/aws/aws-toolkit-vscode/assets/143357271/72efbdde-8540-485c-a19f-9586f187e5d2)

## Expected behavior

Nicely-formatted text that does not contain the aforementioned newlines:

> The secretValueFromJson method is part of the ISecret interface in the AWS Cloud Development Kit (CDK).

Enclosing any code with backticks would be a plus, but not really necessary.

## System details (run `AWS: About` and/or `Amazon Q: About`)

- OS: macOS 14.4.1 (23E224)
- Visual Studio Code version: 1.89.1 (Universal)
- AWS Toolkit version: N/A
- Amazon Q version: v1.4.0

Contributor guide

Open the contributing guide

Research direction

The issue names no source files or tests. First reproduce the problem by copying an Amazon Q response containing inline code in VS Code, then trace the response rendering and clipboard behavior. Done means pasted inline code no longer introduces line breaks; preserving backticks is optional.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.