Skip to content

Commit 55fba4b

Browse files
Merge master into feature/postreinvent
2 parents d3abef0 + 5f76b56 commit 55fba4b

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

package-lock.json

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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": "Improved LLM code review for file review."
4+
}
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: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,16 @@ 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'))
121123

122124
if (scope === CodeWhispererConstants.CodeAnalysisScope.FILE_ON_DEMAND) {
123-
await this.processCombinedGitDiff(
124-
zip,
125-
[workspaceFolder.uri.fsPath],
126-
uri.fsPath,
127-
CodeWhispererConstants.CodeAnalysisScope.FILE_ON_DEMAND
128-
)
125+
const gitDiffContent = `+++ b/${path.normalize(zipEntryPath)}` // Sending file path in payload for LLM code review
126+
zip.addFile(ZipConstants.codeDiffFilePath, Buffer.from(gitDiffContent, 'utf-8'))
129127
}
130128
} else {
131129
zip.addFile(uri.fsPath, Buffer.from(content, 'utf-8'))

0 commit comments

Comments
 (0)