@@ -140,6 +140,9 @@ export class DiffModel {
140
140
*/
141
141
public parseDiff ( pathToDiff : string , pathToWorkspace : string ) : ProposedChangeNode [ ] {
142
142
const diffContents = fs . readFileSync ( pathToDiff , 'utf8' )
143
+ if ( ! diffContents ) {
144
+ throw new ToolkitError ( 'diff.patch file is empty' , { code : 'EmptyDiffPatch' } )
145
+ }
143
146
const changedFiles = parsePatch ( diffContents )
144
147
// path to the directory containing copy of the changed files in the transformed project
145
148
const pathToTmpSrcDir = this . copyProject ( pathToWorkspace , changedFiles )
@@ -361,6 +364,19 @@ export class ProposedTransformationExplorer {
361
364
transformByQState . setSummaryFilePath (
362
365
path . join ( pathContainingArchive , ExportResultArchiveStructure . PathToSummary )
363
366
)
367
+ transformByQState . setResultArchiveFilePath ( pathContainingArchive )
368
+ await vscode . commands . executeCommand ( 'setContext' , 'gumby.isSummaryAvailable' , true )
369
+
370
+ // This metric is only emitted when placed before showInformationMessage
371
+ telemetry . codeTransform_vcsDiffViewerVisible . emit ( {
372
+ codeTransformSessionId : codeTransformTelemetryState . getSessionId ( ) ,
373
+ codeTransformJobId : transformByQState . getJobId ( ) ,
374
+ result : MetadataResult . Pass ,
375
+ } )
376
+
377
+ // Do not await this so that the summary reveals without user needing to close this notification
378
+ void vscode . window . showInformationMessage ( CodeWhispererConstants . viewProposedChangesMessage )
379
+ await vscode . commands . executeCommand ( 'aws.amazonq.transformationHub.summary.reveal' )
364
380
} catch ( e : any ) {
365
381
deserializeErrorMessage =
366
382
( e as Error ) . message ??
@@ -378,19 +394,6 @@ export class ProposedTransformationExplorer {
378
394
reason : deserializeErrorMessage ? 'DeserializationFailed' : undefined ,
379
395
} )
380
396
}
381
-
382
- transformByQState . setResultArchiveFilePath ( pathContainingArchive )
383
-
384
- // This metric is only emitted when placed before showInformationMessage
385
- telemetry . codeTransform_vcsDiffViewerVisible . emit ( {
386
- codeTransformSessionId : codeTransformTelemetryState . getSessionId ( ) ,
387
- codeTransformJobId : transformByQState . getJobId ( ) ,
388
- result : MetadataResult . Pass ,
389
- } )
390
-
391
- // Do not await this so that the summary reveals without user needing to close this notification
392
- void vscode . window . showInformationMessage ( CodeWhispererConstants . viewProposedChangesMessage )
393
- await vscode . commands . executeCommand ( 'aws.amazonq.transformationHub.summary.reveal' )
394
397
} )
395
398
396
399
vscode . commands . registerCommand ( 'aws.amazonq.transformationHub.reviewChanges.acceptChanges' , async ( ) => {
0 commit comments