@@ -56,7 +56,8 @@ function registerNewFiles(
5656 fs : VirtualFileSystem ,
5757 newFileContents : NewFileZipContents [ ] ,
5858 uploadId : string ,
59- workspaceFolders : CurrentWsFolders
59+ workspaceFolders : CurrentWsFolders ,
60+ conversationId : string
6061) : NewFileInfo [ ] {
6162 const result : NewFileInfo [ ] = [ ]
6263 const workspaceFolderPrefixes = getWorkspaceFoldersByPrefixes ( workspaceFolders )
@@ -76,6 +77,10 @@ function registerNewFiles(
7677 Object . values ( workspaceFolderPrefixes ) . find ( ( val ) => val . index === 0 ) ?. name ?? ''
7778 ]
7879 if ( folder === undefined ) {
80+ telemetry . amazonq_wsOrphanedDocuments . emit ( {
81+ amazonqConversationId : conversationId ,
82+ credentialStartUrl : AuthUtil . instance . startUrl ,
83+ } )
7984 getLogger ( ) . error ( `No workspace folder found for file: ${ zipFilePath } and prefix: ${ prefix } ` )
8085 continue
8186 }
@@ -169,7 +174,13 @@ abstract class CodeGenBase {
169174 case CodeGenerationStatus . COMPLETE : {
170175 const { newFileContents, deletedFiles, references } =
171176 await this . config . proxyClient . exportResultArchive ( this . conversationId )
172- const newFileInfo = registerNewFiles ( fs , newFileContents , this . uploadId , workspaceFolders )
177+ const newFileInfo = registerNewFiles (
178+ fs ,
179+ newFileContents ,
180+ this . uploadId ,
181+ workspaceFolders ,
182+ this . conversationId
183+ )
173184 telemetry . setNumberOfFilesGenerated ( newFileInfo . length )
174185
175186 return {
@@ -356,7 +367,13 @@ export class MockCodeGenState implements SessionState {
356367 zipFilePath : f . zipFilePath ,
357368 fileContent : f . fileContent ,
358369 } ) )
359- this . filePaths = registerNewFiles ( action . fs , newFileContents , this . uploadId , this . config . workspaceFolders )
370+ this . filePaths = registerNewFiles (
371+ action . fs ,
372+ newFileContents ,
373+ this . uploadId ,
374+ this . config . workspaceFolders ,
375+ this . conversationId
376+ )
360377 this . deletedFiles = [
361378 {
362379 zipFilePath : 'src/this-file-should-be-deleted.ts' ,
0 commit comments