Skip to content

Commit 367350e

Browse files
dhasani23David Hasani
andauthored
fix(amazonq): skip empty plan tables (#6636)
## Problem When a plan table is empty, the table header shows. ## Solution Don't show the table header when the table is empty. --- - 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. Co-authored-by: David Hasani <[email protected]>
1 parent 35452cd commit 367350e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ export function addTableMarkdown(plan: string, stepId: string, tableMapping: { [
506506
return plan
507507
}
508508
const table = JSON.parse(tableObj)
509+
if (table.rows.length === 0) {
510+
// empty table
511+
plan += `\n\nThere are no ${table.name.toLowerCase()} to display.\n\n`
512+
return plan
513+
}
509514
plan += `\n\n\n${table.name}\n|`
510515
const columns = table.columnNames
511516
// eslint-disable-next-line unicorn/no-array-for-each

0 commit comments

Comments
 (0)