简体   繁体   English

如何使VS2012自动格式化Java注释块(如C#注释)

[英]How do I get VS2012 to autoformat Javascript comment blocks like C# comments

I'm trying to get Visual Studio 2012 to auto-format my comment blocks like it does for my C# blocks. 我正在尝试使Visual Studio 2012像我的C#块一样自动格式化我的注释块。 I want my comments to look like this: 我希望我的评论看起来像这样:

/*
 * Here is my C# comment block
 * As I type, more [space]*[space] chars are prefixed to every new line
 */

But instead I get this: 但是我得到了这个:

/*
Here is my javascript comment block
Where are my asterisks?  :(
*/

It's aggravating that I can't define this behaviour in the Tools > Options > Text Editor > Javascript menu. 更糟的是,我无法在“工具”>“选项”>“文本编辑器”>“ Javascript”菜单中定义此行为。 I've got the Web Essentials extension, but it does not automatically help format my comment blocks. 我有Web Essentials扩展程序,但是它不能自动帮助格式化我的注释块。 I've also tried editing within an HTML page < script > node, but it doesn't work there either. 我也尝试过在HTML页面<script>节点中进行编辑,但是在此也不起作用。

Any help is greatly appreciated. 任何帮助是极大的赞赏。

How about write a new snippet file? 如何编写新的代码段文件? Here is a website, but it's in Chinese. 这是一个网站,但是它是中文的。 How to wirte a new snippet file in Visual Studio 如何在Visual Studio中编写新的代码片段文件

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

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