Skip to content

Commit f1ede42

Browse files
authored
fix(amazonq): open review tab for generate tests (aws#7195)
## Problem using the generate tests right click command won't work because a new tab never gets created, causing a "no more tabs available" warning ## Solution If we're using the right click -> generate tests command AND there isn't a /test tab open then create a new tab --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b60036b commit f1ede42

File tree

1 file changed

+10
-1
lines changed
  • packages/core/src/amazonq/webview/ui/quickActions

1 file changed

+10
-1
lines changed

packages/core/src/amazonq/webview/ui/quickActions/handler.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class QuickActionHandler {
155155
}
156156
}
157157

158-
private handleTestCommand(chatPrompt: ChatPrompt, tabID: string, eventId: string | undefined) {
158+
private handleTestCommand(chatPrompt: ChatPrompt, tabID: string | undefined, eventId: string | undefined) {
159159
if (!this.isTestEnabled || !this.mynahUI) {
160160
return
161161
}
@@ -169,6 +169,15 @@ export class QuickActionHandler {
169169
return
170170
}
171171

172+
/**
173+
* right click -> generate test has no tab id
174+
* we have to manually create one if a testgen tab
175+
* wasn't previously created
176+
*/
177+
if (!tabID) {
178+
tabID = this.mynahUI.updateStore('', {})
179+
}
180+
172181
// if there is no test tab, open a new one
173182
const affectedTabId: string | undefined = this.addTab(tabID)
174183

0 commit comments

Comments
 (0)