Skip to content

Commit c01a48d

Browse files
committed
formatting the service-2 json to remove extra space
1 parent 3386c28 commit c01a48d

File tree

2 files changed

+172
-704
lines changed

2 files changed

+172
-704
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
125125
targetCode = listOf(
126126
TargetCode.builder()
127127
.relativeTargetPath(codeTestResponseContext.currentFileRelativePath.toString())
128-
.targetLineRangeList(selectionRange?.let { listOf(it) } ?: emptyList())
128+
.targetLineRangeList(selectionRange?.let { listOf(it) }.orEmpty())
129129
.build()
130130
),
131131
userInput = prompt
@@ -185,7 +185,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
185185
if (previousIterationContext == null) {
186186
codeTestChatHelper.updateAnswer(
187187
CodeTestChatMessageContent(
188-
message = generateSummaryMessage(path.fileName.toString()) + (cleanedfilePlan ?: ""),
188+
message = generateSummaryMessage(path.fileName.toString()) + (cleanedfilePlan.orEmpty()),
189189
type = ChatMessageType.Answer,
190190
),
191191
messageIdOverride = codeTestResponseContext.testSummaryMessageId
@@ -207,7 +207,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
207207
if (previousIterationContext == null) {
208208
codeTestChatHelper.updateAnswer(
209209
CodeTestChatMessageContent(
210-
message = generateSummaryMessage(path.fileName.toString()) + (cleanedfilePlan ?: ""),
210+
message = generateSummaryMessage(path.fileName.toString()) + (cleanedfilePlan.orEmpty()),
211211
type = ChatMessageType.Answer,
212212
),
213213
messageIdOverride = codeTestResponseContext.testSummaryMessageId
@@ -281,7 +281,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
281281
} else {
282282
if (previousIterationContext == null) {
283283
// show another card as the answer, remove this once we remove 3 backticks from backend
284-
val jobSummary = testGenerationResponse?.testGenerationJob()?.jobSummary()?.trim() ?: ""
284+
val jobSummary = testGenerationResponse?.testGenerationJob()?.jobSummary()?.trim().orEmpty()
285285

286286
val cleanedPlanSummary = jobSummary
287287
.replace(Regex("^```\\s*"), "") // Remove leading triple backticks

0 commit comments

Comments
 (0)