diff --git a/packages/amazonq/.changes/next-release/Bug Fix-b89574ec-9f50-4b4c-b548-30bfce5d0999.json b/packages/amazonq/.changes/next-release/Bug Fix-b89574ec-9f50-4b4c-b548-30bfce5d0999.json new file mode 100644 index 00000000000..db14e5a1922 --- /dev/null +++ b/packages/amazonq/.changes/next-release/Bug Fix-b89574ec-9f50-4b4c-b548-30bfce5d0999.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "/review: Zip files are created with the wrong file path for file scans in multifolder workspaces." +} diff --git a/packages/core/src/codewhisperer/util/zipUtil.ts b/packages/core/src/codewhisperer/util/zipUtil.ts index 40ef6d48e84..7403fcb0862 100644 --- a/packages/core/src/codewhisperer/util/zipUtil.ts +++ b/packages/core/src/codewhisperer/util/zipUtil.ts @@ -117,7 +117,8 @@ export class ZipUtil { // Note: workspaceFolder.name is not the same as the file system folder name, // use the fsPath value instead const projectName = path.basename(workspaceFolder.uri.fsPath) - const relativePath = vscode.workspace.asRelativePath(uri) + // Set includeWorkspaceFolder to false because we are already manually prepending the projectName + const relativePath = vscode.workspace.asRelativePath(uri, false) const zipEntryPath = this.getZipEntryPath(projectName, relativePath) zip.addFile(zipEntryPath, Buffer.from(content, 'utf-8'))