the-language icon indicating copy to clipboard operation
the-language copied to clipboard

Line comment characters not comment coloured

Open GufNZ opened this issue 1 year ago • 12 comments

In most languages, both block comment delimiters and line comment delimiters are coloured the same. Here, only block comment delimiters are. Is that a bug? If not, what do I do to configure the colour it uses?

GufNZ avatar Jul 19 '23 11:07 GufNZ

The following settings control comment colors:

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "comment.line.double-slash",
                "settings": {
                    "foreground": "#555555"
                }
            },
            {
                "scope": "comment.block",
                "settings": {
                    "foreground": "#555555"
                }
            },
            {
                "scope": "comment.block.punctuation.annotation, comment.block.annotation, comment.line.double-slash.punctuation.annotation, comment.line.double-slash.annotation",
                "settings": {
                    "foreground": "#77AAAA"
                }
            },
            {
                "scope": "comment.block.todo, comment.line.double-slash.todo",
                "settings": {
                    "foreground": "#77AAAA"
                }
            },
            {
                "scope": "comment.block.punctuation.annotation.note, comment.block.annotation.note, comment.line.double-slash.punctuation.annotation.note, comment.line.double-slash.annotation.note",
                "settings": {
                    "foreground": "#779999"
                }
            },
            {
                "scope": "comment.block.note, comment.line.double-slash.note",
                "settings": {
                    "foreground": "#597979"
                }
            },
            {
                "scope": "comment.block.punctuation.annotation.urgent, comment.block.annotation.urgent, comment.line.double-slash.punctuation.annotation.urgent, comment.line.double-slash.annotation.urgent",
                "settings": {
                    "foreground": "#FF4444"
                }
            },
            {
                "scope": "comment.block.urgent, comment.line.double-slash.urgent",
                "settings": {
                    "foreground": "#ff6f6f"
                }
            },
            {
                "scope": "comment.block.punctuation.annotation.nocheckin, comment.block.annotation.nocheckin, comment.line.double-slash.punctuation.annotation.nocheckin, comment.line.double-slash.annotation.nocheckin",
                "settings": {
                    "foreground": "#FF0000"
                }
            },
            {
                "scope": "comment.block.nocheckin, comment.line.double-slash.nocheckin",
                "settings": {
                    "foreground": "#FF0000"
                }
            },
            {
                "scope": "comment.block.punctuation.annotation.release, comment.block.annotation.release, comment.line.double-slash.punctuation.annotation.release, comment.line.double-slash.annotation.release",
                "settings": {
                    "foreground": "#9fc44b"
                }
            },
            {
                "scope": "comment.block.release, comment.line.double-slash.release",
                "settings": {
                    "foreground": "#9fc44b"
                }
            },
            {
                "scope": "comment.block.signature,  comment.line.double-slash.signature, comment.block.punctuation.signature,  comment.line.double-slash.punctuation.signature",
                "settings": {
                    "foreground": "#557777"
                }
            },
            {
                "scope": "comment.block.punctuation.checklist.brackets.todo, comment.line.double-slash.punctuation.checklist.brackets.todo",
                "settings": {
                    "foreground": "#AA4444"
                }
            },
            {
                "scope": "comment.block.checklist.item.todo, comment.line.double-slash.checklist.item.todo",
                "settings": {
                    "foreground": "#995555"
                }
            },
            {
                "scope": "comment.block.punctuation.checklist.brackets.partial, comment.block.punctuation.checklist.mark.partial, comment.line.double-slash.punctuation.checklist.brackets.partial, comment.line.double-slash.checklist.mark.partial",
                "settings": {
                    "foreground": "#998844"
                }
            },
            {
                "scope": "comment.block.checklist.item.partial, comment.line.double-slash.checklist.item.partial",
                "settings": {
                    "foreground": "#886655"
                }
            },
            {
                "scope": "comment.block.punctuation.checklist.brackets.done, comment.block.punctuation.checklist.mark.done, comment.line.double-slash.punctuation.checklist.brackets.done, comment.line.double-slash.punctuation.checklist.mark.done",
                "settings": {
                    "foreground": "#557755"
                }
            },
            {
                "scope": "comment.block.backquoted",
                "settings": {
                    "foreground": "#888888"
                }
            },
            {
                "scope": "comment.line.double-slash.backquoted",
                "settings": {
                    "foreground": "#888888"
                }
            },

onelivesleft avatar Jul 19 '23 11:07 onelivesleft

Thanks heaps (c:

chris-findlay avatar Jul 19 '23 18:07 chris-findlay

These just go in settings.json?

GufNZ avatar Jul 19 '23 21:07 GufNZ

Also, is there a list somewhere of all the things that can be configured?

GufNZ avatar Jul 19 '23 21:07 GufNZ

Hmm. Tried setting all of those to the same green in settings.json and nothing changed. What did I miss?

GufNZ avatar Jul 19 '23 21:07 GufNZ

Here's all my settings. If you want to see the grammar scopes list for the current cursor position, hit ctrl-shift-p and type "dev": pick Developer: Inspect Editor Tokens and Scopes.

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "comment.line.double-slash",
            "settings": {
                "foreground": "#555555"
            }
        },
        {
            "scope": "comment.block",
            "settings": {
                "foreground": "#555555"
            }
        },
        {
            "scope": "comment.block.punctuation.annotation, comment.block.annotation, comment.line.double-slash.punctuation.annotation, comment.line.double-slash.annotation",
            "settings": {
                "foreground": "#77AAAA"
            }
        },
        {
            "scope": "comment.block.todo, comment.line.double-slash.todo",
            "settings": {
                "foreground": "#77AAAA"
            }
        },
        {
            "scope": "comment.block.punctuation.annotation.note, comment.block.annotation.note, comment.line.double-slash.punctuation.annotation.note, comment.line.double-slash.annotation.note",
            "settings": {
                "foreground": "#779999"
            }
        },
        {
            "scope": "comment.block.note, comment.line.double-slash.note",
            "settings": {
                "foreground": "#597979"
            }
        },
        {
            "scope": "comment.block.punctuation.annotation.urgent, comment.block.annotation.urgent, comment.line.double-slash.punctuation.annotation.urgent, comment.line.double-slash.annotation.urgent",
            "settings": {
                "foreground": "#FF4444"
            }
        },
        {
            "scope": "comment.block.urgent, comment.line.double-slash.urgent",
            "settings": {
                "foreground": "#ff6f6f"
            }
        },
        {
            "scope": "comment.block.punctuation.annotation.nocheckin, comment.block.annotation.nocheckin, comment.line.double-slash.punctuation.annotation.nocheckin, comment.line.double-slash.annotation.nocheckin",
            "settings": {
                "foreground": "#FF0000"
            }
        },
        {
            "scope": "comment.block.nocheckin, comment.line.double-slash.nocheckin",
            "settings": {
                "foreground": "#FF0000"
            }
        },
        {
            "scope": "comment.block.punctuation.annotation.release, comment.block.annotation.release, comment.line.double-slash.punctuation.annotation.release, comment.line.double-slash.annotation.release",
            "settings": {
                "foreground": "#9fc44b"
            }
        },
        {
            "scope": "comment.block.release, comment.line.double-slash.release",
            "settings": {
                "foreground": "#9fc44b"
            }
        },
        {
            "scope": "comment.block.signature,  comment.line.double-slash.signature, comment.block.punctuation.signature,  comment.line.double-slash.punctuation.signature",
            "settings": {
                "foreground": "#557777"
            }
        },
        {
            "scope": "comment.block.punctuation.checklist.brackets.todo, comment.line.double-slash.punctuation.checklist.brackets.todo",
            "settings": {
                "foreground": "#AA4444"
            }
        },
        {
            "scope": "comment.block.checklist.item.todo, comment.line.double-slash.checklist.item.todo",
            "settings": {
                "foreground": "#995555"
            }
        },
        {
            "scope": "comment.block.punctuation.checklist.brackets.partial, comment.block.punctuation.checklist.mark.partial, comment.line.double-slash.punctuation.checklist.brackets.partial, comment.line.double-slash.checklist.mark.partial",
            "settings": {
                "foreground": "#998844"
            }
        },
        {
            "scope": "comment.block.checklist.item.partial, comment.line.double-slash.checklist.item.partial",
            "settings": {
                "foreground": "#886655"
            }
        },
        {
            "scope": "comment.block.punctuation.checklist.brackets.done, comment.block.punctuation.checklist.mark.done, comment.line.double-slash.punctuation.checklist.brackets.done, comment.line.double-slash.punctuation.checklist.mark.done",
            "settings": {
                "foreground": "#557755"
            }
        },
        {
            "scope": "comment.block.backquoted",
            "settings": {
                "foreground": "#888888"
            }
        },
        {
            "scope": "comment.line.double-slash.backquoted",
            "settings": {
                "foreground": "#888888"
            }
        },
        {
            "scope": "markup.quote.comment",
            "settings": {
                "foreground": "#333333"
            }
        },
        {
            "scope": "punctuation.definition.comment",
            "settings": {
                "foreground": "#555555"
            }
        },
        {
            "scope": "variable.annotation",
            "settings": {
                "foreground": "#7469a1"
            }
        },
        {
            "scope": "variable.annotation.parameter",
            "settings": {
                "foreground": "#7d7799"
            }
        },
        {
            "scope": "punctuation.section.parens.annotation",
            "settings": {
                "foreground": "#7469a1"
            }
        },
        {
            "scope": "punctuation.definition.annotation",
            "settings": {
                "foreground": "#7469a1"
            }
        },
        {
            "scope": "keyword.declaration",
            "settings": {
                "foreground": "#a38888"
            }
        },
        {
            "scope": "keyword.operator",
            "settings": {
                "foreground": "#a38888"
            }
        },
        {
            "scope": "keyword.operator.pointer",
            "settings": {
                "foreground": "#a38888"
            }
        },
        {
            "scope": "keyword.other",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "keyword.other.directive",
            "settings": {
                "foreground": "#bba337"
            }
        },
        {
            "scope": "keyword.control",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "keyword.control.jump, keyword.other.directive.asm",
            "settings": {
                "foreground": "#be5a5a"
            }
        },
        {
            "scope": "keyword.declaration.struct",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "keyword.declaration.enum",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "keyword.declaration.union",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "keyword.control.cast",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "support.type",
            "settings": {
                "foreground": "#9c673f"
            }
        },
        {
            "scope": "support.class",
            "settings": {
                "foreground": "#d69562"
            }
        },
        {
            "scope": "support.function",
            "settings": {
                "foreground": "#a07171"
            }
        },
        {
            "scope": "support.variable",
            "settings": {
                "foreground": "#a07171"
            }
        },
        {
            "scope": "storage.type",
            "settings": {
                "foreground": "#a87a45"
            }
        },
        {
            "scope": "storage.modifier",
            "settings": {
                "foreground": "#d38686"
            }
        },
        {
            "scope": "entity.name.enum",
            "settings": {
                "foreground": "#a87a45"
            }
        },
        {
            "scope": "entity.name.struct",
            "settings": {
                "foreground": "#a87a45"
            }
        },
        {
            "scope": "variable.other.declaration, variable.other.constant.declaration",
            "settings": {
                "foreground": "#cc9e58"
            }
        },
        {
            "scope": "variable.other",
            "settings": {
                "foreground": "#d3af86e7"
            }
        },
        {
            "scope": "variable.other.constant",
            "settings": {
                "foreground": "#d3af86e7"
            }
        },
        {
            "scope": "variable.enum",
            "settings": {
                "foreground": "#bb9161"
            }
        },
        {
            "scope": "variable.parameter",
            "settings": {
                "foreground": "#d3af86e7"
            }
        },
        {
            "scope": "punctuation",
            "settings": {
                "foreground": "#a88f73"
            }
        },
        {
            "scope": "punctuation.separator",
            "settings": {
                "foreground": "#7a6852"
            }
        },
        {
            "scope": "punctuation.terminator",
            "settings": {
                "foreground": "#757c50"
            }
        },
        {
            "scope": "punctuation.definition.generic",
            "settings": {
                "foreground": "#aa81b4"
            }
        },
        {
            "scope": "punctuation.section",
            "settings": {
                "foreground": "#8d8071"
            }
        },
        {
            "scope": "punctuation.section.braces",
            "settings": {
                "foreground": "#504232"
            }
        },
        {
            "scope": "entity.name.function",
            "settings": {
                "foreground": "#a88960"
            }
        },
        {
            "scope": "constant.language",
            "settings": {
                "foreground": "#bb9161"
            }
        },
        {
            "scope": "constant.numeric",
            "settings": {
                "foreground": "#bb9161"
            }
        },
        {
            "scope": "keyword.other.directive.string",
            "settings": {
                "foreground": "#546483"
            }
        },
        {
            "scope": "string.quoted",
            "settings": {
                "foreground": "#7d8ba3"
            }
        },
        {
            "scope": "string.unquoted",
            "settings": {
                "foreground": "#7d8ba3"
            }
        },
        {
            "scope": "punctuation.definition.string",
            "settings": {
                "foreground": "#546483"
            }
        },
        {
            "scope": "punctuation.definition.string.empty",
            "settings": {
                "foreground": "#7d8ba3"
            }
        },
        {
            "scope": "constant.other.stringdelimiter.here.embed",
            "settings": {
                "foreground": "#34155e"
            }
        },
        {
            "scope": "constant.other.stringdelimiter.here.embed.language",
            "settings": {
                "foreground": "#5d3e88"
            }
        },
        {
            "scope": "constant.other.stringdelimiter",
            "settings": {
                "foreground": "#504232"
            }
        },
        {
            "scope": "constant.character.escape",
            "settings": {
                "foreground": "#a07171"
            }
        },
        {
            "scope": "constant.other.placeholder, string.here keyword.operator.percent",
            "settings": {
                "foreground": "#b650b9"
            }
        },
        {
            "scope": "support.type.property-name",
            "settings": {
                "foreground": "#d3a168"
            }
        },
        {
            "scope": "keyword.other.directive.scope, keyword.other.main",
            "settings": {
                "foreground": "#6faf5f"
            }
        },
        {
            "scope": "entity.name.namespace",
            "settings": {
                "foreground": "#814b6e"
            }
        },
        {
            "scope": "entity.name.namespace.member",
            "settings": {
                "foreground": "#a87a45"
            }
        },
        {
            "scope": "keyword.control.import",
            "settings": {
                "foreground": "#8d6780"
            }
        },
        {
            "scope": "string-quoted.other.import",
            "settings": {
                "foreground": "#c793b6"
            }
        },
        {
            "scope": "constant.other.import",
            "settings": {
                "foreground": "#a74b88"
            }
        },
        {
            "scope": "punctuation.definition.string.import",
            "settings": {
                "foreground": "#573e4e"
            }
        },
        {
            "scope": "invalid.deprecated",
            "settings": {
                "foreground": "#dd2d68"
            }
        },
        {
            "scope": "punctuation.definition.string.deprecated",
            "settings": {
                "foreground": "#6e3e4e"
            }
        },
        {
            "scope": "string-quoted.other.deprecated",
            "settings": {
                "foreground": "#db5d87"
            }
        },
        {
            "scope": "support.type.property-name.json",
            "settings": {
                "foreground": "#b45f8e"
            }
        },
        {
            "scope": "punctuation.definition.dictionary.begin.json, punctuation.definition.dictionary.end.json",
            "settings": {
                "foreground": "#8253af"
            }
        },
        {
            "scope": "punctuation.definition.array.begin.json, punctuation.definition.array.end.json",
            "settings": {
                "foreground": "#4faa5b"
            }
        },
        {
            "scope": "source.guy, punctuation.equals.guy",
            "settings": {
                "foreground": "#9e9e9e",
                "foregroundx": "#859797"
            }
        },
        {
            "scope": "meta.namespace.guy",
            "settings": {
                "foreground": "#0b0b18"
            }
        },
        {
            "scope": "constant.other.label.guy, punctuation.label.guy",
            "settings": {
                "foreground": "#ca684a"
            }
        },
        {
            "scope": "constant.other.label.declaration.guy, punctuation.label.declaration.guy",
            "settings": {
                "foreground": "#db953f"
            }
        },
        {
            "scope": "constant.numeric.guy, punctuation.constant.guy",
            "settings": {
                "foreground": "#a1b4b4"
            }
        },
        {
            "scope": "constant.numeric.declaration.guy, punctuation.constant.declaration.guy",
            "settings": {
                "foreground": "#bdbdbd"
            }
        },
        {
            "scope": "variable.other.register.guy, punctuation.register.guy",
            "settings": {
                "foreground": "#a58d97"
            }
        },
        {
            "scope": "variable.other.declaration.register.guy, punctuation.register.declaration.guy",
            "settings": {
                "foreground": "#D38686"
            }
        },
        {
            "scope": "keyword.other.register.guy, keyword.other.register.guy punctuation.register.guy",
            "settings": {
                "foreground": "#76bdb9"
            }
        },
        {
            "scope": "keyword.other.register.zero.guy, punctuation.register.zero.guy",
            "settings": {
                "foreground": "#e66a6a"
            }
        },
        {
            "scope": "keyword.other.register.one.guy, punctuation.register.one.guy",
            "settings": {
                "foreground": "#b0b658"
            }
        },
        {
            "scope": "keyword.other.register.two.guy, punctuation.register.two.guy",
            "settings": {
                "foreground": "#759cd6"
            }
        },
        {
            "scope": "keyword.other.register.three.guy, punctuation.register.three.guy",
            "settings": {
                "foreground": "#bc8ed6"
            }
        },
        {
            "scope": "keyword.other.register.four.guy, punctuation.register.four.guy",
            "settings": {
                "foreground": "#56d1b2"
            }
        },
        {
            "scope": "keyword.other.register.five.guy, punctuation.register.five.guy",
            "settings": {
                "foreground": "#3eb395"
            }
        },
        {
            "scope": "keyword.other.register.six.guy, punctuation.register.six.guy",
            "settings": {
                "foreground": "#3ca188"
            }
        },
        {
            "scope": "keyword.other.register.seven.guy, punctuation.register.seven.guy",
            "settings": {
                "foreground": "#298883"
            }
        },
        {
            "scope": "keyword.control.jump.jmp.guy, keyword.control.jump.fwd.guy, keyword.control.jump.bck.guy, keyword.control.jump.call.guy, keyword.control.jump.ret.guy",
            "settings": {
                "foreground": "#c54b4b"
            }
        },
        {
            "scope": "keyword.other.guy",
            "settings": {
                "foreground": "#9e9e9e",
                "foregroundz": "#859797"
            }
        },
        {
            "scope": "keyword.other.directive.guy",
            "settings": {
                "foreground": "#b671b0"
            }
        },
        {
            "scope": "keyword.other.communication.guy",
            "settings": {
                "foreground": "#9e9e9e"
            }
        },
        {
            "scope": "keyword.other.cmp.guy",
            "settings": {
                "foreground": "#9e9e9e"
            }
        },
        {
            "scope": "keyword.other.action.guy",
            "settings": {
                "foreground": "#9e9e9e",
                "fontStyle": "underline"
            }
        },
        {
            "scope": "keyword.other.info.guy",
            "settings": {
                "foreground": "#9e9e9e"
            }
        },
        {
            "scope": "keyword.other.debug.guy",
            "settings": {
                "foreground": "#50bd46"
            }
        },
        {
            "scope": "variable.annotation.debug.guy",
            "settings": {
                "foreground": "#50bd46"
            }
        },
        {
            "scope": "punctuation.definition.annotation.begin.guy, punctuation.definition.annotation.end.guy, variable.annotation.guy",
            "settings": {
                "foreground": "#add885"
            }
        },
        {
            "scope": "punctuation.definition.annotation.begin.debug.guy, punctuation.definition.annotation.end.debug.guy",
            "settings": {
                "foreground": "#add885"
            }
        },
        {
            "scope": "keyword.operator.guy",
            "settings": {
                "foreground": "#c54b4b"
            }
        },
        {
            "scope": "keyword.operator.stringcount",
            "settings": {
                "foreground": "#4b74c7"
            }
        },
        {
            "scope": "comment.line.semicolon.guy, comment.line.semicolon.guy punctuation.comment.guy",
            "settings": {
                "foreground": "#555555"
            }
        },
        {
            "scope": "punctuation.separator.guy",
            "settings": {
                "foreground": "#ffffff",
                "fontStyle": "bold"
            }
        }
    ]
}

onelivesleft avatar Jul 19 '23 21:07 onelivesleft

"Hmm. Tried setting all of those to the same green in settings.json and nothing changed. What did I miss?"

The highlighting can bug out, if you have paren or quotes in the comment I think

onelivesleft avatar Jul 19 '23 21:07 onelivesleft

I'm looking at how_to\002_number_types.jai so I don't think it's that...

GufNZ avatar Jul 19 '23 21:07 GufNZ

image image

GufNZ avatar Jul 19 '23 21:07 GufNZ

Might try restarting VSC...no change.

GufNZ avatar Jul 19 '23 21:07 GufNZ

Aha: punctuation.definition.comment. Thanx for the TIL too (c: I'd never got round to configuring colours in VSC, but now I know how, I might just do that.

GufNZ avatar Jul 19 '23 21:07 GufNZ

Might be good to have a page listing any scopes you added to make this easier for anyone else. But as far as this goes I have what I need. Meanwhile, do you happen to know how I discover what are valid inside settings? So far I've found foreground and fontStyle but don't know what else is supported.

GufNZ avatar Jul 19 '23 22:07 GufNZ