4

visual studio 2008 allows c# code to be segregated into regions is there an equivalent for javascript?

balalakshmi
  • 3,968
  • 6
  • 40
  • 48

3 Answers3

4

There is a way to do this in VS2008: highlight the section of code you want to collapse, then press the Ctrl-M+H chord.

I use this quite a bit when editing javascript files, but unfortunately it isn't permanent - the javascript code will be back to its regular self if you close and reopen the file. I've had js files open for weeks at a time in the editor in the past, simply to avoid losing all my carefully crafted collapsible regions.

slugster
  • 49,403
  • 14
  • 95
  • 145
2

Unfortunately Javascript don't support this. You can do the separation by comments.

/*My Region (Name It)*/
your scripts
/*End Region*/

Or you can see this thread how to do it. how to implement regions/code collapse in javascript

Community
  • 1
  • 1
Kronass
  • 5,266
  • 3
  • 19
  • 25
0

Alternatively you can collapse custom code sections in Dreamweaver, might be worth editing your JavaScript using that instead

Nick Allen
  • 11,970
  • 11
  • 45
  • 58