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.
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.
Use #pragma region. It won't do have regions hidden by default but it will allow you to collapse multiple functions at once.
精彩评论