To work with JS files in Visual Studio 2008, I did:
Tools -> Options -> Text Editor -> File Extensions
and added the js extension with the ability to edit Script.
This works pretty much as expected, in addition to the following things:
Syntax highlighting is configured very slowly (after 10 seconds or so) when opening a JS file. Compilation warnings are generated equally slowly, and they disappear slowly when fixed. In general, it doesn’t matter, but I wonder why. Until the file is highlighted in blue, you cannot set breakpoints.
Intelisense works, but not always. For example, if I use getElementById to get an element, intelisense does not work with this element. I assume this is context related, as the compiler cannot determine which object is in question. It also does not work inside the html page using the Script tag, but in this case the syntax highlighting will be immediate.
If there is a better approach?
Currently, I prefer to use an external editor and run it by adding a custom "open with" action in the js file. However, I do not like to do this because I cannot use the fantastic debugging capabilities of VS ...
source
share