最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

programming in javascript with Visual Studio (2010)? - Stack Overflow

programmeradmin2浏览0评论

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.

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 i.e. 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.

What have you done to compensate for the VS2010 features that don't exist for javascript? Also, what would be a good feature request to support javascript development; anything that VS2010 should add as an extension or a future release? Also, are there any suggestions to manage the .js code for large projects?

A few things that have helped me so far are the JScript Editor Extensions, and the 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#). 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.

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.

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 i.e. 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.

What have you done to compensate for the VS2010 features that don't exist for javascript? Also, what would be a good feature request to support javascript development; anything that VS2010 should add as an extension or a future release? Also, are there any suggestions to manage the .js code for large projects?

A few things that have helped me so far are the JScript Editor Extensions, and the 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#). 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.

Share Improve this question asked Jul 1, 2011 at 14:02 T. WebsterT. Webster 10.1k6 gold badges74 silver badges96 bronze badges 5
  • 4 Code, compile, pray it doesn't break. – slandau Commented Jul 1, 2011 at 14:03
  • What is "javascript 1.8.5"? Either way, Resharper 6 comes with a lot of improved js support, intellisense is part of that (and reflected upon based on included javascripts IIRC. – jishi Commented Jul 1, 2011 at 14:10
  • @jishi see: developer.mozilla.org/en/JavaScript/New_in_JavaScript/1.8.5 – T. Webster Commented Jul 1, 2011 at 14:12
  • 2 I wouldn't advise using anything that's not part of ECMA standard unless you only want your web site to work in firefox. Just sayin'. – Jamie Treworgy Commented Jul 1, 2011 at 14:27
  • @jamietre maybe so, but it still would be nice to at least have the option of javascript 1.6 intellisense support. Some js APIs e.g. websockets are still in draft, too, but that doesn't mean to not try experimenting with it. – T. Webster Commented Jul 1, 2011 at 16:52
Add a comment  | 

3 Answers 3

Reset to default 6

There are a number of VS extensions to assist with javascript:

Visual Studio Javascript extensions feature comparison

JSEnhancements is awesome, and does what you really want: adds regions and code block collapsing.

Also see this extension: http://code.google.com/p/js-addin/

which parses your script into an object tree that can be used for navigation.

I have also used the free version of this editor: 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.
2) Get FireBug for debugging.
3) Also, the JQuery.vsdocs files are sometimes helpful!

While I use vim and Notepad++ to cut code, I feel your pain, or did until I started using Firebug to debug JavaScript. While it many not be exactly fitting for your situation it's invaluable to me in developing Web based apps:

http://getfirebug.com/

发布评论

评论列表(0)

  1. 暂无评论