Skip to content

Commit 9debeac

Browse files
fix(amazonq): Add changelog, code quality improvements
1 parent 98e8b3c commit 9debeac

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Enable agentic code review"
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ class BrowserConnector(
622622
}
623623
chatCommunicationManager.removePartialChatMessage(partialResultToken)
624624
val decryptedMessage = Gson().fromJson(value?.let { encryptionManager?.decrypt(it) }.orEmpty(), Map::class.java)
625+
as Map<String, *>
625626
parseFindingsMessages(decryptedMessage)
626627

627628
val messageToChat = ChatCommunicationManager.convertToJsonToSendToChat(
@@ -641,11 +642,11 @@ class BrowserConnector(
641642
}
642643
}
643644

644-
fun parseFindingsMessages(messagesMap: Map<*, *>) {
645+
fun parseFindingsMessages(messagesMap: Map<String, *>) {
645646
try {
646647
val additionalMessages = messagesMap["additionalMessages"] as? MutableList<Map<String, Any>>
647648
val findingsMessages = additionalMessages?.filter { message ->
648-
if (message["messageId"] != null) {
649+
if (message.contains("messageId")) {
649650
(message["messageId"] as String).endsWith(CODE_REVIEW_FINDINGS_SUFFIX) ||
650651
(message["messageId"] as String).endsWith(DISPLAY_FINDINGS_SUFFIX)
651652
} else {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import software.aws.toolkits.jetbrains.services.cwc.controller.chat.telemetry.Te
2121
import software.aws.toolkits.jetbrains.services.cwc.controller.chat.telemetry.getStartUrl
2222

2323
class HandleIssueCommandAction : AnAction(), DumbAware {
24+
val contextDataKey = DataKey.create<MutableMap<String, String>>("amazonq.codescan.handleIssueCommandContext")
25+
val actionDataKey = DataKey.create<String>("amazonq.codescan.handleIssueCommandAction")
26+
2427
override fun getActionUpdateThread() = ActionUpdateThread.BGT
2528

2629
override fun update(e: AnActionEvent) {
@@ -38,8 +41,6 @@ class HandleIssueCommandAction : AnAction(), DumbAware {
3841

3942
override fun actionPerformed(e: AnActionEvent) {
4043
val project = e.project ?: return
41-
val contextDataKey = DataKey.create<MutableMap<String, String>>("amazonq.codescan.handleIssueCommandContext")
42-
val actionDataKey = DataKey.create<String>("amazonq.codescan.handleIssueCommandAction")
4344
val context = e.getData(contextDataKey) ?: return
4445
val action = e.getData(actionDataKey) ?: return
4546

0 commit comments

Comments
 (0)