Couldn't use vs code ''better comments extension'' for Python

Question:

Better comments is an extension in VS Code that helps to write comments in different colors. For good readability, it is very useful. Almost all popular languages are supported. I could to use in C programming but somehow couldn’t use it in Python.

comments look like in the image

enter image description here

Asked By: mrProgrammer

||

Answers:

If you look at the Better Comments documentation, you will need to configure the colors yourself:

This extension can be configured in User Settings or Workspace settings.

The comment highlighting doesn’t automatically highlight certain comments, but allows you to do so.

Answered By: Jacob Lee

This extension can be configured in User Settings or Workspace settings.

"better-comments.multilineComments": true

This setting will control whether multiline comments are styled using the annotation tags. When false, multiline comments will be presented without decoration.

"better-comments.highlightPlainText": false

This setting will control whether comments in a plain text file are styled using the annotation tags. When true, the tags (defaults: ! * ? //) will be detected if they’re the first character on a line.

Ref: Better Comments Doc

Answered By: VeeraLavan

I was struggling to figure it out but finally got it. My json setting is below. Basically 1) Avoid the first line, 2) Add "#" followed by the tag as per your settings.json file and then anything. This worked for me.

 "better-comments.multilineComments": true,
    "better-comments.highlightPlainText": false,
    "better-comments.tags": [
        {
          "tag": "!!",
          "color": "#F6FF33",
          "strikethrough": false,
          "backgroundColor": "transparent"
        },
        {
          "tag": "?",
          "color": "#3498DB",
          "strikethrough": false,
          "backgroundColor": "transparent"
        },
        {
          "tag": "TODO",
          "color": "#FF8C00",
          "strikethrough": false,
          "backgroundColor": "transparent"
        },
        {
          "tag": "//",
          "color": "#68FF33",
          "strikethrough": false,
          "backgroundColor": "transparent"
        }
        {
          "tag": "**",
          "color": "#FF33EC",
          "strikethrough": false,
          "backgroundColor": "transparent"
        }
      ]

Answered By: akash
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.