Skip to content

Comment Snippets

Vinicius Reif Biavatti edited this page Sep 21, 2022 · 2 revisions

If you are using VSCode as the IDE for the development, you can use some snippets to facilitate the generation of docstrings and section comments.

To create a snippet, just create a file with the name python.code-snippets.json into .vscode folder with the content below. After configure it, you can start using the snippets following table:

Snippet Description
## Section Comment
### Sub Section Comment

python.code-snippets.json

{
    "Section Comment": {
        "scope": "python",
        "prefix": "##",
        "body": [
            "###############################################################################",
            "# ${1:comment}",
            "###############################################################################"
        ],
        "description": "Create a top-level section comment"
    },
    "Sub Section Comment": {
        "scope": "python",
        "prefix": "###",
        "body": [
            "###########################################################################",
            "# ${1:comment}",
            "###########################################################################"
        ],
        "description": "Create a second-level section comment"
    }
}
Clone this wiki locally