Visual Studio 2010 can't format complex JavaScript documents

流过昼夜 提交于 2019-12-07 23:31:38

问题


I have a custom JavaScript file and it's getting large. The problem is, though the whole JavaScript is well-written and there is no syntactical error (even colons are there), Visual Studio 2010 can't format the document. I extracted each part separately to a separate file, and there, formatting Ctrl + K + D or Ctrl + E, D works just fine. But when they come together formatting stops working. I saw other posts, and they had no such problem. So I posted my question here.I know that Visual Studio is still at it's infancy for JavaScript support. But do you have the same problem? Is there a way to make JavaScript experience better in VS2010?


回答1:


There are quite a few things you can do to improve your javascript experience:

1 - Install the WebStandards update: http://www.hanselman.com/blog/AnnouncingTheWebStandardsUpdateHTML5SupportForTheVisualStudio2010Editor.aspx

2 - Perhaps one or more of the Javascripts extensions will help you. Go to the Tools Menu, select Extensions, and then search for Javascript. (#1 is actually the first install that comes up).

But there are a number of other extensions that claim to improve javascript parsing. There's also a JSLint as well.

I hope these help!

  • Daniel



回答2:


I use Ctrl+E, F. Give it a try.



来源:https://stackoverflow.com/questions/6517019/visual-studio-2010-cant-format-complex-javascript-documents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!