Packages: // TODO ..., // FIXME... and other annotations

Created on 16 May 2018  路  6Comments  路  Source: sublimehq/Packages

None of the syntaxes seem to match annotations in the form:

{COMMENT_START} (FIXME|NOTE|README|TODO|XXX|WIP).*

In PHP

// TODO ...

In Python

# TODO ...

They are sometimes matched when starting with @, but usually only in multiline comments e.g. in PHP:

/**
 * @todo ...
 */

I propose adding scopes for annotations in the form, where the @ is not required, the annotations are case-sensitive, and they are valid in both single line and multiline comments:

^COMMENT_START @?(annotation_names...).*`$

If that's agreeable, the only question is what should the scope names be?

Most helpful comment

this has previously been discussed at https://github.com/sublimehq/Packages/issues/212 and on the forums

All 6 comments

this has previously been discussed at https://github.com/sublimehq/Packages/issues/212 and on the forums

FWIW, I use the annotations plugin for SublimeLinter to do this. I don't think it should be part of a language syntax.

JS Custom highlights // @flow comments, but it doesn't support general comment-based annotations. It would be possible to modify the core syntax to allow extensions to easily add such annotations.

I propose it would NOT be case sensitive, I use
// toDo:
and I've seen ToDo, TODO and todo all over the place : )

Thanks to @TheSecEng, there is also the Colored Comments package. I still assert this should not be a part of a syntax definition.

Thanks to @TheSecEng, there is also the Colored Comments package.

That does the trick, thanks so much!

Was this page helpful?
0 / 5 - 0 ratings