Skip to content

Commit 667ff8e

Browse files
committed
fix(amazonq): skip edit suggestion if applyDiff fail
1 parent c6c5d76 commit 667ff8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/amazonq/src/app/inline/EditRendering/imageRenderer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export async function showEdits(
2929
const { svgImage, startLine, newCode, origionalCodeHighlightRange } =
3030
await svgGenerationService.generateDiffSvg(currentFile, item.insertText as string)
3131

32+
if (newCode.length === 0) {
33+
getLogger('nextEditPrediction').warn('not able to apply provided edit suggestion, skip rendering')
34+
return
35+
}
36+
3237
if (svgImage) {
3338
// display the SVG image
3439
await displaySvgDecoration(

0 commit comments

Comments
 (0)