From b389832609e9c236eabf3bda1077cd8d2137fcb4 Mon Sep 17 00:00:00 2001 From: Kevin Ding Date: Tue, 7 Jan 2025 13:58:32 -0500 Subject: [PATCH 1/2] fix: correct amazon q documentation updating flow progress text --- .../bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json | 4 ++++ .../services/amazonqDoc/controller/DocController.kt | 2 +- .../services/amazonqDoc/session/DocGenerationState.kt | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json diff --git a/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json b/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json new file mode 100644 index 00000000000..c799921ec1a --- /dev/null +++ b/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "Corrects an issue where documentation updating progress text was erroneously replaced with generation flow text." +} \ No newline at end of file diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/controller/DocController.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/controller/DocController.kt index 00ac34cead1..3788e8449e5 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/controller/DocController.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/controller/DocController.kt @@ -110,7 +110,7 @@ fun getIconForStep(targetStep: DocGenerationStep, currentStep: DocGenerationStep else -> checkIcons["wait"] } -fun docGenerationProgressMessage(currentStep: DocGenerationStep, mode: Mode): String { +fun docGenerationProgressMessage(currentStep: DocGenerationStep, mode: Mode?): String { val isCreationMode = mode == Mode.CREATE val baseLine = if (isCreationMode) message("amazonqDoc.progress_message.creating") else message("amazonqDoc.progress_message.updating") diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt index 81fa4b88197..e08e27be6fd 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt @@ -64,8 +64,8 @@ class DocGenerationState( message = action.msg, intent = Intent.DOC ) - - val codeGenerationResult = generateCode(codeGenerationId = response.codeGenerationId(), token) + val mode = if (action.msg == message("amazonqDoc.session.create")) Mode.CREATE else null + val codeGenerationResult = generateCode(codeGenerationId = response.codeGenerationId(), mode, token) numberOfReferencesGenerated = codeGenerationResult.references.size numberOfFilesGenerated = codeGenerationResult.newFiles.size codeGenerationRemainingIterationCount = codeGenerationResult.codeGenerationRemainingIterationCount @@ -138,7 +138,7 @@ fun getFileSummaryPercentage(input: String): Double { return percentage } -private suspend fun DocGenerationState.generateCode(codeGenerationId: String, token: CancellationTokenSource?): CodeGenerationResult { +private suspend fun DocGenerationState.generateCode(codeGenerationId: String, mode: Mode?, token: CancellationTokenSource?): CodeGenerationResult { val pollCount = 180 val requestDelay = 10000L @@ -214,7 +214,7 @@ private suspend fun DocGenerationState.generateCode(codeGenerationId: String, to } else { DocGenerationStep.GENERATING_ARTIFACTS }, - mode = Mode.CREATE + mode ) ) } From 899020526bb360d4110ad21a99adb77f0550fd25 Mon Sep 17 00:00:00 2001 From: Kevin Ding <102239785+KevinDing1@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:51:24 -0500 Subject: [PATCH 2/2] chore: update the change log description Co-authored-by: manodnyab <66754471+manodnyab@users.noreply.github.com> --- .../bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json b/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json index c799921ec1a..eed25de43f8 100644 --- a/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json +++ b/.changes/next-release/bugfix-3e9ee812-d817-4c0d-9389-7b32d4049441.json @@ -1,4 +1,4 @@ { "type" : "bugfix", - "description" : "Corrects an issue where documentation updating progress text was erroneously replaced with generation flow text." + "description" : "Fix incorrect text shown while updating documentation in /doc" } \ No newline at end of file