Author Topic: Todo plugin fix  (Read 2440 times)

Offline spedgenius

  • Single posting newcomer
  • *
  • Posts: 8
Todo plugin fix
« on: September 16, 2008, 03:51:35 am »
I was having problems with the todo plugin and decided to look at the source to see if i could help out.  I noticed that the ParseBuffer method in todoListView was having some difficulties.  the code was having a problem parsing multiline comments and would only find the first todo type listed in the m_types array, and would ignore all the rest.  I noticed that the approach was to search each file once for every type and then confirm that is was part of a comment.  My patch introduces a separate FindNextComment function to parse for comments, and then uses your existing code, to find the todo's in each comment.   there by cutting down the parse time dramatically, as well as compartmentalizing the code a bit.  i also added a Comment class that is passed via pointer to FindNextComment and holds a wxString containing the comment, an int for the begining position, an int for the end position and a bool for the comment type (c/c++).  this seemed to clear up the issue quite well.  I'm not sure if the code is in the proper convention for you, if not let me know and i will clean it up for you.

[attachment deleted by admin]
« Last Edit: September 16, 2008, 06:37:30 am by spedgenius »