Skip to content

Commit a0bc4a1

Browse files
ctiddC Tidd
authored andcommitted
fix(amazonq): Skip including deleted files for FeatureDev context. (aws#5228)
Co-authored-by: C Tidd <[email protected]>
1 parent 74e279f commit a0bc4a1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-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 issue when files are deleted while preparing context"
4+
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/FeatureDevSessionContext.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,12 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
210210

211211
createTemporaryZipFileAsync { zipOutput ->
212212
filesToIncludeFlow.collect { file ->
213-
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
214-
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
213+
try {
214+
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
215+
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
216+
} catch (e: NoSuchFileException) {
217+
// Noop: Skip if file was deleted
218+
}
215219
}
216220
}
217221
}.toFile()

0 commit comments

Comments
 (0)