File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
core/src/codewhispererChat/controllers/chat/userIntent Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 353353 {
354354 "command" : " aws.amazonq.generateUnitTests" ,
355355 "group" : " cw_chat@5" ,
356- "when" : " false "
356+ "when" : " aws.codewhisperer.connected && aws.isInternalUser "
357357 },
358358 {
359359 "command" : " aws.amazonq.sendToPrompt" ,
433433 "command" : " aws.amazonq.generateUnitTests" ,
434434 "title" : " %AWS.command.amazonq.generateUnitTests%" ,
435435 "category" : " %AWS.amazonq.title%" ,
436- "enablement" : " false "
436+ "enablement" : " aws.codewhisperer.connected && aws.isInternalUser "
437437 },
438438 {
439439 "command" : " aws.amazonq.reconnect" ,
616616 "key" : " win+alt+t" ,
617617 "mac" : " cmd+alt+t" ,
618618 "linux" : " meta+alt+t" ,
619- "when" : " false "
619+ "when" : " aws.codewhisperer.connected && aws.isInternalUser "
620620 },
621621 {
622622 "command" : " aws.amazonq.invokeInlineCompletion" ,
Original file line number Diff line number Diff line change 66import { UserIntent } from '@amzn/codewhisperer-streaming'
77import { EditorContextCommand } from '../../../commands/registerCommands'
88import { PromptMessage } from '../model'
9+ import { Auth } from '../../../../auth'
910
1011export class UserIntentRecognizer {
1112 public getFromContextMenuCommand ( command : EditorContextCommand ) : UserIntent | undefined {
@@ -38,6 +39,8 @@ export class UserIntentRecognizer {
3839 return UserIntent . APPLY_COMMON_BEST_PRACTICES
3940 } else if ( prompt . message . startsWith ( 'Optimize' ) ) {
4041 return UserIntent . IMPROVE_CODE
42+ } else if ( prompt . message . startsWith ( 'Generate unit tests' ) && Auth . instance . isInternalAmazonUser ( ) ) {
43+ return UserIntent . GENERATE_UNIT_TESTS
4144 }
4245 return undefined
4346 }
You can’t perform that action at this time.
0 commit comments