Skip to content

/docstring

Description

Automatically generate or improve docstrings for your code, enhancing documentation quality and maintainability. The /docstring command is designed to aid in creating comprehensive, clear, and consistent docstrings for functions, classes, and modules, following best documentation practices.

How to Use

To use the /docstring command, follow these steps:

  1. Select Your Mode: Choose the appropriate context for adding or improving docstrings. Qodo Gen supports this command in two modes:

    • Current File Focus: For generating or refining docstrings within a specific file, focusing on individual functions, classes, or entire files.
    • Git-Diff Focus: For a broader approach, encompassing multiple files within your changeset to ensure consistent documentation across your project.
  2. Select Your Focus: Identify the code segment or entire file for which you wish to generate or enhance the docstring.

  3. Initiate the Command: Type /docstring followed by an optional specific instruction or leave it blank for general docstring generation. Qodo Gen will analyze the selected code and generate a suitable docstring or suggest improvements to existing documentation.

  4. Review and Apply: Evaluate the suggested docstring provided by Qodo Gen. You can directly apply the changes with a single click or edit the suggestion to better fit your requirements before applying.

Docsctring for component (Current File Focus)

Commands:

/docstring


Response:

dosctring-file

Docstring for Changeset (Git-Diff Focus)

Commands:

/docstring enhance readability


Response:

docstring-workspace

Footer