Skip to content

Commit

Permalink
fix/autofix: fixed handling of empty suggestions (#536)
Browse files Browse the repository at this point in the history
Co-authored-by: Abdelrahman Shawki Hassan <[email protected]>
  • Loading branch information
BBerabi and ShawkyZ authored Oct 14, 2024
1 parent 2d3ddd8 commit 383c313
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ export class CodeSuggestionWebviewProvider
relativePath,
issueId,
);
if (diffs.length === 0) {
throw Error('Unable to generate a relevant fix');
}
// todo(berkay.berabi): Here if suggestions are empty, we should post a different type of message that
// will show the user correct information, namely: we tried but no fixes available for now.

void this.postSuggestMessage({ type: 'setAutofixDiffs', args: { suggestion, diffs } });
} catch (error) {
Expand Down

0 comments on commit 383c313

Please sign in to comment.