ColoredComments
ColoredComments copied to clipboard
[enhancement] Support "VS Code Comment Anchor" style comment syntax?
I've not created a PR yet, as I'm not super familiar with ST4 plugins or this code base and this is more a config enhancement suggestion.
A fair amount of projects use the comment/anchor syntax from Starlane Studios Comment Anchors plugin for VS Code. I've built a config to support this sort of comment highlighting into Colored Comments for SublimeText.
I copied their colors and identifiers from here.
File: colored_comments.sublime-settings (P.S. it would be nice to be able to append to "tags" rather than overriding it completely and having to include the defaults manually also, maybe use a "tags" for default and merge in a "custom_tags" from the user file?)
{
"tags": {
// SECTION defauls included
// Friendly name for you to know what the purpose is
// and used in the OrderedDict
// These should be unique
"Important": {
// The name of the scope being use in your color scheme file
"scope": "comments.important",
// The actual identifier used to highlight the comments
"identifier": "!",
// Enables sublime.DRAW_SOLID_UNDERLINE
// Only noticable if outline = true
"underline": false,
// Enables sublime.DRAW_STIPPLED_UNDERLINE
// Only noticable if outline = true
"stippled_underline": false,
// Enables sublime.DRAW_SSQUIGGLY_UNDERLINE
// Only noticable if outline = true
"squiggly_underline": false,
// Enables sublime.DRAW_NO_FILL
// This disables coloring of text
// and allows for the outline of the text
"outline": false,
// Treats the identifier
// as an regular expression
"is_regex": false,
// Enables ignorecase for the ideentifier
"ignorecase": true,
},
"Deprecated": {
"scope": "comments.deprecated",
"identifier": "*",
},
"Question": {
"scope": "comments.question",
"identifier": "?",
},
"TODO": {
"scope": "comments.todo",
"identifier": "TODO[:]?|todo[:]?",
"is_regex": true,
"ignorecase": true,
},
"FIXME": {
"scope": "comments.fixme",
"identifier": "FIXME[:]?|fixme[:]?",
"is_regex": true
},
"UNDEFINED": {
"scope": "comments.undefined",
"identifier": "//[:]?",
"is_regex": true
},
// SECTION VS Code Comment Anchors Syntax Support
// LINK https://github.com/StarlaneStudios/vscode-comment-anchors/
"ANCHOR": {
"scope": "comments.anchor",
"identifier": "ANCHOR",
"ignorecase": true,
},
"STUB": {
"scope": "comments.stub",
"identifier": "STUB",
"ignorecase": true,
},
"NOTE": {
"scope": "comments.note",
"identifier": "NOTE",
"ignorecase": true,
},
"REVIEW": {
"scope": "comments.review",
"identifier": "REVIEW",
"ignorecase": true,
},
"SECTION": {
"scope": "comments.section",
"identifier": "SECTION[:]?|!SECTION[:]?",
"is_regex": true,
"ignorecase": true,
},
"LINK": {
"scope": "comments.link",
"identifier": "LINK",
"ignorecase": true,
},
}
}
then file: One Dark.sublime-color-scheme (I'm using a theme but the Starlane Anchor Comments colors are their own/universal):
{
// http://www.sublimetext.com/docs/3/color_schemes.html
"variables": {
"important_comment": "var(--orangish)",
"deprecated_comment": "var(--purplish)",
"question_comment": "var(--greenish)",
"todo_comment": "var(--bluish)",
"fixme_comment": "var(--redish)",
"undefined_comment": "var(--pinkish)",
},
"globals": {
// "foreground": "var(green)",
},
"rules": [
// NOTE default colors, modified for Theme One (One Dark) ST4 Theme
{
"name": "IMPORTANT COMMENTS",
"scope": "comments.important",
"foreground": "var(important_comment)",
"background": "var(--background)",
},
{
"name": "DEPRECATED COMMENTS",
"scope": "comments.deprecated",
"foreground": "var(deprecated_comment)",
"background": "var(--background)",
},
{
"name": "QUESTION COMMENTS",
"scope": "comments.question",
"foreground": "var(question_comment)",
"background": "var(--background)",
},
{
"name": "TODO COMMENTS",
"scope": "comments.todo",
"foreground": "var(todo_comment)",
"background": "var(--background)",
},
{
"name": "FIXME COMMENTS",
"scope": "comments.fixme",
"foreground": "var(fixme_comment)",
"background": "var(--background)",
},
{
"name": "UNDEFINED COMMENTS",
"scope": "comments.undefined",
"foreground": "var(undefined_comment)",
"background": "var(--background)",
},
// SECTION added colors for "StarlaneStudios/vscode-comment-anchors" syntax support
// LINK https://github.com/StarlaneStudios/vscode-comment-anchors/blob/f5a1471bb91e6de42c123fa982019be62d57f826/src/util/defaultTags.ts
{
"name": "ANCHOR COMMENTS",
"scope": "comments.anchor",
"foreground": "#A8C023",
"background": "var(--background)",
},
{
"name": "STUB COMMENTS",
"scope": "comments.stub",
"foreground": "#BA68C8",
"background": "var(--background)",
},
{
"name": "NOTE COMMENTS",
"scope": "comments.note",
"foreground": "#64DD17",
"background": "var(--background)",
},
{
"name": "REVIEW COMMENTS",
"scope": "comments.review",
"foreground": "#64DD17",
"background": "var(--background)",
},
{
"name": "SECTION COMMENTS",
"scope": "comments.section",
"foreground": "#896afc",
"background": "var(--background)",
},
{
"name": "LINK COMMENTS",
"scope": "comments.link",
"foreground": "#2ecc71",
"background": "var(--background)",
},
],
}