Author Topic: CodeMarkup - Highlights tagged comments, insert tagged comments, more  (Read 10855 times)

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
This macro highlights various styles of tagged comments in files.

Some examples:
    //$ todo:
    //$ review:
    // todo:
    // review:
    ...and many others, see macro source for details.

The macro is working for me.  There are a couple todo comments inside which I haven't gotten around to:  for my purposes the macro seems to be working fine, but for very large files I expect it may be slower than it could be, and that's what the todo comments are about.

It also includes a command to find various styles of tagged comments in files.  This command invokes the FindIn macro to determine where to search and initiate the search.

DownInFront

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #1 on: December 26, 2008, 01:38:45 pm »
When I load this macro, I get a Slick-C Stack Error and a Slick-C Error dialog popup.

The Slick-C Error dialog contains :
"The property or method is not allowed on this object.
file= CodeMarkup.ex
offset=410"

The Slick-C Stack contains :
"This property or method is not allowed on this object
CodeMarkup.ex 410 CodeMarkup:DeferredInitTodoHighlight()   p_window_id: 30   p_object: OI_IMAGE   p_name: "

Through trial and error I found that removing the following line prevents the errors, but then the macros don't highlight the keywords as expected.

Within function DeferredInitTodoHighlight(), remove line : s_colorTodoHighlight = _AllocColor();

I'm a newbie to macros, so I'm not sure how to debug this further.

I've tried loading and unloading the module, with and without projects open.   I've also tried rebooting S/E and my PC.

This is the first Module that I've tried loading.

WinXP
S/E 13.0.2.0, Hotfix Revision 15

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #2 on: December 26, 2008, 08:33:48 pm »
Thanks for the info, DownInFront.  At first I was unable to reproduce this on a fresh install of SE 13.0.2 -- no errors, worked fine for me.

To make a long story short, I eventually realized (thank you Occam's Razor) that what must be going on is that _AllocColor() must require a window to be active before it can be called, although the Slick-C document does not mention this.  So I tried starting SE with no files open (a very important detail in your case!), and using the Macro->Load Module command while no files are open.  Sure enough, that reproduces the problem.  I don't think it's very common to load a module when there are no files open in the editor.  But it's a good case to test for, and I'll try to keep it in mind in the future.  Ok, so now I can ponder how to go about working around this issue.  I'm about to start my holiday vacation, so there may not be a fix for the reported issue for a couple weeks.

In the meantime:
1.  Open the CodeMarkup.e file itself in the editor.
2.  Press Alt+F12 to load the current file's module (assuming you are using CUA emulation).

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #3 on: December 27, 2008, 07:13:12 am »
Fixed:  I was able to work around the issue by simply deferring the _AllocColor() calls until the colors were about to be used.

Updated:
  • Fixed Slick-C stack when loading the macro with no files open.
  • Can color other people's tagged comments less brightly than yours if you "set-var def_tagged_comment_myname" to your name.
  • Added command to insert "note:" comments.
  • Added command to find tagged comments starting in column 1 (requires FindIn).  I have a personal convention where any comments that must be resolved prior to checkin start in column 1 (are not indented).

Rev 3 of the macro is attached.

DownInFront

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #4 on: December 29, 2008, 03:29:16 pm »
Thank you chrisant!

I modified the regex expressions to suit my needs and it's working great!

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #5 on: January 09, 2009, 01:50:12 pm »
=============================================
SlickEdit Version 12.0.3.0
Build Date: September 20, 2007
Emulation: CUA

OS: Windows XP
Version: 5.01.2600  Service Pack 2
=============================================



Error:'const is depreciated'

Workaround: remove strict -
Code: [Select]
//#pragma option( strict, on )

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #6 on: January 09, 2009, 06:57:11 pm »
=============================================
SlickEdit Version 12.0.3.0
Build Date: September 20, 2007
Emulation: CUA

OS: Windows XP
Version: 5.01.2600  Service Pack 2
=============================================



Error:'const is depreciated'

Workaround: remove strict -
Code: [Select]
//#pragma option( strict, on )

What line is the error reported against?

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
Re: CodeMarkup - Highlights tagged comments, insert tagged comments, more
« Reply #7 on: September 09, 2009, 05:27:24 pm »
=============================================
SlickEdit Version 12.0.3.0
Build Date: September 20, 2007
Emulation: CUA

OS: Windows XP
Version: 5.01.2600  Service Pack 2
=============================================



Error:'const is depreciated'

Workaround: remove strict -
Code: [Select]
//#pragma option( strict, on )

What line is the error reported against?

Every declaration that uses 'const' ;)