@@ -10,7 +10,13 @@ import { parsePatch, applyPatches, ParsedDiff } from 'diff'
1010import path from 'path'
1111import vscode from 'vscode'
1212import { ExportIntent } from '@amzn/codewhisperer-streaming'
13- import { TransformByQReviewStatus , transformByQState , PatchInfo , DescriptionContent } from '../../models/model'
13+ import {
14+ TransformByQReviewStatus ,
15+ transformByQState ,
16+ PatchInfo ,
17+ DescriptionContent ,
18+ TransformationType ,
19+ } from '../../models/model'
1420import { ExportResultArchiveStructure , downloadExportResultArchive } from '../../../shared/utilities/download'
1521import { getLogger } from '../../../shared/logger'
1622import { telemetry } from '../../../shared/telemetry/telemetry'
@@ -538,38 +544,30 @@ export class ProposedTransformationExplorer {
538544 }
539545
540546 //We do this to ensure that the changesAppliedChatMessage is only sent to user when they accept the first diff.patch
541- if ( transformByQState . getMultipleDiffs ( ) ) {
542- if ( diffModel . currentPatchIndex === patchFiles . length - 1 ) {
543- transformByQState . getChatControllers ( ) ?. transformationFinished . fire ( {
544- message : CodeWhispererConstants . changesAppliedChatMessageMultipleDiffs (
545- diffModel . currentPatchIndex ,
546- patchFiles . length ,
547- patchFilesDescriptions
548- ? patchFilesDescriptions . content [ diffModel . currentPatchIndex ] . name
549- : undefined
550- ) ,
551- tabID : ChatSessionManager . Instance . getSession ( ) . tabID ,
552- includeStartNewTransformationButton : true ,
553- } )
554- } else {
555- transformByQState . getChatControllers ( ) ?. transformationFinished . fire ( {
556- message : CodeWhispererConstants . changesAppliedChatMessageMultipleDiffs (
557- diffModel . currentPatchIndex ,
558- patchFiles . length ,
559- patchFilesDescriptions
560- ? patchFilesDescriptions . content [ diffModel . currentPatchIndex ] . name
561- : undefined
562- ) ,
563- tabID : ChatSessionManager . Instance . getSession ( ) . tabID ,
564- includeStartNewTransformationButton : false ,
565- } )
566- }
567- } else {
547+ if ( diffModel . currentPatchIndex === patchFiles . length - 1 ) {
568548 transformByQState . getChatControllers ( ) ?. transformationFinished . fire ( {
569- message : CodeWhispererConstants . changesAppliedChatMessageOneDiff ,
549+ message : CodeWhispererConstants . changesAppliedChatMessageMultipleDiffs (
550+ diffModel . currentPatchIndex ,
551+ patchFiles . length ,
552+ patchFilesDescriptions
553+ ? patchFilesDescriptions . content [ diffModel . currentPatchIndex ] . name
554+ : undefined
555+ ) ,
570556 tabID : ChatSessionManager . Instance . getSession ( ) . tabID ,
571557 includeStartNewTransformationButton : true ,
572558 } )
559+ } else {
560+ transformByQState . getChatControllers ( ) ?. transformationFinished . fire ( {
561+ message : CodeWhispererConstants . changesAppliedChatMessageMultipleDiffs (
562+ diffModel . currentPatchIndex ,
563+ patchFiles . length ,
564+ patchFilesDescriptions
565+ ? patchFilesDescriptions . content [ diffModel . currentPatchIndex ] . name
566+ : undefined
567+ ) ,
568+ tabID : ChatSessionManager . Instance . getSession ( ) . tabID ,
569+ includeStartNewTransformationButton : false ,
570+ } )
573571 }
574572
575573 // Load the next patch file
0 commit comments