How to show custom warning in IDE problems window

28 views
Skip to first unread message

Ivan Dubovenko

unread,
Jun 19, 2020, 11:35:59 AM6/19/20
to Dart Analyzer Discussion
When I'm coding, sometimes I need to change some piece of code only for short period of time and before creating merge request turn it back to previous version. Often I can forget to do it and usually I set `//TODO change it back` mark. But now in project there are lot of TODOs and it's difficult to recognize my TODOs among the others. Can I put something like `//WARNING change it back` to clearly show it in my IDE problems window? 

Brian Wilkerson

unread,
Jun 19, 2020, 12:36:46 PM6/19/20
to analyzer...@dartlang.org
No, there isn't currently any support for inserting comments in code that are then flagged as warnings.

You could open an issue to request such a feature (https://github.com/dart-lang/sdk/issues/new). That would allow us to gauge interest within the community. Also, if you're aware of any other systems that have support for such a feature, reference to them would be useful to include with the request. I don't know how likely we are to add such a feature, though.

On Fri, Jun 19, 2020 at 8:36 AM Ivan Dubovenko <ivan...@gmail.com> wrote:
When I'm coding, sometimes I need to change some piece of code only for short period of time and before creating merge request turn it back to previous version. Often I can forget to do it and usually I set `//TODO change it back` mark. But now in project there are lot of TODOs and it's difficult to recognize my TODOs among the others. Can I put something like `//WARNING change it back` to clearly show it in my IDE problems window? 

--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/622aeaf8-314d-46d8-88d5-067dfb6215e0o%40dartlang.org.

Matthew Butler

unread,
Jun 19, 2020, 12:59:30 PM6/19/20
to Dart Analyzer Discussion
Just as a separate note, I'm not sure which IDE you're using, but quite often you can implement this functionality inside of your IDE itself rather than using a language specific analyzer to generate those messages. 
As an example, here is how you can do this with WebStorm
https://www.jetbrains.com/help/idea/using-todo.html

Visual Studio Code has a plethora of extensions that allow something similar.
https://marketplace.visualstudio.com/search?term=TODO&target=VSCode&category=All%20categories&sortBy=Relevance

Also, if you're currently only using "TODO" in your comments, out of the box many IDE's have similar support for "FIXME" comments that are highlighted similar to TODO but often have a different notification type/style/color, etc, to differentiate them from TODO comments.

Matt
Reply all
Reply to author
Forward
0 new messages