aws / aws/aws-toolkit-vscode

Amazon Q / Claude 3.7 creates files with \" and \n instead of quotes, and newlines.

Open
#7,809 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem

When generating code, Amazon Q / Claude 3.7 creates files with \" and \n instead of quotes, and newlines.

## Steps to reproduce the issue

Following PDD document to generate code.

```
}\n \n // Artist\n Text {\n width: parent.width\n text: modelData.artist || \"Unknown Artist\"\n color: \"#CCCCCC\"\n font.pixelSize: window.baseFontSize * 0.9\n elide: Text.ElideRight\n }\n \n // Additional info\n Row {\n spacing: 20 * window.scaleFactor\n \n Text {\n text: modelData.totalTracks + \" tracks\"\n color: \"#AAAAAA\"\n font.pixelSize: window.baseFontSize * 0.8\n }\n \n Text {\n text: modelData.year || \"\"\n color: \"#AAAAAA\"\n font.pixelSize: window.baseFontSize * 0.8\n visible: modelData.year !== \"\"\n }\n \n Text {\n text: modelData.genre || \"\"\n color: \"#AAAAAA\"\n font.pixelSize: window.baseFontSize * 0.8\n visible: modelData.genre !== \"\"\n }\n }\n }\n \n // Source label\n Rectangle {\n id: sourceLabel\n anchors.right: parent.right\n anchors.top: parent.top\n anchors.margins: 10 * window.scaleFactor\n width: 80 * window.scaleFactor\n height: 30 * window.scaleFactor\n color: getSourceColor(modelData.source)\n radius: 4 * window.scaleFactor\n \n Text {\n anchors.centerIn: parent\n text: modelData.source || \"CDDB\"\n color: \"white\"\n font.pixelSize: window.baseFontSize * 0.7\n font.bold: true\n }\n }\n \n MouseArea {\n id: mouseArea\n anchors.fill: parent\n hoverEnabled: true\n onClicked: {\n matchList.currentIndex = index\n root.selectedMatch = modelData\n }\n onDoubleClicked: {\n root.selectedMatch = modelData\n root.accept()\n }\n }\n }\n }\n \n // Preview selected match tracks\n Rectangle {\n width: parent.width\n height: 150 * window.scaleFactor\n color: \"#1A1A1A\"\n border.color: \"#555555\"\n border.width: 1\n radius: 4 * window.scaleFactor\n visible: root.selectedMatch && root.selectedMatch.tracks.length > 0\n \n Column {\n anchors.fill: parent\n anchors.margins: 10 * window.scaleFactor\n \n Text {\n text: \"Track List Preview:\"\n color: \"white\"\n font.pixelSize: window.baseFontSize * 0.9\n font.bold: true\n }\n \n ListView {\n width: parent.width\n height: parent.height - 30 * window.scaleFactor\n \n model: root.selectedMatch ? root.selectedMatch.tracks : []\n \n delegate: Text {\n width: parent.width\n text: modelData.trackNumber + \". \" + (modelData.title || \"Track \" + modelData.trackNumber)\n color: \"#CCCCCC\"\n font.pixelSize: window.baseFontSize * 0.8\n elide: Text.ElideRight\n }\n }\n }\n }\n }\n \n // Dialog buttons\n footer: Row {\n anchors.right: parent.right\n anchors.margins: 20 * window.scaleFactor\n spacing: 20 * window.scaleFactor\n \n Button {\n text: \"Cancel\"\n font.pixelSize: window.baseFontSize\n onClicked: root.reject()\n }\n \n Button {\n text: \"Use CD-Text Only\"\n font.pixelSize: window.baseFontSize\n onClicked: {\n root.selectedMatch = null\n root.accept()\n }\n }\n \n Button {\n text: \"Select\"\n font.pixelSize: window.baseFontSize\n enabled: root.selectedMatch !== null\n onClicked: root.accept()\n }\n }\n \n onAccepted: {\n if (root.selectedMatch) {\n root.matchSelected(root.selectedMatch)\n }\n }\n \n function getSourceColor(source) {\n switch (source) {\n case \"CDDB\":\n return \"#4CAF50\"\n case \"MusicBrainz\":\n return \"#2196F3\"\n case \"CD-Text\":\n return \"#FF9800\"\n default:\n return \"#666666\"\n }\n }\n}
```

When asked to correct the code, Amazon Q doesn't make any changes.

## Expected behavior

Code is generated correctly.

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

OS: Darwin arm64 24.5.0
Visual Studio Code extension host: 1.102.2
Amazon Q: 1.87.0
node: 22.15.1
electron: 35.6.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the generated-file behavior in the VS Code extension using the reported Amazon Q, VS Code, and system versions, then trace the Amazon Q code-generation and correction flow. Done means generated files contain real quotation marks and newlines, and a correction request successfully changes the code.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.