Skip to content

Commit 3124e9a

Browse files
committed
Refactor to use more specific command for UTG
1 parent 3c3d9f3 commit 3124e9a

File tree

7 files changed

+10
-26
lines changed

7 files changed

+10
-26
lines changed

plugins/amazonq/chat/jetbrains-community/resources/META-INF/plugin-chat.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
<keyboard-shortcut keymap="$default" first-keystroke="meta alt A" />
7171
</action>
7272

73-
<action id="aws.toolkit.jetbrains.core.services.cwc.commands.GenerateUnitTestAction"
74-
class="software.aws.toolkits.jetbrains.services.cwc.commands.GenerateUnitTestAction">
73+
<action id="aws.toolkit.jetbrains.core.services.cwc.commands.GenerateUnitTestsAction"
74+
class="software.aws.toolkits.jetbrains.services.cwc.commands.GenerateUnitTestsAction">
7575
<keyboard-shortcut keymap="$default" first-keystroke="meta alt T" />
7676
</action>
7777

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/commands/EditorContextCommand.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ enum class EditorContextCommand(
2626
verb = "Optimize",
2727
actionId = "aws.amazonq.optimizeCode",
2828
),
29-
Test(
29+
GenerateUnitTests(
3030
verb = "Generate unit tests for",
31-
actionId = "aws.amazonq.testCode",
31+
actionId = "aws.amazonq.generateUnitTests",
3232
),
3333
SendToPrompt(
3434
verb = "SendToPrompt",

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/commands/GenerateUnitTestAction.kt

Lines changed: 0 additions & 18 deletions
This file was deleted.

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/controller/ChatController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class ChatController private constructor(
334334
}
335335

336336
// Create prompt
337-
val prompt = if (EditorContextCommand.GenerateUnitTest == message.command)
337+
val prompt = if (EditorContextCommand.GenerateUnitTests == message.command)
338338
"${message.command.verb} the following part of my code for me: $codeSelection" else
339339
"${message.command} the following part of my code for me: $codeSelection";
340340

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/controller/chat/messenger/ChatPromptHandler.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import kotlinx.coroutines.flow.onCompletion
1010
import kotlinx.coroutines.flow.onStart
1111
import software.amazon.awssdk.awscore.exception.AwsServiceException
1212
import software.amazon.awssdk.services.codewhispererstreaming.model.CodeWhispererStreamingException
13+
import software.amazon.awssdk.services.codewhispererstreaming.model.UserIntent
14+
import software.amazon.awssdk.services.codewhispererstreaming.model.ValidationException
1315
import software.aws.toolkits.core.utils.convertMarkdownToHTML
1416
import software.aws.toolkits.jetbrains.services.cwc.clients.chat.exceptions.ChatApiException
1517
import software.aws.toolkits.jetbrains.services.cwc.clients.chat.model.ChatRequestData

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/controller/chat/userIntent/UserIntentRecognizer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UserIntentRecognizer {
2020
EditorContextCommand.Fix -> UserIntent.APPLY_COMMON_BEST_PRACTICES
2121
EditorContextCommand.Optimize -> UserIntent.IMPROVE_CODE
2222
EditorContextCommand.ExplainCodeScanIssue -> UserIntent.EXPLAIN_CODE_SELECTION
23-
EditorContextCommand.GenerateUnitTest -> UserIntent.GENERATE_UNIT_TESTS
23+
EditorContextCommand.GenerateUnitTests -> UserIntent.GENERATE_UNIT_TESTS
2424
EditorContextCommand.SendToPrompt -> null
2525
}
2626

plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ action.aws.toolkit.jetbrains.core.services.cwc.commands.OptimizeCodeAction.descr
2525
action.aws.toolkit.jetbrains.core.services.cwc.commands.OptimizeCodeAction.text = Optimize Code
2626
action.aws.toolkit.jetbrains.core.services.cwc.commands.RefactorCodeAction.description = Refactors the selected code
2727
action.aws.toolkit.jetbrains.core.services.cwc.commands.RefactorCodeAction.text = Refactor Code
28-
action.aws.toolkit.jetbrains.core.services.cwc.commands.GenerateUnitTestAction.description = Generates unit tests for the selected code
29-
action.aws.toolkit.jetbrains.core.services.cwc.commands.GenerateUnitTestAction.text = Generate Tests (Beta)
28+
action.aws.toolkit.jetbrains.core.services.cwc.commands.GenerateUnitTestsAction.description = Generates unit tests for the selected code
29+
action.aws.toolkit.jetbrains.core.services.cwc.commands.GenerateUnitTestsAction.text = Generate Tests (Beta)
3030
action.aws.toolkit.jetbrains.core.services.cwc.commands.SendToPromptAction.description = Sends selected code to chat
3131
action.aws.toolkit.jetbrains.core.services.cwc.commands.SendToPromptAction.text = Send to Prompt
3232
action.aws.toolkit.open.arn.browser.text=Open ARN in AWS Console

0 commit comments

Comments
 (0)