Skip to content

Commit 1121066

Browse files
fix(amazonq): Correct amazon q documentation updating flow progress text (#5232)
* fix: correct amazon q documentation updating flow progress text * chore: update the change log description Co-authored-by: manodnyab <[email protected]> --------- Co-authored-by: manodnyab <[email protected]>
1 parent 2e39dc0 commit 1121066

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
@@ -64,8 +64,8 @@ class DocGenerationState(
6464
message = action.msg,
6565
intent = Intent.DOC
6666
)
67-
68-
val codeGenerationResult = generateCode(codeGenerationId = response.codeGenerationId(), token)
67+
val mode = if (action.msg == message("amazonqDoc.session.create")) Mode.CREATE else null
68+
val codeGenerationResult = generateCode(codeGenerationId = response.codeGenerationId(), mode, token)
6969
numberOfReferencesGenerated = codeGenerationResult.references.size
7070
numberOfFilesGenerated = codeGenerationResult.newFiles.size
7171
codeGenerationRemainingIterationCount = codeGenerationResult.codeGenerationRemainingIterationCount
@@ -138,7 +138,7 @@ fun getFileSummaryPercentage(input: String): Double {
138138
return percentage
139139
}
140140

141-
private suspend fun DocGenerationState.generateCode(codeGenerationId: String, token: CancellationTokenSource?): CodeGenerationResult {
141+
private suspend fun DocGenerationState.generateCode(codeGenerationId: String, mode: Mode?, token: CancellationTokenSource?): CodeGenerationResult {
142142
val pollCount = 180
143143
val requestDelay = 10000L
144144

@@ -214,7 +214,7 @@ private suspend fun DocGenerationState.generateCode(codeGenerationId: String, to
214214
} else {
215215
DocGenerationStep.GENERATING_ARTIFACTS
216216
},
217-
mode = Mode.CREATE
217+
mode
218218
)
219219
)
220220
}

0 commit comments

Comments
 (0)