Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions packages/core/src/amazonqTest/chat/controller/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,16 +548,12 @@ export class TestController {
*/
if (!['java', 'python'].includes(language) || workspaceFolder === undefined) {
let unsupportedMessage: string
const unsupportedLanguage = language ? language.charAt(0).toUpperCase() + language.slice(1) : ''
if (!workspaceFolder) {
// File is outside of workspace
unsupportedMessage = `<span style="color: #EE9D28;">&#9888;<b>I can't generate tests for ${fileName}</b> because the file is outside of workspace scope.<br></span> I can still provide examples, instructions and code suggestions.`
} else if (unsupportedLanguage) {
unsupportedMessage = `<span style="color: #EE9D28;">&#9888;<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.`
} else {
unsupportedMessage = `<span style="color: #EE9D28;">&#9888;<b>I'm sorry, but /test only supports Python and Java</b><br></span> I will still generate a suggestion below.`
this.messenger.sendMessage(unsupportedMessage, tabID, 'answer')
}
this.messenger.sendMessage(unsupportedMessage, tabID, 'answer')
// Keeping this metric as is. TODO - Change to true once we support through other feature
session.isSupportedLanguage = false
await this.onCodeGeneration(
session,
Expand Down