Skip to content

Commit 73880dd

Browse files
committed
fix: normalize path for /doc scope
1 parent bd37885 commit 73880dd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
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 Chat: Choosing a nested subfolder for /doc on Windows results in a \"The folder you chose did not contain any source files\""
4+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { getPathsFromZipFilePath, SvgFileExtension } from '../../../amazonq/util
4545
import { FollowUpTypes } from '../../../amazonq/commons/types'
4646
import { DocGenerationTask, DocGenerationTasks } from '../docGenerationTask'
4747
import { DevPhase } from '../../types'
48+
import { normalize } from '../../../shared/utilities/pathUtils'
4849

4950
export interface ChatControllerEventEmitters {
5051
readonly processHumanChatMessage: EventEmitter<any>
@@ -160,7 +161,9 @@ export class DocController {
160161
// Display path should always include workspace folder name
161162
displayPath = path.join(relativePath.workspaceFolder.name, relativePath.relativePath)
162163
// Only include workspace folder name in API call if multi-root workspace
163-
docGenerationTask.folderPath = isMultiRootWorkspace() ? displayPath : relativePath.relativePath
164+
docGenerationTask.folderPath = normalize(
165+
isMultiRootWorkspace() ? displayPath : relativePath.relativePath
166+
)
164167

165168
if (!relativePath.relativePath) {
166169
docGenerationTask.folderLevel = 'ENTIRE_WORKSPACE'

0 commit comments

Comments
 (0)