Questions tagged [code-regions]
16 questions
156
votes
18 answers
how to implement regions/code collapse in javascript
How can you implement regions a.k.a. code collapse for JavaScript in Visual Studio?
If there are hundreds of lines in javascript, it'll be more understandable using code folding with regions as in vb/C#.
#region My Code
#endregion

Prasad
- 58,881
- 64
- 151
- 199
42
votes
8 answers
Regions/code collapse in Javascript in Visual Studio 2010
Is it possible to create code regions in JS files in Visual Studio 2010?
This method works in 2005, but I can't get working in 2010.

Mr. Flibble
- 26,564
- 23
- 69
- 100
33
votes
9 answers
Code regions not allowed within method bodies in VB.NET?
Note: This "feature" has now been added to Visual Studio 2015 but the question will hold a while since not every developer or every dev shop gets access to the latest and greatest IDE as soon as it comes out.
ORIGINAL QUESTION:
Normally I wouldn't…

Paul Sasik
- 79,492
- 20
- 149
- 189
18
votes
4 answers
Can you set some sort of custom code folding in Netbeans like in Visual Studio
When working on C#, I often do this:
#region Properties
public int Property1{get;set;}
...(more properties)
#endregion
This makes Visual Studio add the option to fold the code inside the region.
Offcourse, you can use regions for anything, it's…

KdgDev
- 14,299
- 46
- 120
- 156
6
votes
1 answer
How to save code folding after IDE restart?
I've tried to use code regions https://www.jetbrains.com/help/pycharm-edu/code-folding.html#surrounding_with_comments , folded some regions and restarted PyCharm.
When IDE has been restarted, all folded code regions were expanded.
How to save code…

Arthur
- 3,253
- 7
- 43
- 75
5
votes
1 answer
Android samples comments BEGIN_INCLUDE END_INCLUDE
While reading some android samples I usually see comments like
// BEGIN_INCLUDE (something)
// END_INCLUDE (something)
However, my current IDE — Android Studio 1.1 — can not recognise them (or maybe I do something wrong). I guess, they serve as…

Fyodor Volchyok
- 5,610
- 4
- 28
- 45
3
votes
2 answers
Folding of comments in PyCharm
For a long time I was looking for a way to fold comments in PyCharm. Basically I was looking for a way to achieve the same + for comments as for the block of code.

Salvador Dali
- 214,103
- 147
- 703
- 753
2
votes
2 answers
Re run a specific region of the code in R
I'm working in R and I need to re-run a region of the code that is written above the line where I 'm working at. I mean, just a specific part of the code, a few lines. For example :
1 x <- c(0:10)
2
3 #Start of region to rerun…

user18780359
- 23
- 2
2
votes
2 answers
Why StyleCop rule does not allow using #region in code?
I get the warning as below screenshot and I don't understand why it would be treated like that. I often need to "regionize" my codes.
What do you think?

Nam G VU
- 33,193
- 69
- 233
- 372
2
votes
1 answer
Is there anything in Matlab analogous to C#'s #region / #endregion code collapsing structure?
I'm working with some matlab code and using good block comments to head off certain sections of the document, but it sure would be nice to just collapse the whole lot of sections once I'm done fleshing them out. General purpose code formatting…

jxramos
- 7,356
- 6
- 57
- 105
2
votes
2 answers
Regions in Delphi - is it possible to define them unfold by default?
Since Delphi 2005 Borland/CodeGear introduced the regions in the IDE. It is good idea but in some casses I want my regions to be unfolded by default in other folded. If there argument or options that will do the job? I'm using Delphi 2007.

Nik Todorov
- 758
- 1
- 6
- 17
0
votes
2 answers
Can I configure IntelliJ Idea to recognize custom code folding regions designation?
I like c# #region...#endregion facility a lot (some people say that's a bad habit but let's not discuss that). I miss it a lot when coding other languages. The obvious way to "add" it to other languages is to use special-formed comments the editor…

Ivan
- 63,011
- 101
- 250
- 382
0
votes
0 answers
Why are region headings blurry?
I recently migrated from visual studio code to visual studio (because vsc and unity wouldn't be friends), and my only gripe is minor, yet a major annoyance: Despite all other text looking fine and crisp, collapsed region headers are so blurry they…

Rexor4321
- 11
- 3
0
votes
1 answer
How do I prioritize #regions for folding in Visual Studio Code?
I am trying to get used to using VSCode for C# development with Unity. I have noticed that region folding is supported but it seems to be keyed off anything with a '#' symbol. For example observe the following code snippet;
#region FOO
//Some…

JimmyDeemo
- 313
- 1
- 15
0
votes
2 answers
Is it OK to put javascript/jquery code in multiple-level curly braces?
My intention is to create C#-like custom code region for my jquery/js scripts.
I just don't know if it is OK or may create any un-awareness bug later on?
E.g.
{ //region Some Region Description
console.log('Some js code');
{ //region Inner…

Nam G VU
- 33,193
- 69
- 233
- 372