Skip to content

Commit ad18287

Browse files
committed
If user tries to generate /test on second or third package in a workspace we show wrong view diff
1 parent 2de6635 commit ad18287

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/core/src/amazonqTest/chat/controller/controller.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,12 +695,7 @@ export class TestController {
695695
private async openDiff(message: OpenDiffMessage) {
696696
const session = this.sessionStorage.getSession()
697697
const filePath = session.generatedFilePath
698-
const workspaceFolder = vscode.workspace.workspaceFolders?.[0]
699-
if (!workspaceFolder) {
700-
throw new Error('No workspace folder found')
701-
}
702-
const projectPath = workspaceFolder.uri.fsPath
703-
const absolutePath = path.join(projectPath, filePath)
698+
const absolutePath = path.join(session.projectRootPath, filePath)
704699
const fileExists = await fs.existsFile(absolutePath)
705700
const leftUri = fileExists ? vscode.Uri.file(absolutePath) : vscode.Uri.from({ scheme: 'untitled' })
706701
const rightUri = vscode.Uri.file(path.join(this.tempResultDirPath, 'resultArtifacts', filePath))

0 commit comments

Comments
 (0)