Skip to content

Commit 7e3d48e

Browse files
author
C Tidd
committed
fix(amazonq): Normalize generated file paths in feature dev.
1 parent 91d5a0c commit 7e3d48e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Amazon Q /dev: Fix error when accepting changes if leading slash is present."
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/CodeGenerationState.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private suspend fun CodeGenerationState.generateCode(
258258
fun registerNewFiles(newFileContents: Map<String, String>): List<NewFileZipInfo> =
259259
newFileContents.map {
260260
NewFileZipInfo(
261-
zipFilePath = it.key,
261+
zipFilePath = it.key.removePrefix("/"),
262262
fileContent = it.value,
263263
rejected = false,
264264
changeApplied = false
@@ -268,7 +268,7 @@ fun registerNewFiles(newFileContents: Map<String, String>): List<NewFileZipInfo>
268268
fun registerDeletedFiles(deletedFiles: List<String>): List<DeletedFileInfo> =
269269
deletedFiles.map {
270270
DeletedFileInfo(
271-
zipFilePath = it,
271+
zipFilePath = it.removePrefix("/"),
272272
rejected = false,
273273
changeApplied = false
274274
)

0 commit comments

Comments
 (0)