Skip to main content

Generate Comments

What it does?

The Generate Comments command automatically adds comments to your code. These comments provide explanations and context for the code, making it easier for developers to understand its functionality and purpose.

Why to use it?

tip

This command supports all programming languages and frameworks.

To improve the documentation of your code, making it more understandable for others who may work on or review it. Well-commented code helps prevent misunderstandings and errors, and it’s especially useful in collaborative environments.

When to use it?

  • You’re preparing your code for a review or handoff to another developer or team.
  • Your codebase lacks sufficient documentation, making it hard to understand.
  • You want to ensure that complex logic or unique implementations are clearly explained.
  • You’re maintaining code that may be revisited later, either by yourself or others.

How to use it?

1

Select code

Select the code you want to generate comments for.

2

Select command

Right-click to open the context menu, select WiseGPT, and then select Generate Comments.

tip

You can also click on the light bulb (💡) icon next to the selected code, then select Generate Comments.

3

Review code

WiseGPT will generate appropriate comments for the selected code. Review these comments and apply them to your codebase.

Generate Comments

Before:

Before

After:

After