简体   繁体   English

逐行缩进Javascript文件?

[英]Indenting Javascript file line by line?

Is there any way in visual studio 2010 to indent javascript file line by line? 在Visual Studio 2010中,有什么方法可以逐行缩进javascript文件? I have got a big javascript file where all code is just on one line, so readability of the code is too much compromised. 我有一个大的javascript文件,其中所有代码都只在一行上,因此代码的可读性受到很大影响。

Any hint? 有什么提示吗? Thanks 谢谢

One solution is to copy the entire file content in this site : http://jsbeautifier.org/ then press the Beatify JavaScript or HTML button, and you will get the js properly formated. 一种解决方案是复制此站点中的整个文件内容: http ://jsbeautifier.org/,然后按Beatify JavaScript或HTML按钮,您将获得正确格式化的js。

Now I suppose that Visual Studio could have a service identical to the sugested one, but I have not used it at all. 现在,我想Visual Studio可以提供与建议的服务相​​同的服务,但是我根本没有使用它。

The PhpStorm that I am in love with it, has this option, to beautify the code if the code is compressed, as well allows me to define the look of the code format. 我喜欢的PhpStorm具有此选项,如果代码经过压缩,可以美化代码,也可以定义代码格式的外观。

Also, as already described by @Andreas, you can use the plugin : http://visualstudiogallery.msdn.microsoft.com/41a0cc2f-eefd-4342-9fa9-3626855ca22a 另外,如@Andreas所述,您可以使用插件: http ://visualstudiogallery.msdn.microsoft.com/41a0cc2f-eefd-4342-9fa9-3626855ca22a

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

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