thehogfather / brackets-code-folding

Code folding extension for brackets IDE
134 stars 42 forks source link

Support Folding Custom Regions with Line Comments #52

Closed wjapp-dev closed 10 years ago

wjapp-dev commented 10 years ago

Would be very useful to have support for custom regions in Brackets.

With WebStorm, the IDE I currently use, you can surround a fragment of source code with line comments using either Visual Studio or NetBeans style folding markers

I use it a lot in js files that contain multiple classes or within a single class to mark different subject areas of code, like an 'init' region, a 'server' region etc.

wjapp-dev commented 10 years ago

Also would like to be able to persist the state or at least mark the default state of a region

i.e. there are some regions I am not really interested in anymore and would like to see them closed every time I open the file, then just toggle them open when I need to.

thehogfather commented 10 years ago

Defining custom regions is a good idea. I remember using it a lot in visual studio. I will research how it is managed in other IDEs and see if it fits nicely with the Brackets ethos.

keleko34 commented 10 years ago

I have downloaded the source and developed/incorporated a foldHelper that allows for region code folding using comments, to use you just make a comment line as //Region name and then where you want it to end you refrence //Endregion for html it is similiar with when folded it still displays the entire region name line for viewing, let me know if you would like me to send the source it was rather quite simple.

thehogfather commented 10 years ago

Please send a pull request and I can tell and merge with my changes