Skip to content

Commit ba3a388

Browse files
committed
fix(amazonq): prompt user to choose a folder in the chat for /doc
1 parent 33b791e commit ba3a388

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Amazon Q /doc: Prompt user to choose a folder in chat"
4+
}

packages/core/package.nls.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@
374374
"AWS.amazonq.doc.answer.generating": "Generating documentation",
375375
"AWS.amazonq.doc.answer.creating": "Okay, I'm creating a README for your project. This may take a few minutes.",
376376
"AWS.amazonq.doc.answer.updating": "Okay, I'm updating the README to reflect your code changes. This may take a few minutes.",
377+
"AWS.amazonq.doc.answer.chooseFolder": "Choose a folder to continue.",
378+
"AWS.amazonq.doc.error.noFolderSelected": "It looks like you didn't choose a folder. Choose a folder to continue.",
377379
"AWS.amazonq.doc.error.contentLengthError": "Your workspace is too large for me to review. Your workspace must be within the quota, even if you choose a smaller folder. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
378380
"AWS.amazonq.doc.error.readmeTooLarge": "The README in your folder is too large for me to review. Try reducing the size of your README, or choose a folder with a smaller README. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
379381
"AWS.amazonq.doc.error.workspaceEmpty": "The folder you chose did not contain any source files in a supported language. Choose another folder and try again. For more information on supported languages, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",

packages/core/src/amazonqDoc/controllers/chat/controller.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,17 @@ export class DocController {
116116
}
117117

118118
/** Prompts user to choose a folder in current workspace for README creation/update.
119-
* After user chooses a folder, displays confimraiton message to user with selected path.
119+
* After user chooses a folder, displays confirmation message to user with selected path.
120120
*
121121
*/
122122
private async folderSelector(data: any) {
123+
this.messenger.sendAnswer({
124+
type: 'answer',
125+
tabID: data.tabID,
126+
message: i18n('AWS.amazonq.doc.answer.chooseFolder'),
127+
disableChatInput: true,
128+
})
129+
123130
const uri = await createSingleFileDialog({
124131
canSelectFolders: true,
125132
canSelectFiles: false,
@@ -133,7 +140,7 @@ export class DocController {
133140
this.messenger.sendAnswer({
134141
type: 'answer',
135142
tabID: data.tabID,
136-
message: 'No folder was selected, please try again.',
143+
message: i18n('AWS.amazonq.doc.error.noFolderSelected'),
137144
followUps: retryFollowUps,
138145
disableChatInput: true,
139146
})

0 commit comments

Comments
 (0)