Board index » Visual Studio » Hiding macro lines in Visual Studio

Hiding macro lines in Visual Studio

Visual Studio107
I am working on a large commercial app with 40 current developers that

have been working on this app for about 10 years now (we are currently

developing version 10 that will ship in September). The group developed

a very useful debugging tool that dumps whatever information we want to

see while the app is running. This is a macro that collapses to null in

a shipping build.



The problem is that some areas of the code have massive TRACE

statements, inserted during debugging of those sections. We really

don't want to remove the TRACE statements (they have two control

parameters that give us 10,000 separate control points in the external

watching app, letting us to on and off various statements at run time.



These statements are so dense in some areas that they make reading the

code difficult. So now the question...



Is there any way in Visual Studio to hide all macro statements? That

is, we'd like a button to press that would collapse all TRACE (or other

macro) calls within the source file, hiding them from the person reading

the code. Pressing that same magic button would toggle, and bring the

macros visible again.



--

- Burt Johnson

MindStorm, Inc.

www.mindstorm-inc.com/software.html


-
 

Re:Hiding macro lines in Visual Studio

In VS.NET you can literally toggle sections of code on and off, see the

outlining after you have selected and right clicked text. - Only sustained

while the file is open in the IDE tho.



--

- Mark Randall

zetech.swehli.com">zetech.swehli.com



"Burt Johnson" <burt@mindstorm-inc.com>wrote in message

Quote
I am working on a large commercial app with 40 current developers that

have been working on this app for about 10 years now (we are currently

developing version 10 that will ship in September). The group developed

a very useful debugging tool that dumps whatever information we want to

see while the app is running. This is a macro that collapses to null in

a shipping build.



The problem is that some areas of the code have massive TRACE

statements, inserted during debugging of those sections. We really

don't want to remove the TRACE statements (they have two control

parameters that give us 10,000 separate control points in the external

watching app, letting us to on and off various statements at run time.



These statements are so dense in some areas that they make reading the

code difficult. So now the question...



Is there any way in Visual Studio to hide all macro statements? That

is, we'd like a button to press that would collapse all TRACE (or other

macro) calls within the source file, hiding them from the person reading

the code. Pressing that same magic button would toggle, and bring the

macros visible again.



--

- Burt Johnson

MindStorm, Inc.

www.mindstorm-inc.com/software.html">www.mindstorm-inc.com/software.html





-

Re:Hiding macro lines in Visual Studio

Mark Randall <markyr@REMOVETHISgoogle.ANDTHIScom>wrote:



Quote
In VS.NET you can literally toggle sections of code on and off, see the

outlining after you have selected and right clicked text. - Only sustained

while the file is open in the IDE tho.



Thanks. I know about the toggling of a section here and there,

transient to the current open window in VS. I am hoping for some more

global and automatic operation. Kind of like code coloring, but in this

case code hiding. I would then use those outline buttons to expand the

macros if I decided I wanted them for a specific module.



--

- Burt Johnson

MindStorm, Inc.

www.mindstorm-inc.com/software.html">www.mindstorm-inc.com/software.html

-

Re:Hiding macro lines in Visual Studio

Burt Johnson wrote:

Quote
Mark Randall <markyr@REMOVETHISgoogle.ANDTHIScom>wrote:





>In VS.NET you can literally toggle sections of code on and off, see the

>outlining after you have selected and right clicked text. - Only sustained

>while the file is open in the IDE tho.





Thanks. I know about the toggling of a section here and there,

transient to the current open window in VS. I am hoping for some more

global and automatic operation. Kind of like code coloring, but in this

case code hiding. I would then use those outline buttons to expand the

macros if I decided I wanted them for a specific module.





Hi Burt,



In VS 2005 (which you can check for free with the Express version), we

have implemented something that doesn't quite solve your problem but

will definitely help. Any code that will be pre-processed out based on

macro definitions is grayed out by Intellisense. Some other customers

have asked me for the functionality you desribe and I am investigating

having that feature as an addon.



--

Boris Jabes, Visual C++ Team

This posting is provided "AS IS" with no warranties, and confers no rights

-

Re:Hiding macro lines in Visual Studio

Boris Jabes [MSFT] <borisj@online.microsoft.com>wrote:



Quote
In VS 2005 (which you can check for free with the Express version), we

have implemented something that doesn't quite solve your problem but

will definitely help. Any code that will be pre-processed out based on

macro definitions is grayed out by Intellisense. Some other customers

have asked me for the functionality you desribe and I am investigating

having that feature as an addon.



Interesting feature, and thanks for letting me know. Do put in a vote

from me (actually about 60 votes, since that is how many licenses our

team has, and they have pretty much all said they wanted it) for this

feature.



Ideally, I would like to see an option in the solution/project to define

which macros should be auto-collapsed. Then a toolbar button to allow

all such defined macros to be expanded/collapsed.



In our case, we would use it for the TRACE macro that we designed. This

would be a nice way to be able to just see our logic, and to see the

TRACE statements only when desired.



--

- Burt Johnson

MindStorm, Inc.

www.mindstorm-inc.com/software.html">www.mindstorm-inc.com/software.html

-