Skip to content

edwinhuish/better-comments-next

 
 

Repository files navigation

Better Comments Next

Forked from aaron-bond/better-comments v3.0.2

Features

  • Fix matching errors.
  • All languages supported.
  • Custom comments configuration for languages configurated by vscode.languages.setLanguageConfiguration See #11
  • Embedded languages supported. Like SFC of Vue, markdown, HTML, etc. See #388
  • Remote workspace supported. See #507
  • Web editor supported.
  • Theme switchable. Defferent tag config for light and dark themes. See #506
  • Allow multiple tags per item. See #33
  • Multi-line comment supported. See #7

Decription

The Better Comments extension will help you create more human-friendly comments in your code. With this extension, you will be able to categorise your annotations into:

  • Alerts
  • Queries
  • TODOs
  • Highlights
  • Commented out code can also be styled to make it clear the code shouldn't be there
  • Any other comment styles you'd like can be specified in the settings

Annotated code

Configuration

Default setting as below:

{
  // Enable/disable hightlight plain text.
  "better-comments.highlightPlainText": false,
  // Custom languages comments configuration
  "better-comments.languages": [],
  // Overwrite the specified tag styles of `"better-comments.tags"` for light themes.
  "better-comments.tagsLight": [],
  // Overwrite the specified tag styles of `"better-comments.tags"` for dark themes.
  "better-comments.tagsDark": [],
  // Tags for decoration.
  "better-comments.tags": [
    {
      "tag": "#",
      "color": "#18b566",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": true,
      "italic": false
    },
    {
      "tag": "!",
      "color": "#FF2D00",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": "?",
      "color": "#3498DB",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": "//",
      "color": "#474747",
      "strikethrough": true,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": ["todo", "to-do"],
      "color": "#FF8C00",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false,
      "multiline": true
    },
    {
      "tag": "*",
      "color": "#98C379",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    }
  ]
}

Supported Languages

Most languages that your editor correctly recognizes.

better-comments-next reads the language configuration JSON in contributes.languages to know what comments look like in a language. Some language extensions provide that information dynamically via the vscode.languages.setLanguageConfiguration API method. This extension is unable to support those languages.