Join Joe Marini for an in-depth discussion in this video Using tasks, part of Learning Aptana Studio 3.
As you start working on projects that grow in size and scope, you might start to find it challenging to keep track of places where you need to edit code or things that you need to do, and Aptana provides a couple of features that help you with this called tasks and bookmarks. Tasks indicate work that needs to be done. They can be either completed or uncompleted and they can be given a priority. And a bookmark is basically just a placeholder. So let's take a look at how you can use these features to help you keep track of your place in large code bases. So let's start with Bookmarks.
Let's suppose I am working on this really large HTML file, and you know, for some reason I am like down here, deep in the code, and I keep coming back to this one place in the document over and over again. I can add a bookmark really easily by right-clicking and just choosing Add Bookmark. And I might call this something like about whatever. You can see that the Bookmark name defaults to the selection, but I can just call it the About Placeholder. And I'll click OK, and you can see that over here in the margin, that little Bookmark icon got added.
So now I can go on about my business, I can close this file and go do some work someplace else, but if I need to jump there really quickly, I just need to open up my Bookmarks View and click on the Bookmark. So to do that, I am going to go to the Window menu, and I am going to choose Show View, and I am going to choose Bookmarks. Now this may or may not be here based upon how often you use this feature. If it's not here, down here in the Other option, Bookmarks will be located in this list. So if it's in this menu, then great. If it's not, choose Other and then this will show you all the views that you have available to you.
So I'll choose Bookmarks and click OK, and you can see that here's the About Placeholder I just added. It tells me where it is what the path to it is and what the location is. So all I have to do is double-click this, and I just jump right to my bookmark. So, pretty cool little feature. Tasks are similar, only tasks are a little bit different, they indicate whether a work has been done. So let me go ahead and remove this bookmark. I am just going to right-click and choose Remove Bookmark, okay, now it's gone, and let's suppose that I am down here in this section, and there is something I have to do.
So I am just going to highlight this and choose Add Task. Now you can see that the UI for talks are a little bit different. Tasks have a priority whether or not they have been completed, and so on. So for the Description, I am going to enter something like This needs to be fixed! And I'll choose Priority of High, and I'll click OK. And you can see that this little icon right here that shows me that there is a task, and when I hover over it, a little pop-up appears that shows me what the task is.
I can add another task down here, and I can add a task that says Reorder these, and I can make that a Normal priority and so on and so forth. So I'll click OK. So now I have a couple of tasks, and you can see these here in the left-hand gutter where the line numbers are. So to view these, all I need to do is up in the Window menu once again, I can choose Show View, and then I come down here to Tasks. And again, if this option isn't in your Show View menu, don't worry about it.
Just choose Other, and you'll find the Tasks in there. So I'll choose Show Tasks, and here I have a summary of all the tasks that I need to do. Here is one that needs to be fixed. And you can see that that's a High priority task because of the little exclamation point. This one is a Normal priority, and I can choose to mark off the ones that I fixed. So if I fixed that one, and I fixed that one, then I can right click and choose either to delete the completed tasks, or I can choose to mark them as completed.
If I choose to delete the completed tasks, it's going to ask me, are you sure you want to delete these? I'll click OK, and you can see that the two task icons have now gone away in the source code. So that's using Tasks, but Tasks are actually a little bit easier to use than even that. You can create tasks just by editing some comments in your code. So, for example, if I put a comment in here that says TODO: Fix this now!.
You will see that the keyword TODO has been picked up on by Aptana. It creates a little task here in the gutter. So I can do searches on the TODO keyword. It also picks up on XXX, and it also picks up on FIXME for a priority, so another way to create tasks. And just like other things in Aptana Studio, tasks have their own preferences. So let's go take a look at those. I am going to go ahead and type tasks in here, and right there is what I want.
So you can choose to create new strings that are used as task markers and comments. So right now, you see I have got FIXME, the XXX, and TODO, I can make a new one called, say HACK, and I can give that a Priority, I'll just leave it as Normal. I click OK. So now, any time I enter a comment that has the word HACK in it--and this works in HTML comments as well as script comments--Aptana will pick up on this and mark it as a task for me to complete.
So using tasks and bookmarks can help you organize your code when you are using large projects and give you nice little reminders of what needs to be done and help to keep track of places that you visit often in your code.
- Installing Aptana Studio on Windows and OS X
- Creating a new file from scratch or from a template
- Creating a new web project
- Importing an existing web project
- Editing code
- Viewing code changes with Quick Diff
- Keeping track of your to-do list with Tasks
- Adding new code snippets and templates with bundles
- Previewing projects
- Deploying your website to an FTP server