vektor
vektor

Reputation: 2916

Eclipse does not show TODO tasks

After upgrading to Eclipse Juno and importing an existing Java EE project, the Tasks view does not show TODOs from comments in my .java files. I can manually add new TODO tasks by specifically right-clicking the gutter and selecting Add Task... from the popup menu, but Eclipse should create TODOs from my comments on its own.

I went through all the preferences related to task tags, they are all default (thus OK), still no tags appear. I tried closing/opening the project, re-building it, I checked Git repo to see that no dot files (.project etc) were modified since everything worked in the older Eclipse.

This question did not help me... how to make Eclipse show my Java TODOs?

Upvotes: 18

Views: 14381

Answers (4)

MiaPlan.de
MiaPlan.de

Reputation: 122

Be sure to enable Project -> Build Automatically. Then trigger an auto-build by adding, removing or modifying a resource.

Upvotes: 0

Sandro
Sandro

Reputation: 1845

In my case I was just not aware of the fact that the project has to build correctly in order for the TODOs to show up. After I fixed the build errors there was no problem anymore to see the TODOs.

Upvotes: 5

user2619028
user2619028

Reputation: 320

The problem is Eclipse should rebuild the settings (probably a bug). The way to work around this is to start Windows > Preferences > Java > Compiler > Task Tags, then change any tag, then press apply; you will be asked if you allow settings to rebuild, accept. Then change back the altered tag and rebuild again. You should have immediately shown TODO in the Tasks view.

Upvotes: 21

vektor
vektor

Reputation: 2916

I investigated my .project file and found the following natures:

<natures>
    <nature>org.eclipse.ajdt.ui.ajnature</nature>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>

The first one refers to AspectJ that I use to process some annotations. I realized that the newly installed Eclipse does not contain AspectJ tools by default! After installing AJDT, my TODOs appeared in the Tasks view, thus solving the problem.

Weird thing is, why does not Eclipse complain about having a project with an unknown nature (=one there is no plugin for)? And why did this absence of AJDT cause the regular JDT to fail finding the TODOs?..

Upvotes: 9

Related Questions