Skip to content

Commit e08a3bd

Browse files
authored
fix(amazonq): full project scan command not working (aws#7207)
## Problem a tab id isn't getting created when you call `status bar` -> `full project scan with /review` causing the command to fail with "you cannot open more then 10 tabs" ## Solution create a new tab if tabId is undefined. This can only happen when agent commands are triggered via a command, since they don't know the tabId ahead of time --- - 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 d3db47a commit e08a3bd

File tree

1 file changed

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

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class QuickActionHandler {
107107
}
108108
}
109109

110-
private handleScanCommand(tabID: string, eventId: string | undefined) {
110+
private handleScanCommand(tabID: string | undefined, eventId: string | undefined) {
111111
if (!this.isScanEnabled || !this.mynahUI) {
112112
return
113113
}
@@ -126,6 +126,14 @@ export class QuickActionHandler {
126126
return
127127
}
128128

129+
/**
130+
* status bar -> "full project scan is now /review" doesn't have a tab ID
131+
* since it's called via a command so we need to manually create one
132+
*/
133+
if (!tabID) {
134+
tabID = this.mynahUI.updateStore('', {})
135+
}
136+
129137
// if there is no scan tab, open a new one
130138
const affectedTabId: string | undefined = this.addTab(tabID)
131139

0 commit comments

Comments
 (0)