Generate Comments
Overview
This command inserts meaningful explanations into your code without altering its behavior.
Why Use It
Use Generate Comments to make your code more understandable for teammates or reviewers. Clear comments reduce misunderstandings and errors, especially in collaborative environments.
Common Use Cases
- Preparing code for a review or handoff.
- Working with a codebase that has minimal or unclear documentation.
- Clarifying complex logic or unique implementations.
- Maintaining code that others may revisit later.
Prerequisites
- Install and enable WiseGPT in VS Code.
- Open the file you want to work on.
Steps
Select Command
Right-click the selected code, then select WiseGPT and choose Generate Comments.
You can also click on the light bulb (💡) icon next to the selected code and then select Generate Comments.
Review Code
WiseGPT generates comments for the selected code. Review the changes to ensure they meet your requirements and apply the changes to your codebase.
Troubleshooting
Why don’t I see the "Generate Comments" command?
WiseGPT plugin might not be installed or updated.
Install or update the plugin to the latest version.
Why do I see no changes in the code after generation?
The existing code may already have adequate comments.
Try selecting different code segments or verify that your code is eligible.
What if WiseGPT stops with an error?
WiseGPT may have detected syntax problems.
Check your code for unclosed brackets or missing syntax elements.