简体   繁体   English

使用 Visual Studio (2010) 在 javascript 中编程?

[英]programming in javascript with Visual Studio (2010)?

Whether you are forced to code javascript in Visual Studio 2010, or insist on using Visual Studio 2010 instead of another IDE, I'm wondering what anyone has done to improve the javascript development experience in VS2010.无论您是被迫在 Visual Studio 2010 中编写 javascript,还是坚持使用 Visual Studio 2010 而不是另一个 IDE,我都想知道在开发过程中,有人做了什么来改善 ZDE9B9ED78D7E2E1DCEEFFEE7820109 的开发体验。

I'm asking since javascript support is lacking in Visual Studio 2010. You don't get the the kind of support you get as if you were developing Silverlight apps in C# and XAML. I'm asking since javascript support is lacking in Visual Studio 2010. You don't get the the kind of support you get as if you were developing Silverlight apps in C# and XAML. For example, the intellisense doesn't support javascript 1.8.5 (or even 1.6 functions ie JSON.Parse), it's difficult to navigate to function or object definitions (no Go To Definition), no Object Browser, Call Hierarchy, and the list can go on. For example, the intellisense doesn't support javascript 1.8.5 (or even 1.6 functions ie JSON.Parse), it's difficult to navigate to function or object definitions (no Go To Definition), no Object Browser, Call Hierarchy, and the list可以 go 上。

What have you done to compensate for the VS2010 features that don't exist for javascript?做了什么来弥补 javascript 不存在的 VS2010 功能? Also, what would be a good feature request to support javascript development;此外,支持 javascript 开发的良好功能要求是什么? anything that VS2010 should add as an extension or a future release? VS2010 应该添加什么作为扩展或未来版本? Also, are there any suggestions to manage the.js code for large projects?另外,对于管理大型项目的 .js 代码有什么建议吗?

A few things that have helped me so far are the JScript Editor Extensions, and the Web Standards Update .到目前为止对有帮助的一些东西是 JScript Editor Extensions 和Web Standards Update Also, when working in.js files I rely on bookmarks to get back to key places, since the functions of the file aren't visible (as the would be in C#).此外,在处理 in.js 文件时,我依靠书签返回关键位置,因为文件的功能不可见(就像在 C# 中那样)。 My feature request would be to add intellisense support by javascript version, similar to how you can target .NET 2.0, 3.5, or 4.0.我的功能请求是通过 javascript 版本添加智能感知支持,类似于您如何定位 .NET 2.0、3.5 或 4.0。

There are a number of VS extensions to assist with javascript:有许多 VS 扩展来协助 javascript:

Visual Studio Javascript extensions feature comparison Visual Studio Javascript 扩展功能比较

JSEnhancements is awesome, and does what you really want: adds regions and code block collapsing. JSEnhancements 很棒,可以做你真正想要的:添加区域和代码块折叠。

Also see this extension: http://code.google.com/p/js-addin/另请参阅此扩展名: http://code.google.com/p/js-addin/

which parses your script into an object tree that can be used for navigation.它将您的脚本解析为可用于导航的 object 树。

I have also used the free version of this editor: http://www.yaldex.com/JSFactory_Pro.htm我也用过这个编辑器的免费版: http://www.yaldex.com/JSFactory_Pro.htm

I can't recommend it, unfortunately, because it suffers from a couple critical problems (awkward UI, freaky intellisense, and not entirely stable).不幸的是,我不能推荐它,因为它存在几个关键问题(尴尬的用户界面,怪异的智能感知,并且不完全稳定)。 Which is too bad because it's a very thoughtfully designed piece of software by and large, it just fails where the rubber meets the road.这太糟糕了,因为它总体上是一个设计非常周到的软件,它只是在橡胶与道路相遇的地方失败了。

1) Install Resharper , helps a lot when building javascript heavy web apps. 1) 安装Resharper ,在构建 javascript 重型 web 应用程序时有很大帮助。
2) Get FireBug for debugging. 2) 获取FireBug进行调试。
3) Also, the JQuery.vsdocs files are sometimes helpful! 3) 此外,JQuery.vsdocs 文件有时很有帮助!

While I use vim and Notepad++ to cut code, I feel your pain, or did until I started using Firebug to debug JavaScript.当我使用 vim 和 Notepad++ 来剪切代码时,我感受到了你的痛苦,或者直到我开始使用 Firebug 调试 JavaScript。 While it many not be exactly fitting for your situation it's invaluable to me in developing Web based apps:虽然它很多并不完全适合您的情况,但在开发基于 Web 的应用程序时对我来说非常宝贵:

http://getfirebug.com/ http://getfirebug.com/

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

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