Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Macros & Highlighting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Krakken
Ketchup Master

Australia
63 Posts

Posted - Jan 16 2007 :  8:58:33 PM  Show Profile  Reply with Quote
Even though it's a small request, would it be possible to add an option to turn off syntax colouring for macro parameters. I use macros quite often and due to the way I use them, it can make my code look messy with random colours appearing in them. I can give you an example:


#define BIND_SCRIPT_COMMAND(FUNCTION) \ScriptSystem::BindCommand(#FUNCTION, ScriptCallback_##FUNCTION)

BIND_SCRIPT_COMMAND(DoSomething);


The above defines a shortcut that would expand to:


ScriptSystem::BindCommand("DoSomething", ScriptCallback_DoSomething)


The problem is that as "DoSomething" is not actually a command or defined anywhere else, it comes up as white. In other situations where there is a DoSomething() function around somewhere, it will highlight the function in whatever colour is specified.

I'd just really like to be able to disable it so it just stays the default text colour within the macro params.

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Jan 17 2007 :  07:26:39 AM  Show Profile  Reply with Quote
The problem with this is that you remove colouring from all macro parameters. So what about macro's that are applied to member variables, local variables, functions, etc?

Have you considered doing something like this:

#if 0
#define DoSomething;
#endif


Which tells VA how to colour DoSomething.

zen is the art of being at one with the two'ness
Go to Top of Page

Krakken
Ketchup Master

Australia
63 Posts

Posted - Jan 17 2007 :  6:26:45 PM  Show Profile  Reply with Quote
Sorry I don't think I quite follow. :p
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Jan 18 2007 :  10:01:40 AM  Show Profile  Reply with Quote
Assume I have the macro max(a, b) which takes two int's and returns the biggest. If I now have the code:

static int getBiggest(int foo1, int foo2)
{
    return max(foo1, foo2);
}


I know, not a brilliant function, but in this case people are going to want both references to "foo1" highlighted correctly. When the function becomes longer this becomes more important.

The work around I suggested, since the code is disabled the IDE ignores it, but VA will still scan this code, and will colour "DoSomething" as a #define, since it is one. This way you should get consistent colouring of "DoSomething".

zen is the art of being at one with the two'ness
Go to Top of Page

Krakken
Ketchup Master

Australia
63 Posts

Posted - Jan 18 2007 :  7:33:47 PM  Show Profile  Reply with Quote
I see what you mean now but that is something I think I can live with and why it would be nice if it was just an option available. Obviously it's not that important - just something I'd prefer over having to manually type out blank defines for every function I have. Maybe even if the option continued to colour numbers, text and variables but functions within a macro come out as the default text colour.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Jan 19 2007 :  07:17:56 AM  Show Profile  Reply with Quote
Initially I am reluctant to put in a request for this, since it is adding another option, another thing that can go wrong, and so far it only seems to benefit a very small number of people.

If you are using complex macro's to generate a lot of code have you considered getting the macro's to generate some form of:

#if VA_COLOUR_TRIGGER
#define DoSomething
#endif


block?

zen is the art of being at one with the two'ness
Go to Top of Page

Krakken
Ketchup Master

Australia
63 Posts

Posted - Jan 21 2007 :  10:05:03 PM  Show Profile  Reply with Quote
That's true and that should work. Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000