Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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.

like image 861
T. Webster Avatar asked Jul 01 '11 14:07

T. Webster


People also ask

Can I code JavaScript in Visual Studio?

You can write JavaScript or TypeScript code in Visual Studio for many application types and services.

How do I create a JavaScript file using Visual Studio code?

Step 1: Make a folder named JavaScript Project in C drive. Step 2: Open VS code editor on your computer system and go to File menu> Open folder and select the JavaScript Project folder that you made in the C drive. Now you will see JavaScript Project with many options in the VS code.

How do I start JavaScript in Visual Studio?

After installation of the code runner extension, open JavaScript Code in VSCode. Press CTRL+ALT+N shortcut or you may press F1 then write Run Code to run the code.


2 Answers

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.

like image 141
Jamie Treworgy Avatar answered Sep 28 '22 23:09

Jamie Treworgy


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!

like image 37
RoelF Avatar answered Sep 28 '22 22:09

RoelF