How to troubleshoot automatic folding of code annotations in Visual Studio

Source: Internet
Author: User
Tags visual studio

Today, it's a whim to put a stored procedure in the code as an annotation, for versioning, such as the following code:

Because the stored procedure is very long and the annotation takes up a lot of lines, Yan Fu affects the layout and reading experience of normal code. You've also had this scenario before, by manually adding region to solve the problem.

However, today is really lazy to add region manually. So I stared at the long note and thought: VS, why are you so smart? Such a long annotation does not automatically fold, you can know that there is a charm called understanding.

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/

At this time, vaguely think of the previous encounter can be automatically folded notes. Google for a while, on the StackOverflow found such a phrase:

Multi Line Comments (prefixed with either/////*/are already ...

It turns out that Visual Studio has this kind of intelligence, so why not here?

It suddenly occurred to me to move the annotation to the outside of the method and try not to know, to try to laugh--the original annotation on the outside of the method can be automatically folded. See the following sample code:

1. Expand Status

2. Fold up the state

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.