AI Code Suggestions
CodePeer’s AI Code Suggestions feature takes your review comments one step further by turning feedback into actionable code improvements. With a single click, the AI generates a new version of the code based on your feedback, helping to streamline the review process and reduce manual effort.
Generating a Code Suggestion
Within a code review, you can leave comments associated with specific
lines of code. After writing your feedback in the comment box, you’ll
notice a button with the AI
icon. This button opens
a menu of AI actions that can be applied to your comment.
One of these actions is Generate Code Suggestion. When selected, CodePeer’s AI will analyze both the existing code and your comment, then generate a modified version of the code that aligns with your feedback. This new code suggestion is automatically added to the comment as a structured suggestion, ready for approval or further discussion.
Step-by-Step Instructions
- Navigate to the code line where you want to leave feedback.
- Write your comment in the comment box, explaining the improvement or change you’d like to see in the code.
- Click the
AI
button located inside the comment box. - Select Generate Code Suggestion from the dropdown menu.
- Review the AI-generated code suggestion, which will appear in your comment as a suggestion.
- Submit the suggestion, or modify it further before sending it for review.
Why Use AI Code Suggestions?
AI Code Suggestions speed up the review process by reducing the manual effort required to turn feedback into code. Instead of reworking the code yourself after leaving a comment, the AI handles the heavy lifting, offering a solution based on your input. This not only saves time but also ensures consistency and helps avoid potential errors.
Fine-Tuning the AI Output
While AI Code Suggestions aim to closely match your feedback, the generated code can still be adjusted. You have full control to edit the AI's suggestion before it’s finalized, ensuring that the final version meets your exact requirements.
AI Actions Menu
In addition to Generate Code Suggestion, the AI actions menu offers a range of other helpful tools designed to enhance the code review process. Keep an eye out for other AI features in the menu to further streamline your reviews!