I'm using VisualStudio 2010 with VS.PHP. When I write or open a javascript file it is not higlighted and intellisense is not working. All I see is plain text. It seems that VS does not "identify" the javascript file. When I manually order js files to open in Script editor (in Tools > Options > Text Editor > File Extension), nothing changes. Highlighter in (in Tools > Options > Environment > Tools and colors) is set properly. Do you have any ideas how can I run highlighting? Google says nothing.
-
My files are *.js . In addition I've tryied to set JS files to open as another file types (in Tools > Options > Text Editor > File Extension). Highlighting works partly, because I'm higlighting another language (sql). Unfortunately, my code is underlined red because of syntax errors (because I'm opening javascript end "editing" sql). I'm becoming desperateMartin Strouhal– Martin Strouhal2011-08-02 07:26:57 +00:00Commented Aug 2, 2011 at 7:26
Add a comment
|
3 Answers
You probably removed the "Web Developer 2010" component when installing your Visual Studio. Or you are using one of the Express editions.
1 Comment
Dan Mitchell
This was what I was missing -- the tricky part is that at install time, the installer says web developer 2010 is "to write websites in VB or C#", but it also gets you better support for javascript.
I've had the same problem, and I just found a solution that works for me.
- Open VS 2010
- Select Tools / Options... from the menu
- Open the Text Editor / File Extension property page
- Add an entry for the "js" file extension and set the editing experience to "Script Editor"
I still don't know why this doesn't work out of the box, but at least this fixes the issue.
Comments
2 Comments
Martin Strouhal
I have tried this extension but it changes nothing. VS still shows plain text
Polina F.
Have you ever solved this problem? I have similar one - can't fix it for long time now. It happens only in one of my solutions ,I have several solutions. I have tried to open a new solution , but I have copied the javascript files , instead of creating new once. This is a big solution and I have no time to try again.