views:

109

answers:

1

To work with JS files in Visual Studio 2008, I did:

Tools -> Options -> Text Editor -> File Extensions

and added js extension with Script editing experience.

That works pretty much as expected apart from the following things:

  1. Syntax highlighting is set-up extremely slow (after 10 seconds or so) when I open the JS file. The compiling warnings are generated equally slow and they disappear slowly when fixed. Generally, not a big deal, but I wonder why. Until the file is syn highlighted, you can't put in breakpoints.

  2. Intelisense works, but not always. For instance, if I use getElementById to get the element, intelisense with that element doesn't work. I guess it has to do with context, as the compiler can't determine what kind of object is in question. It also doesn't work inside an html page using the script tag, but in this case syn highlighting is immediate.

If there is any better approach?

I am currently opting to use an external editor and to launch it by adding a custom "open with" action on js file. However, I don't like doing this because I can't use the fantastic VS debugging capabilities...

+1  A: 

The 3rd party addin Visual Assist X can help with js.

sean e