Copyright (C) 2002 John Gellene, 2003-2004 Ollie Rutherfurd, 2009 Dale Anson
TaskList searches through your files for "to do" items and presents those in a clickable tree format for easy access.
This plugin provides a dockable list of comments extracted from the comments (or all text) in a file being edited in jEdit. The display shows an icon representing the type of comment, the line where the comment appears and the comment text. You can jump to a comment by double-clicking on the corresponding row of the table. The comment text in the buffer can be highlighted as a user option.
By default, TaskList uses the mode of the file to find comments. Some modes do not designate comments, such as 'text' mode and 'hex' mode. These two modes are not parsed for comments. As edit modes are regularly added to jEdit, there may be other modes that do not contain comments, so no tasks will be shown for those modes.
It is possible for TaskList to parse complete files rather than just comments. This may be somewhat slower, but does allow for the possibility of finding tasks in text and hex files. This setting is done per mode, so, for example, TaskList can be set to look for tasks in the comments in C files, look in the entire file for text files, and skip hex files altogether. This makes it possible for TaskList to be used as a sort of document outliner. For example, you could have tasks set up for the <h1>, <h2>, <h3>, <h4>, and <h5> tags in html files, set TaskList to parse the complete file (rather than just comments) in html files, and then TaskList will present a decent outline of your html files.
In general, binary files are not parsed for comments. TaskList uses an extensive list of filename extensions to decide if a file is binary before opening it, which greatly improves performance. However, it is impossible to determine binary files by name alone, so the once the file is opened, it is scanned for binary content. If it is determined that the file is indeed binary, it will not be parsed for tasks. Unfortunately, the mere act of opening a binary file in jEdit can cause jEdit to display messages about encoding errors.
The types of files that are considered binary are configurable in the plugin options.
A number of default comment tags are supplied, each with a distinctive icon:
Name | Icon |
DEBUG | DEBUG_ICON |
DONE | DONE_ICON |
FIXME | FIXME_ICON |
IDEA | IDEA_ICON |
NOTE | NOTE_ICON |
QUESTION | QUESTION_ICON |
TODO | TODO_ICON |
XXX | XXX_ICON |
??? | QQQ_ICON |
You can change the icons associated with a task type by changing the
plugin's settings in the Plugins
-> Plugin Options
-> TaskList
-> Task Types
dialog. You can
also add your own comment types, using the icons supplied with the
plugin or your own custom icons.
TODO in a Java comment:
NOTE in an HTML comment:
Whenever the plugin is activated, it will parse a buffer and display formatted comments when the buffer is first loaded, when it is saved, and when you switch buffers or edit panes within a view window. To jump to the text of a comment in the buffer, double-click on the row containing the comment.
You can change or delete a comment by right-clicking on a row containing
a comment. A popup menu will appear with three selections, Change task
tag
, Delete task
, Parse buffer
,
Parse All
, Sort By
, and Sort Direction
.
You can change the type of comment (for example, from IDEA
to
TODO
, or from TODO
to DONE
, by selecting the Change task
tag
option. A child popup menu will appear with the text of available
comment tags. Clicking on an item will cause the buffer text to be
updated to show the new comment tag. The TaskList display will also be
updated.
You can delete a task comment by selecting Delete task
from the popup
menu. You then have the choice between deleting the comment tag only (so
the comment text will remain but will not be parsed as a task comment)
and deleting the entire comment. This operation will also refresh the
TaskList display.
Any change or deletion to a task comment in a text buffer can be
reversed using the editor's Undo
feature.
The TaskList display is not refreshed with every change made to a
buffer. It is updated when a buffer is loaded or saved, when you switch
edit panes or buffers in the view window and when you make changes to a
task comment using the plugin context (right-click) menu. As a result,
if you have made unsaved changes to a buffer, TaskList may not be able
to find or change your comment text. You can reparse a buffer at any
time using the Task List
-> Parse buffer
menu item in the Plugins
menu (which you can tie to a keyboard shortcut), or by using the "Refresh" button in the TaskList dockable.
TaskList will also display a list of all tasks in all open files. This tab can be turned off in the plugin options.
If the ProjectViewer plugin is installed, TaskList can find all tasks in the current project. For large projects, this can take a long time.
You can turn off parsing of all projects by unchecking the box in the TaskList options, General, "Show tasks for all project files".
You can also turn off parsing of a single project in the ProjectViewer properties for the project.
You can also find the tasks in just part of a project by right clicking on a file or directory in Project Viewer and selecting "Find Tasks" from the popup menu. This can be more useful in large projects. A new tab will be opened for each such action. These tabs can be closed individually when they are no longer needed.
You can also find tasks using the File System Browser by right clicking on a file or directory and selecting "Find Tasks" from the plugins menu. A new tab will be opened for each such action. These tabs can be closed individually when they are no longer needed.
The TaskList dockable provides a "Filter" menu that lets you show or hide certain types of tasks. The Filter menu also contains a "Toggle All" item, which makes it easier to select specific types.
There are three option pane windows available for user settings from the
Plugins
-> Plugin Options
-> TaskList
dialog.
The General
options pane allows you to change the appearance of the
TaskList table display, including default sorting criteria, and
highlighting of commented buffer text.
Most of these should be self-explanatory.
The Task Types
options pane allows you to add, delete, or edit comment
tags corresponding to task types.
The tags for default task types, and any types you may add, are
represented by regular expressions for which the TaskList plugin
searches once it encounters a comment token on a line of buffer text.
The content of the comment token will depend on the jEdit edit mode
being applied to the buffer. The regular expression is applied to all
text on a given line following the matching comment. Two fields are
extracted for display when a match occurs: the name of the tag that will
be displayed at the beginning of the Description
column of the
TaskList table, and the text of the comment that will follow the tag
name. These two fields correspond to two defined groups in the tag's
regular expression.
The ability to change the comment type and tag from the TaskList table (using its context menu) depends upon the target comment type's regular expression being in the basic form of the default types:
\s+(task-type-name):\s+(comment-text)$
It is expected that the regular expression contains two groups. The first is the task type name, the second is the task comment. Regular expression groups are not technically required, but it is best practice to do so. If there are no groups or only one group defined, then the entire match will be considered to be the task type name.
Here are some examples to help you write your own task types:
\s(TODO)[:]?\s+(.+)$
This will match lines like:
When using the current version, the name of the task type is the tag name used in regular expression.
You can reset the task patterns to those installed with the plugin by
using the Task List
-> Reset task patterns
command.
The Modes
option pane allow you to specify which modes TaskList should
extract tasks from comments.
As text
and hex
don't have comments, they are not enabled by
default.
The name of a task item must currently be identical to the tag text contained in the regular expression defining the task item. These items may be corrected in a future version.
The current version also does not parse task comments spanning more than one line of buffer text. There is also no facility for serializing the contents of the TaskList display. These features may be added in a future version.
The TaskList plugin and its documentation are released under the GNU General Public License (either version 2 or any later version, at the user's option). A copy of the GPL is available in the COPYING.txt file in the jEdit distribution.
The TaskList plugin comes with ABSOLUTELY NO WARRANTY OF ANY KIND; see section 11 and 12 of the GPL for details.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no "Invariant Sections", "Front-Cover Texts" or "Back-Cover Texts", each as defined in the license. A copy of the license is included in the file COPYING.DOC.txt included with the jEdit distribution.
Bug reports, comments and suggestions regarding TaskList may be entered in the tracking system at https://sourceforge.net/p/jedit/plugin-bugs/.
Fix for tracker 2921940, some properties were not initialized, which caused a null pointer exception.
Added ability to filter the tasks lists, per tracker 2922303.
Moved ParseBufferMessages off of the EditBus since they are only used by TaskList and confused other plugins.
Fix for tracker 2930625, TaskList couldn't find tasks in files opened with the FTP plugin.
Added "Toggle All" button to Filter menu to make it easier to select task types.
Lots of changes, removed the old table, now all task lists are trees. Added trees for Open Files, Project Files, and ability to find tasks in just part of a project or from the File System Browser.
Recognize Tasks that contain tokens other than comment types,
if the other tokens are surrounded by comment tokens. This
allows PHPDoc @TODO: ....
comments, where @TODO
is a
LABEL
token, to be recognized.
Fixed NullPointerException when trying to extract tasks from a mode that was added since jEdit was started.
Updated for 4.2pre1 Token changes.
Fixed deprecation warnings.
Updated for 4.2 plugin API
Changing default sort column or order is applied immediately.
Fixed sf bug 535882, "TaskList, removing and jumping"
Fixed a sorting bug (NPE if no ":" in Task.text)
Fixed "Reset task patterns"
Added "Parse Buffer" to TaskList Popup menu
Fixed sf bug 699048, "Unable to delete tasks"
Code re-organization
Added option to sort tasks by buffer name
Fixed bug removing task patterns
Better performance in default patterns (Antonio Argentieri).
Removed uses of APIs deprecated by jEdit 4.1 (Slava Pestov).
Option to specify which modes to use
fixed case-senstive matching and task name saving
parsing updates for jEdit 4.1
Fixed bug in parsing routine
Release on jEdit Plugin Central
Port to jEdit 4.0 API
Fixed highlighting option
cleaned up table appearance
Fixed bug affecting deletion on entire task comment
Revised for beta version 0.3
Initial version of documentation