Documenting Code

With the Pieces Copilot in the Pieces for Sublime Text Plugin, you can easily generate comments that capture your code's functionality and intent.


Commenting Code Selections with Pieces Copilot

Pieces Copilot can review and comment on selected code, offering line-by-line explanations for better readability and understanding.

via Right-Click Menu

To add comments to your code:

1

Select Portion of Code

Select a portion of the code you’d like to comment.

2

Right Click and Find Option

Right click on your selection code portion and hover over Quick Actions.

3

Add Code Comments

Select Add Code Comments from the tertiary menu.

Pieces Copilot will then create clear, relevant comments for the selected code, allowing you to choose to Accept or Reject the suggested comments.

This feature is especially helpful for keeping your code easy to read and ensuring your codebase is well-documented.

Why Use Code Comments?

Code comments are essential for keeping a clean and well-documented codebase.

They provide context, allowing reviewers to focus on functionality while making complex logic clear, ensuring the code is easier to follow and maintain.

Good documentation improves code readability and speeds up onboarding for newcomers to the codebase. This dual benefit supports both current and future development, creating a strong foundation for upgrades and changes.

That's what makes this feature so valuable. Need a few hundred lines of code documented? No problem—just use Add Code Comments.

Updated on