CFEclipse Feature Review: Tasks

Recently a discussion on the CFEclipse mailing came up about the use of the 'task' tags in Eclipse.

Tasks in Eclipse were originally tied around a 'TODO'.  You could enter a comment: 

<!-- TODO - do something -->

and see these in the Tasks view
 


Several people on the mailing list argued that you should be using something like Mylyn to manage your tasks and I would have to agree, but Eclipse tasks are still useful, especially since CFEclipse 1.4 introduced the ability to define your own tasks!

During development I'm constantly dropping CFDumps around to debug and troubleshoot my code.  Usually these are found during testing but I still like to keep track of where they are and verify they have all been removed or the issue they were set for has been resolved.
 

Adding A New Task Tag
 

We can add a new task for this called CFDUMP.

Click Window > Preferences, and expand the CFEclipse node: CFEclipse > Editor > Task Tags

You should see the default TODO task listed.

Click  -  Create New Task Tag

A task called "New" will be added to the list. You can now click on that task and edit both the name and priority.

I'm going to name it 'CFDUMP' and give it a high priority.



Click Apply and OK

Now we can open a file and dump something and we'll add a comment with our new CFDUMP task:


<!--- CFDUMP: Debugging --->
<cfdump var="#myvar#" top=2 label="My Dump" abort="true">

Close your file. Imagine a weekend has passed and it's Monday.  Remember where that CFDUMP was? Of course not!

But a quick glance at the Tasks View will show you.  


 

Task View Filters


Now imagine you have setup several new task tags. CFDUMP, DEBUG, VERIFY, etc...  

Using the Tasks view you can easily sort these. First we need to tweak some prefernces again.

Click the small triangle at the right side of the Task view.



Select Configure Contents



Here you can define 'configurations' that allow you to filter on your task and other criteria.

We'll add a new configuration for our CFDUMP task.

Click New and enter CFDUMP for the name.

Now you can modify the filter attributes.  For simplicity sake we'll simple add a check in the description:

Text Contains : CFDUMP

We'll leave everything else default but you can experiment with the other options to create more complex filters.

Click OK to save your configuration.

Now if you click on the small triangle you should see a new item under the Show > menu -  TODO and our new CFDUMP.

If you click on CFDUMP - it should filter only the CFDUMP tasks.

To see all your tasks again you can click Show > Show All.
 

Creating New Views


But you don't want to click constantly to change your filtered view. CFEclipse allow you to clone a view!

Click the small triangle again and select "New Tasks View".  Enter a new name for your view - CFDUMP.

Now you should have two Tasks views - your 'normal' one and one filtered for CFDUMP.  (You may need to run through the Configure Contents filter again for the new view)



Hopefully with this quick introduction you can start creating your own task tags and views.