Skip to content

Commit ee58b1e

Browse files
committed
update implementation to generalize message sent to browser.
1 parent 409b6a1 commit ee58b1e

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
package software.aws.toolkits.jetbrains.services.amazonq.lsp
55

6-
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
6+
import com.google.gson.Gson
77
import com.intellij.notification.NotificationType
88
import com.intellij.openapi.project.Project
99
import migration.software.aws.toolkits.jetbrains.settings.AwsSettings
@@ -138,18 +138,12 @@ class AmazonQLanguageClientImpl(private val project: Project) : AmazonQLanguageC
138138
}
139139

140140
override fun sendChatUpdate(params: ChatUpdateParams): CompletableFuture<Unit> {
141-
// Process the chat update notification from the server
142-
// This notification is used to add or update messages in a specific tab
143-
val tabId = params.tabId
144-
145-
val paramsJson = jacksonObjectMapper().writeValueAsString(params)
146-
147-
val uiMessage = ChatCommunicationManager.convertToJsonToSendToChat(
148-
command = CHAT_SEND_UPDATE,
149-
tabId = tabId,
150-
params = paramsJson,
151-
isPartialResult = false
152-
)
141+
val uiMessage = """
142+
{
143+
"command":"$CHAT_SEND_UPDATE",
144+
"params":${Gson().toJson(params)}
145+
}
146+
""".trimIndent()
153147

154148
AsyncChatUiListener.notifyPartialMessageUpdate(uiMessage)
155149

0 commit comments

Comments
 (0)