How to fold the code section without touching the scope in the Visual Studio?

Asked 2 years ago, Updated 2 years ago, 39 views

When you lower the scope using brackets in the Visual Studio, it supports the ability to fold or peel the code for each lowered scope. For example,

You click on the mouse to {...} We're talking about a function that doesn't look at that part. I'm sure a lot of you know

The problem is that I overstretched the global variable-area... Sorry -_- I know I have a problem. Anyway, I held it too long.

The content of this part is quite clear, so I want to fold it for the convenience of development.

But since I'm discharged from the military, I can't put in brackets for no reason.

Is there a way to set the section where you fold a random part of the code?

Google Inc

How to fold some specific lines didn't separate by brace in visual studio ? I searched it on my back... I couldn't find an answer because English was weird.

If you have any know-how, please share it.

visual-studio

2022-09-21 21:46

1 Answers

Self-answer through stack overflow.

#pragma region interval name
 a folding section
#pragma endregion

If you put it in, you can fold any section of the question-and-answer dance.

Similarly, in Pycharm, you can fold it into #region #endregion.


2022-09-21 21:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.