Author Topic: ToDo List Toolbar (Updated for SE2016)  (Read 16262 times)

MartyL

  • Senior Community Member
  • Posts: 160
  • Hero Points: 26
  • Synergex Software Engineer
ToDo List Toolbar (Updated for SE2016)
« on: June 03, 2010, 03:33:33 pm »
Current version: 1.0
Author: Marty Lewis

Important Note:
This feature has been modified to work with SlickEdit 21 and up, but appears to work okay back to SlickEdit 14. Back up your SlickEdit configuration directory prior to loading this module in case some kind of conflict occurs. Bug reports or additional feature requests can be posted in this thread.

This module implements a toolbar and methods for tracking "TODO:" statements in source code comments. It uses SlickEdit's search functionality to quickly parse through relevant code. It also makes use of several SlickEdit APIs to present a toolbar interface that attempts to match the look and feel of your existing SlickEdit interface. After loading, right-click in the toolbar to see the commands and options.

The following commands can be bound to keys or run from the SlickEdit command line:
Code: [Select]
// This command begins the process of searching all the source files in your
// workspace for TODO: statements.
// This is also in the right-click menu as Generate TODO List
_command void ToDo_GenerateList();

// This command takes the existing TODO: data and sorts it by project then filename.
// Future calls to ToDo_GenerateList() will default to this sort.
// This is also in the right-click menu under Sort By > Project
_command void ToDo_SortByProject();

// This command takes the existing TODO: data and sorts it just by filename.
// Future calls to ToDo_GenerateList() will default to this sort.
// This is also in the right-click menu under Sort By > File
_command void ToDo_SortByFile();

// This command toggles the TDML parsing on or off.
// This is also in the right-click menu under TDML > Use TDML
_command void ToDo_ToggleTDML();

// This command toggles the alternate TDML parsing on or off.
// This is also in the right-click menu under TDML > Use Alternate TDML
_command void ToDo_ToggleAltTDML();

// This command will take you to the file or todo statement currently selected
// in the toolbar. It opens an editor window containing the source file. If a
// todo statement was selected then it places the cursor on the correct line
// and column.
// This is also in the right-click menu as Goto TODO
// This can also be invoked by double-clicking an entry in the list
_command void ToDo_ViewSource();

One of the added values in this toolbar is the introduction of a simple syntax for setting the importance and/or name for a particular TODO statement. A single character indicates above average importance or high importance. Anything else before the colon indicates the title. For example:
Code: [Select]
// TODO! Really Important Task:
// TODO^ Fairly Important Task:
Those two items would show up in the toolbar with different icons indicating the importance level. The rest of the text preceding the colon would also show up in the toolbar as a name you specified by which to reference the particular TODO item.

If you turn on Alternate TDML parsing, the name text is pulled from the other side of the colon to the end of the line. For example:
Code: [Select]
// TODO: Important task
//           The rest of my description about this todo task

This would result in the name being "Important task". Alternate TDML parsing is likely to produce some strange TODO name's as most people will not have taken this into account when writing TODO statements.

Changelog:
Code: [Select]
Version 1.0:
  Work around SlickEdit RegEx bug.

Version 0.9:
  Support for new tool window infrastructure in SE2015-SE2016.

Version 0.8:
  Be less picky about how a user starts their ToDo descriptions. Don't require alphanumeric.

Version 0.7:
  Fix for Shelku, error when executing ToDo_GenerateList outside of the toolbar context.

Version 0.6:
  Courtesy of Sandra, updated to work with SlickEdit 16

Version 0.5:
  Fixed an error that would occur when ToDo_GenerateList() was run while the toolbar was not visible
  Merged vivitron's Message List changes

Version 0.4:
  Made a minor code change to allow the module to load in SlickEdit 14

Version 0.3:
  Support for alternate TODO style (listing comment after TODO:)

Version 0.2:
  Support for Visual Studio projects
  Fixed a platform bug where I was using an explicit Windows path separator

Version 0.1:
  Initial release

This feature is based on a request found in the SlickEdit forum: http://community.slickedit.com/index.php?topic=6081.0
Special thanks to ehab for testing the toolbar in ways that I had not considered.
Extra thanks to vivitron for implementing an integration with the SlickEdit Message List toolbar to insert todo information.
Even more thanks to SlickEdit's Sandra for updating the macro to work with SlickEdit 16.

(Over 400 downloads!)
« Last Edit: September 26, 2016, 04:21:39 pm by MartyL »

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: ToDo List Toolbar
« Reply #1 on: June 08, 2010, 05:30:51 pm »
Very cool! One super-minor bug: if a user were to be *very* degenerate (not that I'd ever try to do anything like this) and call ToDo-GenerateList while the toolbar wasn't open, it results in a SlickC stack.

vivitron

  • Senior Community Member
  • Posts: 162
  • Hero Points: 10
Re: ToDo List Toolbar
« Reply #2 on: June 08, 2010, 05:56:06 pm »
There is a new version that fixes that bug and adds the ability for the list to appear in the SE Message List window as well..

See this thread: http://community.slickedit.com/index.php?topic=6081.0

MartyL

  • Senior Community Member
  • Posts: 160
  • Hero Points: 26
  • Synergex Software Engineer
Re: ToDo List Toolbar
« Reply #3 on: June 08, 2010, 06:42:20 pm »
vivitron makes a very good point. I suppose that I need to update this thread.

DomDom

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: ToDo List Toolbar
« Reply #4 on: May 17, 2011, 12:24:53 pm »
Hi Marty,

Thanks for this macros, very useful, 

but can you consider to update it so it can run with the latest version 16 (It seems that in their newer version they change some of the function call)

Thanks,

Dom.

LBCEi

  • Senior Community Member
  • Posts: 157
  • Hero Points: 8
Re: ToDo List Toolbar
« Reply #5 on: June 21, 2011, 04:47:55 pm »
According to Sandra in this post: http://community.slickedit.com/index.php?topic=6736.0 and a support case reply from Mike Cohen:

You need to make a change to a function call in todo.e:

On line 536, change:

if (GetProjectFilesArray(project, files) < 0)

to:

if (_getProjectFiles(_workspace_filename, project, files, 1))

I'm still in the process of trying this fix myself.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: ToDo List Toolbar
« Reply #6 on: June 22, 2011, 02:07:00 pm »
I have made a little tweak to the version that was posted in this thread to account for changing functions for v16.  This new version should work in both v16 and v15 (and whatever previous versions were supported before).

MartyL

  • Senior Community Member
  • Posts: 160
  • Hero Points: 26
  • Synergex Software Engineer
Re: ToDo List Toolbar
« Reply #7 on: June 22, 2011, 04:40:35 pm »
Thanks for the update Sandra. I haven't moved to 16 yet myself and had not checked this thread in a while!

Edit: Updated the macro in the original post with the changes. Thanks again!
« Last Edit: June 22, 2011, 04:46:42 pm by MartyL »

DomDom

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: ToDo List Toolbar
« Reply #8 on: June 28, 2011, 12:42:32 pm »
Thanks Sandra and MartyL !!!

Works great!!

Dom.

Shelku

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: ToDo List Toolbar
« Reply #9 on: December 01, 2011, 01:48:38 am »
Wow - I just noticed this macro and it's great!

However, it only seems to work if I right-click on the ToDo window and generate the list from there. If I try to execute the command "ToDo_GenerateList" from a menu button or by hitting ESC and typing it I got the error

Code: [Select]
This property or method is not allowed on this object. file=todo.ex offset=998(SlickEdit 2011 v16.0.3.0 64-bit)

MartyL

  • Senior Community Member
  • Posts: 160
  • Hero Points: 26
  • Synergex Software Engineer
Re: ToDo List Toolbar
« Reply #10 on: December 13, 2011, 04:48:57 pm »
Hi Shelku,

I just noticed your bug report. I'm not sure how that one slipped through the cracks during testing. Posting up a fix right now.

Hope this helps!

bkerske

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: ToDo List Toolbar
« Reply #11 on: January 19, 2012, 04:16:06 pm »
This is a real simple question I hope.  I loaded the todo.e macro but can't figure out how to get a project to be recognized.  My Todo tab is empty?  How do you define projects or the project files that reside in the tab like some of the screen shots I've seen?
Thanks  [/size]

MartyL

  • Senior Community Member
  • Posts: 160
  • Hero Points: 26
  • Synergex Software Engineer
Re: ToDo List Toolbar
« Reply #12 on: January 19, 2012, 04:29:13 pm »
Hi bkerske,

It uses the projects that are in your current workspace. It's designed to show you the todo list for your current working area. After you open your workspace, right-click the toolbar and generate the list.

Hope this helps!
Marty

bkerske

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: ToDo List Toolbar
« Reply #13 on: January 19, 2012, 08:17:20 pm »
Marty,
Thanks, after reading your post I tried on a whim closing the workspace and reopening it and that seemed to work.  Closing my workspace out when I close SE is not typical for me (I did close SE all together several times) and it is something I didn't do (obviously) after I loaded the macro.

MartyL

  • Senior Community Member
  • Posts: 160
  • Hero Points: 26
  • Synergex Software Engineer
Re: ToDo List Toolbar
« Reply #14 on: June 11, 2012, 11:33:28 pm »
Tested on v17 today. Everything seems to be working, but docking in a tabgroup loses icon/title. Looks like a change in behavior. I'll see if I can iron it out.