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
 Technical Support
 #pragma region display style
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jay.carlton
Ketchup Master

USA
65 Posts

Posted - May 11 2013 :  2:41:08 PM  Show Profile  Reply with Quote
Hi,

I like using region directives, and the Surround With #pragma Region capability in VA has served me well so far. I was wondering if there were a way to display the #pragma region and #pragma endregion source lines in a different style, so that they wouldn't look like actual executable code. A code reviewer pointed out that they interfere with the flow, and I was reluctantly forced to agree: for small regions, the #pragma directives clutter up the code considerably.

If there isn't a way to do this in Visual Studio or VA, would you consider that as an enhancement request?

Thanks,
Jay

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - May 13 2013 :  12:39:23 PM  Show Profile  Reply with Quote
In VS2010 you can use the IDE options -> Environment -> Font and Colors to change the colour settings for "Preprocessor Keyword", which will change the colouring of #pragma, making it much more distinct, so you can easily pick it out, or more subtle, so it is less obvious.

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

jay.carlton
Ketchup Master

USA
65 Posts

Posted - Jun 12 2013 :  09:01:31 AM  Show Profile  Reply with Quote
Thank you. Sorry, I had missed your reply until now somehow.

If I that IDE setting, it also changes #define, #include, and other keywords as well? I would really like a way to override the style for region and endregion pragmas only, since they don't have any effect on the executable, wheres the others can have quite large effects.

I realize this is a small complaint in the grand scheme of things, but maybe if there were a way to define a custom style override regex or something I could do this and similar things as a user rule. (For example, we have many common macros and utility functions that I might want to color differently).

Thanks again for the speedy response.

-Jay
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jun 12 2013 :  12:29:28 PM  Show Profile  Reply with Quote
We need our colouring code to run very quickly, to try and keep up with scrolling and editing, so adding complex rules, especially complex regular expression rules is not going to work well, far to much scope for slowing things down unfortunately.

The default IDE intending behaviour for #pragma lines is to place them at the start of the line, with zero indent. This should help to make them more distinct inside functions, since they will have a different indent to the rest of your code.

Another thought is to replace the #pragma region lines with a start region and end region macro, and then tell VA to colour macro's in a distinct colour, via:

VA Options -> Advanced -> Fonts and Colors -> Preprocessor macros

zen is the art of being at one with the two'ness
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