Skip to content

Commit d60af22

Browse files
committed
fix: use updated content
1 parent d838201 commit d60af22

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/core/src/codewhisperer/util/zipUtil.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,20 @@ export class ZipUtil {
449449
}
450450

451451
if (ZipConstants.knownBinaryFileExts.includes(fileExtension)) {
452+
if (useCase === FeatureUseCase.TEST_GENERATION) {
453+
continue
454+
}
455+
452456
zip.writeFile(file.fileUri.fsPath, path.dirname(zipEntryPath))
453457
} else {
454458
// TODO: verify if this is needed
455-
// const isFileOpenAndDirty = this.isFileOpenAndDirty(file.fileUri)
456-
// const fileContent = isFileOpenAndDirty ? await this.getTextContent(file.fileUri) : file.fileContent
457-
// const fileSize = Buffer.from(fileContent).length
459+
const isFileOpenAndDirty = this.isFileOpenAndDirty(file.fileUri)
460+
const fileContent = isFileOpenAndDirty ? await this.getTextContent(file.fileUri) : file.fileContent
458461

459-
this._totalLines += file.fileContent.split(ZipConstants.newlineRegex).length
462+
this._totalLines += fileContent.split(ZipConstants.newlineRegex).length
460463

461464
this.incrementCountForLanguage(file.fileUri, languageCount)
462-
zip.writeString(file.fileContent, zipEntryPath)
465+
zip.writeString(fileContent, zipEntryPath)
463466
}
464467

465468
this._pickedSourceFiles.add(file.fileUri.fsPath)

0 commit comments

Comments
 (0)