rerun
rerun

Reputation: 25505

Tell VS2010 to collapse regions

So I have written a t4 template which generates a ton of code and works well. The only issue is that most of the code never needs to be seen by developers so I have hidden in regions all of the boiler plate code . Is there any way (i'm assuming no) to give VS a hint in a c++ code file to go ahead and collapse the regions.

Upvotes: 4

Views: 447

Answers (2)

R. Martinho Fernandes
R. Martinho Fernandes

Reputation: 234654

You could generate the code into a separate file and then #include it where necessary. That way you won't have developers working directly on top of the generated code: they don't see it, and it makes possible future regenerations of that code very easy.

Upvotes: 2

Mike Kwan
Mike Kwan

Reputation: 24477

Use #pragma region. It won't do have regions hidden by default but it will allow you to collapse multiple functions at once.

Upvotes: 1

Related Questions