Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 #pragma region display style

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
jay.carlton Posted - May 11 2013 : 2:41:08 PM
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
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jun 12 2013 : 12:29:28 PM
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
jay.carlton Posted - Jun 12 2013 : 09:01:31 AM
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
feline Posted - May 13 2013 : 12:39:23 PM
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.

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