views:

497

answers:

2

With the release of Visual Studio 2008, Microsoft implemented code-completion and IntelliSense support for JavaScript.

Unfortunately the support for JavaScript is shady at best--one of the major hassles being that when referencing external JavaScript files, the developer has to open and close JavaScript files to force Visual Studio to update it's definitions.

Is there a way to get around this?

+6  A: 

Yes there is:

Menu: "Edit" -> "IntelliSense" -> "Update JScript IntelliSense"

And the keyboard shortcut:

Ctrl + Shift + J



In case you're wondering; yes, I already the answer to my question (figured it out five minutes ago). I just wanted to share my new-found knowledge with my fellow JavaScript developers :)

roosteronacid
+2  A: 

Visual Studio 2008 is supposed to detect the reference changes. However the staleness check and update kickoff is done in a periodic maintenance event. It takes a few seconds after the change before the "Updating Intellisense..." message is displayed in the status bar.

As roosteronacid says, Ctrl-Shift-J will force an immediate update (and will update even if nothing has changed). That only affects externally referenced files though. IntelliSense from the file you are editing should always be current.

Alan Oursland