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:

{
  // Millisecond delay for update decorations, default 0
  "better-comments.updateDelay": 0,
  // Preload lines outside the visible window for better performance, default 100
  "better-comments.preloadLines": 100,
  // Enable/disable hightlight plain text.
  "better-comments.highlightPlainText": false,
  // Custom languages comments configuration
  "better-comments.languages": [
    {
      "id": "proto3", // (Required) Language ID
      "comments": { "lineComment": "//", "blockComment": ["/*", "*/"] }, // (Optional) Comment Syntax
      "embeddedLanguages": [], // (Optional) Embedded Languages. Example for HTML: ["css", "javascript"]
      "useDocComment": false // (Optional) Use Doc Comments
    }
  ],
  // 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

All languages supported:

  • Auto detected languages comments rules from extension configuration.
  • Manual configured languages comments rules by "better-comments.languages".