1
votes

Is there a way to configure Eclipse to treat a "task tag" (TODO, FIXME) as a compile warning, and show it in the Problems tab instead of (or in addition to) the Tasks tab?

Task tags are configured in Eclipse under Preferences > Java > Compiler > Task Tags, as described in this question: How do I enable TODO/FIXME/XXX task tags in Eclipse?

A related question asks if there's a way to make user-defined annotations appear as warnings (and the accepted answer is basically "no"): Generate compiler warning with user defined annotation

I'm trying to find a way to increase the visibility of certain task tags in our project to reduce the chance of someone accidentally committing debugging/temporary/diagnostic code. If we get in the habit of marking such code "// DEBUG" or something, and configure Eclipse appropriately to show a warning, this will probably happen a lot less often.

1
Is the settable Priority value on the relevant Task Tags preference page not sufficient?nitind
@nitind Thanks, but no: changing the priority doesn't make the task tag appear in "Problems," it just changes the value of the Priority column in "Tasks." The question is specifically about getting these to show up in "Problems."TypeIA
@nitind is right and that should be the accepted answer to your specific question. But in the category of trying to solve your problem, would a git hook work e.g. if you can get everyone on your project to get in the habit of using the // DEBUG marker you can verify the code does not have any of them at push time, or maybe even a warning at commit time on their local clone (assuming you are using git of course, svn and other tools have their own hooks too)Jonah Graham
@JonahGraham Thanks, the git hook is a good idea. We might try that.TypeIA

1 Answers

2
votes

No. Marker types are hierarchical, and the Tasks and Problems marker types are siblings, not parent/child. The Tasks and Problems Views show the respective hierarchies starting with those base marker types, so there won't be any overlap unless someone's done something loopy by declaring one that extends both. The Markers View will show both kinds, though.