Skip to content

Commit 4a4873d

Browse files
authored
Merge branch 'main' into fix/cancel-button
2 parents cd5b484 + 1121066 commit 4a4873d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix incorrect text shown while updating documentation in /doc"
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/controller/DocController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fun getIconForStep(targetStep: DocGenerationStep, currentStep: DocGenerationStep
110110
else -> checkIcons["wait"]
111111
}
112112

113-
fun docGenerationProgressMessage(currentStep: DocGenerationStep, mode: Mode): String {
113+
fun docGenerationProgressMessage(currentStep: DocGenerationStep, mode: Mode?): String {
114114
val isCreationMode = mode == Mode.CREATE
115115
val baseLine = if (isCreationMode) message("amazonqDoc.progress_message.creating") else message("amazonqDoc.progress_message.updating")
116116

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class DocGenerationState(
6060
message = action.msg,
6161
intent = Intent.DOC
6262
)
63-
64-
val codeGenerationResult = generateCode(codeGenerationId = response.codeGenerationId(), token)
63+
val mode = if (action.msg == message("amazonqDoc.session.create")) Mode.CREATE else null
64+
val codeGenerationResult = generateCode(codeGenerationId = response.codeGenerationId(), mode, token)
6565
numberOfReferencesGenerated = codeGenerationResult.references.size
6666
numberOfFilesGenerated = codeGenerationResult.newFiles.size
6767
codeGenerationRemainingIterationCount = codeGenerationResult.codeGenerationRemainingIterationCount
@@ -134,7 +134,7 @@ fun getFileSummaryPercentage(input: String): Double {
134134
return percentage
135135
}
136136

137-
private suspend fun DocGenerationState.generateCode(codeGenerationId: String, token: CancellationTokenSource?): CodeGenerationResult {
137+
private suspend fun DocGenerationState.generateCode(codeGenerationId: String, mode: Mode?, token: CancellationTokenSource?): CodeGenerationResult {
138138
val pollCount = 180
139139
val requestDelay = 10000L
140140

@@ -192,7 +192,7 @@ private suspend fun DocGenerationState.generateCode(codeGenerationId: String, to
192192
} else {
193193
DocGenerationStep.GENERATING_ARTIFACTS
194194
},
195-
mode = Mode.CREATE
195+
mode
196196
)
197197
)
198198
}

0 commit comments

Comments
 (0)