Skip to content

Commit e0c153f

Browse files
authored
fix(amazonq): use fsPath for project name #6176
## Problem Issues reported in chat sometimes does not match issues tree. This is happening because the zip artifact uses workspace name (custom name could be different from fsPath) while git diff output uses fsPath. This causes the findings to come back as two filePaths that end up overwriting each other. ## Solution Update zip to use project name from fsPath instead of `workspaceFolder.name`
1 parent 1ebb05a commit e0c153f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-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": "Code Review: Fixed a bug where some issues are missing from the code issues view for workspaces with custom names"
4+
}

packages/core/src/codewhisperer/util/zipUtil.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export class ZipUtil {
114114

115115
const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri)
116116
if (workspaceFolder) {
117-
const projectName = workspaceFolder.name
117+
// Note: workspaceFolder.name is not the same as the file system folder name,
118+
// use the fsPath value instead
119+
const projectName = path.basename(workspaceFolder.uri.fsPath)
118120
const relativePath = vscode.workspace.asRelativePath(uri)
119121
const zipEntryPath = this.getZipEntryPath(projectName, relativePath)
120122
zip.addFile(zipEntryPath, Buffer.from(content, 'utf-8'))

0 commit comments

Comments
 (0)