简体   繁体   中英

Countering the shady JavaScript IntelliSense support in Visual Studio 2008

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?

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 :)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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