本文介绍了Visual Studio 2010不能格式化复杂的JavaScript文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义的JavaScript文件,它变得越来越大。问题是,虽然整个JavaScript编写得很好,没有语法错误(即使冒号也在那里),但Visual Studio 2010不能格式化文档。我将每个部分分别提取到一个单独的文件,然后格式化 Ctrl + K + D Ctrl + E,D 工作得很好。但是,当他们一起格式化停止工作。我看到其他的帖子,他们没有这个问题。所以我在这里发布了我的问题。我知道Visual Studio仍然处于JavaScript支持的初级阶段。但是你有同样的问题吗?有没有一种方法可以使VS2010中的JavaScript体验更好?

解决方案

有很多事情可以做,以改善您的JavaScript经验:
$ b $ 1安装WebStandards更新: > http://www.hanselman.com/blog/AnnouncingTheWebStandardsUpdateHTML5SupportForTheVisualStudio2010Editor.aspx

$ b 2 - 也许一个或多个Javascript扩展可以帮助您。转到工具菜单,选择扩展,然后搜索Javascript。 (#1实际上是第一次安装出现)。

但还有其他一些扩展声称可以改善javascript解析。




  • Daniel


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?

解决方案

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

这篇关于Visual Studio 2010不能格式化复杂的JavaScript文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 18:45