From 73880dd88547106ee614c5b6314bb73795354a64 Mon Sep 17 00:00:00 2001 From: Avi Alpert Date: Thu, 20 Mar 2025 15:04:27 -0400 Subject: [PATCH 1/2] fix: normalize path for /doc scope --- .../Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json | 4 ++++ packages/core/src/amazonqDoc/controllers/chat/controller.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json diff --git a/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json b/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json new file mode 100644 index 00000000000..badf975b196 --- /dev/null +++ b/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "Amazon Q Chat: Choosing a nested subfolder for /doc on Windows results in a \"The folder you chose did not contain any source files\"" +} diff --git a/packages/core/src/amazonqDoc/controllers/chat/controller.ts b/packages/core/src/amazonqDoc/controllers/chat/controller.ts index 2bd62678397..cba7f42d28a 100644 --- a/packages/core/src/amazonqDoc/controllers/chat/controller.ts +++ b/packages/core/src/amazonqDoc/controllers/chat/controller.ts @@ -45,6 +45,7 @@ import { getPathsFromZipFilePath, SvgFileExtension } from '../../../amazonq/util import { FollowUpTypes } from '../../../amazonq/commons/types' import { DocGenerationTask, DocGenerationTasks } from '../docGenerationTask' import { DevPhase } from '../../types' +import { normalize } from '../../../shared/utilities/pathUtils' export interface ChatControllerEventEmitters { readonly processHumanChatMessage: EventEmitter @@ -160,7 +161,9 @@ export class DocController { // Display path should always include workspace folder name displayPath = path.join(relativePath.workspaceFolder.name, relativePath.relativePath) // Only include workspace folder name in API call if multi-root workspace - docGenerationTask.folderPath = isMultiRootWorkspace() ? displayPath : relativePath.relativePath + docGenerationTask.folderPath = normalize( + isMultiRootWorkspace() ? displayPath : relativePath.relativePath + ) if (!relativePath.relativePath) { docGenerationTask.folderLevel = 'ENTIRE_WORKSPACE' From 3b5e6067f6e830bf355cca95f3c1df19d7b642a7 Mon Sep 17 00:00:00 2001 From: Avi Alpert <131792194+avi-alpert@users.noreply.github.com> Date: Thu, 20 Mar 2025 15:12:54 -0400 Subject: [PATCH 2/2] Update changelog --- .../Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json b/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json index badf975b196..81b888ea005 100644 --- a/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json +++ b/packages/amazonq/.changes/next-release/Bug Fix-3f6a2026-9dd8-4b50-8a73-765ead8717b4.json @@ -1,4 +1,4 @@ { "type": "Bug Fix", - "description": "Amazon Q Chat: Choosing a nested subfolder for /doc on Windows results in a \"The folder you chose did not contain any source files\"" + "description": "Amazon Q Chat: Choosing a nested subfolder for `/doc` on Windows results in `The folder you chose did not contain any source files` error" }