Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse does not show TODO tasks

Tags:

java

eclipse

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?

like image 301
vektor Avatar asked Aug 05 '12 07:08

vektor


People also ask

How do I get task list in Eclipse?

Use the Task List to view and manage your tasks. If the task list view is not visible, you can open it by navigating to Window -> Show View -> Other... -> Mylyn -> Task List. The Task List contains both "Local Tasks" and shared repository tasks that are stored in a task repository such as Bugzilla or Trac.


3 Answers

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.

like image 130
user2619028 Avatar answered Oct 18 '22 07:10

user2619028


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?..

like image 9
vektor Avatar answered Oct 18 '22 05:10

vektor


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.

like image 5
Sandro Avatar answered Oct 18 '22 05:10

Sandro