Forked from aaron-bond/better-comments v3.0.2
- Fix matching errors.
- All languages supported.
- Custom comments configuration for languages configurated by
vscode.languages.setLanguageConfigurationSee #11 - Embedded languages supported. Like SFC of Vue, markdown, HTML, etc. See #388
- Remote workspace supported. See #507
- Web editor supported.
- Theme switchable. Different tag config for light and dark themes. See #506
- Allow multiple tags per item. See #33
- Multi-line comment supported. See #7
- Tags panel: browse every tagged comment of the workspace, grouped by file or by tag.
The Better Comments Next extension will help you create more human-friendly comments in your code. With this extension, you will be able to categorize 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
The Better Comments view in the Explorer lists every tagged comment of the workspace — not just the open file — with the same tags the editor highlights.
- Two browsing dimensions: grouped by file (the workspace folder structure is preserved, directories nest) or by tag (every
TODOof the workspace together). Switch from the view title bar;better-comments.panelGroupByonly sets the initial dimension. - Click a comment to open its file with the cursor on the tag.
- The view carries its own icon, so dragging it to the activity bar (or the secondary side bar) gives the panel a dedicated entry.
- The scan resolves each file's language from the languages your extensions contribute, without opening the files in the editor, and reuses the very same matching pipeline as the decorations — panel and highlights can never drift apart.
- With
better-comments.panelAutoRefresh(default on), file watcher events — an edit, a build, a git checkout — refresh only the touched files; deleted files leave the panel.
Settings:
| Setting | Default | Description |
|---|---|---|
better-comments.panelEnabled |
true |
Show the panel view. |
better-comments.panelGroupBy |
'file' |
Initial browsing dimension: 'file' or 'tag'. |
better-comments.panelAutoRefresh |
true |
Refresh the panel when files change on disk. |
better-comments.panelScanOnStartup |
true |
Scan the workspace once when the panel view becomes visible. |
better-comments.panelIncludeGlobs |
[] |
Only scan files matching these globs; empty means every file. |
better-comments.panelExcludeGlobs |
['**/.git/**'] |
Globs always excluded; they take precedence over include globs and .gitignore. |
better-comments.panelUseGitignore |
true |
Respect .gitignore files, including nested ones. An approximation: negated patterns (!keep) cannot be expressed in an exclude filter and are skipped. |
better-comments.panelMaxFileSize |
512 |
Skip files larger than this size, in kilobytes. |
better-comments.panelMaxFiles |
5000 |
Stop scanning after this many files. |
better-comments.panelShowCounts |
true |
Show the comment count on the file and tag nodes. |
Default setting as below:
"better-comments.strict": true
"better-comments.strict": false
By default a tag is matched as a literal string. The optional per-tag "tagMode" field lets a tag match dynamically:
"text"(default) — match the tag as a literal string."wildcard"— interpret the tag as a glob pattern:*matches any run of characters,?matches any single character; every other character is matched literally."regex"— interpret the tag as a raw JavaScript regular expression. Named capture groups are not allowed (they collide with internal matching groups), and an invalid pattern falls back to a literal match.
Tags without "tagMode" stay literal, so the default tags (including *, ?, !, //) keep working exactly as before.
{
"better-comments.tags": [
{
// matches "// todo[FOO-123]: ..." — brackets are literal, "*" is the wildcard
"tag": "todo[*]",
"tagMode": "wildcard",
"color": "#FF8C00"
},
{
// matches "// @ticket: ..." via a raw regex
"tag": "@\\w+",
"tagMode": "regex",
"color": "#3498DB"
}
]
}All languages supported:
- Auto detected languages comments rules from extension configuration.
- Manual configured languages comments rules by
"better-comments.languages".



{ // 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 highlight plain text. "better-comments.highlightPlainText": false, // Highlight entire line of line comment "better-comments.fullHighlight": false, // Strict mode of tag matching. Default true "better-comments.strict": true, // 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 }, { "tag": "bug", "color": "#E84393", "strikethrough": false, "underline": true, "backgroundColor": "#FDA7DF20", "bold": true, "italic": false }, { "tag": "hack", "color": "#9B59B6", "strikethrough": false, "underline": false, "backgroundColor": "#9B59B620", "bold": true, "italic": true }, { "tag": [ "fixme", "fix-me", "fix" ], "color": "#FD79A8", "strikethrough": false, "underline": false, "backgroundColor": "#FD79A820", "bold": true, "italic": false } ] }