简体   繁体   中英

Visual Studio 2010 can't format complex JavaScript documents

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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