Open Number-3434 opened 6 months ago
It's difficult to provide default colouring for custom things like this because we don't know what colours themes will use. It could be useful to add Semantic Token modifiers to those regions though (allowing them to be customised in VS Code settings). I don't know if the semantic tokens code currently has access to the TODO regions though (as they usually produce diagnostics and are not part of the AST).
Okay, thanks! Sorry, I meant just to provide the textmate grammars, not necessarily colouring.
Would it be necessary to use semantic highlighting?
Hopefully this could just use basic syntax highlighting?
VS Code only supports using either the TextMate grammar or Semantic Tokens. Implementing this only in the TextMate grammar means any highlighting would appear when you open a file and then quickly disappear when replaced with semantic tokens colouring.
I don't know how many themes support Semantic Tokens, but the default VS Code ones I use do, so I suspect this would be the majority of users.
I'd like to try and have the two highlights converge over time, so I don't think we should add anything to the grammar before semantic tokens have the same support.
This implementation will be helpful.
Proposal
Please add syntax highlighting for
TODO
,FIXME
,HACK
,UNDONE
, ignore:, and ignore_for_file: comments.These could then be coloured, increasing clarity, as some users may be unaware that a particular comment actually has some sort of function to it.
Comments
TODO
CommentsFor
TODO
comments, according toflutter_style_todos
and theFlutter Style Guide
:The examples below demonstrate the different parts to highlight in a
// TODO: message // TODO([github]-username): message // TODO([github]-username): message, [github]-URL-to-issueTODO
comment:Other Comments
For other comments, there are only four parts:
// HACK: message // FIXME: message // UNDONE: messageignore:
andignore_for_file:
The examples below demonstrate the different grammars in a
// [ignore]: [some_lint] // [ignore]: [some_lint], [REASON](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#comment-all--ignores) // [ignore_for_file]: [some_lint] // [ignore_for_file]: [some_lint], [REASON](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#comment-all--ignores) // [ignore]: [some_lint_1], [some_lint_2] // [ignore_for_file]: [some_lint_1], [some_lint_2]ignore:
orignore_for_file:
comment:Tasklist