@@ -444,9 +444,8 @@ export class TestController {
444
444
445
445
/*
446
446
For Re:Invent 2024 we are supporting only java and python for unit test generation, rest of the languages shows the similar experience as CWC
447
- If user request test generation from input chat without opening a file, its difficult to get the language, so default will be plainText
448
447
*/
449
- if ( language !== 'java' && language !== 'python' && language !== 'plaintext' ) {
448
+ if ( language !== 'java' && language !== 'python' ) {
450
449
const unsupportedLanguage = language . charAt ( 0 ) . toUpperCase ( ) + language . slice ( 1 )
451
450
let unsupportedMessage = `<span style="color: #EE9D28;">⚠<b>I'm sorry, but /test only supports Python and Java</b><br></span> While ${ unsupportedLanguage } is not supported, I will generate a suggestion below. `
452
451
// handle the case when language is undefined
@@ -640,7 +639,6 @@ export class TestController {
640
639
const session = this . sessionStorage . getSession ( )
641
640
session . acceptedJobId = session . listOfTestGenerationJobId [ session . listOfTestGenerationJobId . length - 1 ]
642
641
const filePath = session . generatedFilePath
643
- session . fileLanguage = await this . getLanguageForFilePath ( filePath )
644
642
const absolutePath = path . join ( session . projectRootPath , filePath )
645
643
const fileExists = await fs . existsFile ( absolutePath )
646
644
const buildCommand = session . updatedBuildCommands ?. join ( ' ' )
@@ -724,7 +722,7 @@ export class TestController {
724
722
acceptedCharactersCount : session . charsOfCodeAccepted ,
725
723
generatedLinesCount : session . linesOfCodeGenerated ,
726
724
acceptedLinesCount : session . linesOfCodeAccepted ,
727
- cwsprChatProgrammingLanguage : session . fileLanguage ,
725
+ cwsprChatProgrammingLanguage : session . fileLanguage ?? 'plaintext' ,
728
726
jobId : session . listOfTestGenerationJobId [ 0 ] , // For RIV, UTG does only one StartTestGeneration API call so jobId = session.listOfTestGenerationJobId[0]
729
727
jobGroup : session . testGenerationJobGroupName ,
730
728
buildPayloadBytes : session . srcPayloadSize ,
0 commit comments