Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 different highlighting between comment types

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
hell_butcher Posted - Jul 29 2007 : 11:19:51 AM
I got really addicted to VAX in the past months now, and I would really love to see a couple of new features.

One of them is the ability to differentiate between two kinds of comment styles and allow to highlight them differently, like in Kate or Eclipse for instance:


// this is a C++ style comment
/* this is a C style comment */
/** this is an informative java style comment, usually multiline */


This would *really* improve the readability of the source, especially to have an immediate differentiation between informative comments and some code that has been commented-out.

Cheers
8   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 30 2007 : 10:56:25 AM
quote:
Originally posted by cyril

Anyhow, I really think that Doxygen style comments /** ... */ should be highlighted in a more flashy way that other comments


except that we have no sensible definition of doxygen comments, since what really matters are the tags, and there are a *lot* of tags, in different formats...

and then you get into XML format comments
and other types of structured comments.

Unfortunately this is one of those things that is not as simple as it at first sounds.
cyril Posted - Jul 30 2007 : 09:40:49 AM
Thank you for your long answer.
The InsertAutoText trick is ok, I guess...
Anyhow, I really think that Doxygen style comments /** ... */ should be highlighted in a more flashy way that other comments /* ... */ and //...

Keep on making VAX as good as possible!
Cheers,
Cyril
feline Posted - Jul 30 2007 : 09:20:10 AM
The speed of doing this has an easy fix, select the code and then trigger "Insert Autotext" and select the #if 0, #endif item. You can easily customise this to suit your needs, but the basic autotext code you want is:

#if 0
$selected$
#endif

You can bind a keyboard shortcut to VAssistX.InsertAutotext if this helps, and the items are suggested in the order they are shown in the autotext dialog, so by simply dragging and dropping them in the tree view you can reorder the resulting menu of suggestions.

I agree, this is different between different IDE's, which is a bit frustrating, but in all IDE's this is actually using a built in feature of the IDE, which has changed between IDE's.

I don't know of any special markers that would do what you want and that work on all IDE's.

Portability beyond MS IDE's gets us into a whole different world, since my preferred non Microsoft code editor is VIM, and the rules are quite different there.

I would expect the level of indenting to help you, since any commented out code inside a function should be indented normally. Personally I have always used this method, even going as far as to remove all indenting on temporary debug code to make it easier to find in the middle of a function.

The other points, they are sensible, but the practical answer is that there is no standard, no definition for "special comments", since everyone works differently. For a partial answer on adding more syntax highlighting blocks see here:

http://docs.wholetomato.com?W146
cyril Posted - Jul 30 2007 : 08:01:54 AM
I use VS2005. Your proposal is very interesting, since the effect it provides is exactly what I expect.
Unfortunately I find some drawbacks:
- it is *really* painful to add two preprocessor lines to comment out a line or two, especially when doing this often and/or at many places
- it lengthens the code (and thus alters its visual/mind print)
- the hack is different on VC6/VS2003 and VS2005 (a solution based on comment types would be "portable" even beyond MS IDEs)
- you cannot comment-out less than a full line of code

Again, thanks for your time
feline Posted - Jul 30 2007 : 07:48:33 AM
If commented out code is the main target here... which IDE are you using?

If you are using VC6 or VS2003 then try wrapping the commented out code in:

#if 0 //{{AFX_COMMENTED_OUT
#endif //}}AFX_COMMENTED_OUT

as explained here:

http://forum.wholetomato.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=2253&SearchTerms=

If you are using VS2005 then the IDE will colour code that is blocked out with #if 0, #endif directly, once it updates its self and works out the code is inactive. This requires that you have left the IDE's intellisense parser enabled.

In both cases you can configure the colour that is used in the IDE's font and colour options, you just have to find the correct item.
cyril Posted - Jul 30 2007 : 07:35:12 AM
(sorry I had issues with my accounts on this forum, hell_butcher = cyril)
cyril Posted - Jul 30 2007 : 07:34:09 AM
Thank you for your answer.

I sometimes use autotext for my comments ( /** and /*- ).
I understand your point of view. Having a comment block clearly emphasise an informative comment.
Nevertheless, I would really love having several conceptual types of comments (at least two) that could be highlighted differently, especially to attenuate the visual "presence" of commented-out code that sometimes make my code really painful to read, since right all the comments are in flashy green :)

To me, there are mostly three kinds of comments: blocks (file headers, function headers...), informative in-code comments (in-line explanation for some code), and commented-out code, that one really wants to be less flashy.
feline Posted - Jul 30 2007 : 07:05:23 AM
The first problem here is that we do not have the concept of an "informative" comment. People often have comments like this:

/***
 * comment here
 ***/


or:

//************************ this is important! ************************

which can quickly become:

/************************ this is important! *************************/

Once you throw multi-line Doxygen style comments, or some other type of structured comment into the mix the whole idea starts to fall apart.

Have you considered using autotext to insert a template for an obvious comment, something that adds a clear marker block you can quickly spot while scrolling through the code?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000