Deleting (undeletable) Tasks In Eclipse

I recently had some more frustration with Eclipse, with no solution on the web, so I’m posting mine.

The problem:

I had an auto-generated task (TODO) from creating a class that implemented an interface. At some point, I noticed the task comment was gone, but the task indicator (checkbox icon) was still there. Probably because I have it set to reformat on save, but maybe I deleted the task comment without hitting the task button (or both). Anyway, I could not clear it no matter what:

  • Double clicking the icon didn’t work since it couldn’t find the comment.
  • Clicking the “Clean and Redetect Tasks” button did nothing.
  • Restarting Eclipse (which I do more often than a Windows admin reboots), did naught.
  • The Task View displayed the offending tasks, but the Delete option was greyed out. Selecting the task and hitting delete 3 million times while cursing furiously at the screen brought no justice.

The solution:

  1. Go to Window >> Preferences, then Java/Compiler/Task Tags. Select the TODO task tag, or whatever accursed tag haunts you.
  2. Click Remove. When it threatens a rebuild, call it’s bluff (that is, agree). When it’s done (and it took its sweet time), the offending tasks will be gone. Rejoice!
  3. Click New… and restore the TODO tag. All legitimate TODO tasks will be restored.  Callooh! Callay!

keywords: can’t delete tasks, task tags, eclipse 3.4, mylyn

8 thoughts on “Deleting (undeletable) Tasks In Eclipse”

  1. I wasn’t able to delete the undeleteable tasks exactly like this. In case someone has trouble with this, what worked for me was to remove the particular tag from the task tags like you describe (which didn’t delete them unfortunately), then go through double clicking each of the tags in the tasks view that I want to delete, manually delete that line and save (so it disappears) then undo and save again. That way they don’t come back. Then you can recreate the task tag and all the ones you wanted to retain will reappear.

  2. I went crazy with this as well.
    Don’t know if it is still a problem in 3.6 (still downloading)
    But in 3.5 the following helped. (especially for the todo tags in xml files):

    – stop eclipse
    – Delete all .markers files found in any .plugins/org.eclipse.core.resources/.projects// directory.
    – start eclipse

    done \o/
    clean all projects to rebuild the list

  3. Unfortunately neither your method nor moox’s were able to help me remove my undeletable tasks.

    What I had done was create a new task tag, “NOTE”, without realizing that one file was full of comments containing “note”. I decided to remove the task tag, but the new “note” tasks remained and nothing I did could remove them, not even deleting the offending lines from the file. The thing that finally did the trick was to empty the file completely and save it. I could then paste the file’s contents back in.

    Hope that helps somebody.

  4. BertlPub’s method worked for me…
    – close eclipse
    – cd …/workspace (wherever the eclipse workspace is for you)
    – rm .metadata/.plugins/org.eclipse.core.resources/.projects//.markers
    – open eclipse
    – clean project

    thanks!

  5. Thanks for this post. Based on the comments, I did a clean/build and to see what that did and it got rid of the markers. I use m2eclipse, so rarely use the Eclipse clean/build anymore and didn’t think to try that. This was using Eclipse Helios SR2.

  6. If you are dealing with a small amount of files, just doing a cut + paste clears the task list.

  7. BertIPubs recommendation worked for me: Remove the line (Ctrl-X), save, insert the line (Ctrl-V), save again. The difference is, i do not have original eclipse but qnx momentics ide, which is based on eclipse. Seems to have the same bug. If anyone wants to know how to handle this in momentics ide :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>