Skip to content

Commit 05d7054

Browse files
ctiddC Tidd
andauthored
fix(amazonq): Skip including deleted files for FeatureDev context. (#5228)
Co-authored-by: C Tidd <[email protected]>
1 parent ba6ab38 commit 05d7054

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
@@ -189,8 +189,12 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
189189

190190
createTemporaryZipFileAsync { zipOutput ->
191191
filesToIncludeFlow.collect { file ->
192-
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
193-
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
192+
try {
193+
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
194+
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
195+
} catch (e: NoSuchFileException) {
196+
// Noop: Skip if file was deleted
197+
}
194198
}
195199
}
196200
}.toFile()

0 commit comments

Comments
 (0)