简体   繁体   English

visual studio 2008区域相当于javascript

[英]visual studio 2008 regions equivalent for javascript

visual studio 2008允许将c#代码分隔成区域是否有相当于javascript的东西?

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. 有一种方法可以在VS2008中执行此操作:突出显示要折叠的代码部分,然后按Ctrl-M+H和弦。

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. 我在编辑javascript文件时使用了这一点,但遗憾的是它不是永久性的 - 如果你关闭并重新打开文件,javascript代码将恢复到常规自身。 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. 我过去在编辑器中一次打开了几个星期的js文件,只是为了避免丢失我所有精心设计的可折叠区域。

Unfortunately Javascript don't support this. 不幸的是Javascript不支持这个。 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 如何在javascript中实现区域/代码崩溃

或者,您可以折叠Dreamweaver中的自定义代码部分,可能值得使用它来编辑JavaScript

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM