I have lost the support for JavaScript files inside Visual Studio 2015 after updating the TypeScript tools from version 1.5.3 to 1.5.4.
By support for JavaScript I mean intellisense, syntax coloring and the JavaScript options inside Options menu -> Text Editor.
My js files look like txt files now.
I have already tried many things:
The steps in this answer: Visual Studio 2015 CTP - Javascript support missing
Repair TypeScript Tools
Repair Microsoft Asp.Net and Web Tools 2015
Repair entire Visual Studio 2015
Nothing worked.
Does anyone knows a solution for this problem?
This is a known bug that we have fixed in VS 2015, however you could have been affected if you installed the "Universal Windows App Development Tools" during a specific period of time. We will soon be publishing a KB with the following workaround:
If the “Universal Windows App Development Tools” are still installed:
Go to Programs and Features, select Visual Studio 2105, click Change.
In Visual Studio setup, click Modify.
Deselect the feature “Universal Windows App Development Tools”
Select “Universal Windows App Development Tools” again, and click Update.
If you have already uninstalled the “Universal Windows App Development Tools”:
Reinstall “Universal Windows App Development Tools”
Or, take the following steps to reinstall the JavaScript project system and language service:
Download the installer for your edition of Visual Studio, e.g. vs_community.exe.
Open a CMD window, and run the following command: vs_community.exe /modify /installselectableitems JavaScript_Hidden /passive
Sorry for the trouble. Hope that helps.
Found a workaround to rollback to TypeScript 1.5.3 and get back support for JS:
From Programs and Features, uninstall TypeScript Tools 1.5.4 and Microsoft Asp.Net and Web Tools 2015
Download VS 2015 offline installer (Reference: How to install VS2015 Community Edition offline)
Inside the download directory from step 2, navigate to "packages\WPT" and install "webtoolsextensionsvs14.msi" (Microsoft Asp.Net and Web Tools 2015)
Then navigate to the folder (inside the download directory) "OfflineCache\installers". You will see two TS folders: "TypeScriptV1" and "TypeScriptV2". They are the installers for the versions 1.5.3 and 1.5.4 respectively.
Install TypeScript Tools 1.5.3 (using the installer inside the folder "TypeScriptV1")
Now, start Visual Studio. At this point JavaScript support should be back, and TS support still available.
NOTE: there is no independent installer for TypeScript Tools for VS 2015 (Reference: Typescript 1.5 for VS2015 without internet access)
UPDATE:
As Mohamed Hegazy noted, the TypeScript installers are available to download on: TypeScript for Visual Studio 2015
In my case, here is the way I fixed it:
Tools > Options > Text Editor > JavaScript > Intellisense > References
Make sure you Implicit (Web) is selected under Reference Group
Make sure that ~/Scripts/references.js is added in the include files list
Hope it will help you
Related
I created a new React standalone boilerplate app with VisualStudio 2022.
I was able to run the app but IntelliSense is completely failing.
Visual Studio Version:
Microsoft Visual Studio Community 2022 Preview (64-bit) Version 17.0.0
Preview 2.0
What can be reason for this or is there any way I can turn it on manualy?
Here's what I tried.
Checked “C:\Program Files (x86)\Microsoft SDKs\TypeScript” directory - This is the default directory for Javascript and TypeScript language services. But I can't find a folder name with TypeScript there.
Checked If TypeScript SDK is installed - Opened VisualStudio installer but I can see TypeScript 4.2 SDK is already ticked. Not sure where it is installed. (Attached screenshot)
Tried to generate logs from language service but the logs are not generating with the commands I tried. (Attached screenshot)
This is my package.json
I am developing some JavaScript program on Visual Studio running on Windows10. But, I must use another laptop for a while which is installed Windows7.
I installed VS2017 Community on the laptop, and I copied the all project files from the desktop to the laptop. Then, I found I couldn't open the project (the VS's solution file) because the version is not supported with it(both use VS2017 with same version. What does it mean by that?).
I also tried to create a new empty JavaScript project on the laptop, but I couldn't go beyond the UWP choice menu because the message said this project type was not supported by this install.
So, I researched about it, and some websites say I better install all versions of WindowsSDK from the installer. So, I picked all version of them, and installed. But, I still cannot solve any of the trouble.
My JavaScript program is not using any Windows specific codes. Does Visual Studio requires Windows10 for JavaScript program development? Do I need to install Windows10 and then VS2017 on the laptop if I want to develop a JavaScript base program?
Check your edition of VS2017 on your Windows 10 VM. Click Help, About.
It may be the project template type isn't supported by Community edition. Check the project template type back on your Windows 10 VM as well.
Alternatively, check the version of VS2017 on Windows 7. There have been reported issues of the Community edition missing Web App project templates (see here).
I can't really reproduce the issue, but no highlighting or intellisense is working in .js files, it works just fine in .json files however.
The default editor for .js files is JSON Editor.
I tried safe-mode, disabling all extensions, resetting all settings, and I even reinstalled the IDE (repair), but the issue still persists.
I will add, that when I launch the IDE and a JS file is open on scope, I get the following error message (highlighting and intellisense don't work anyway):
The 'JavaScriptWebExtensionPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information examining the file 'C:\Users\Shimmy\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
Restarting Visual Studio could help resolve the issue.
Continue to show this error message?
Here you can view the ActivityLog.xml file, I pasted in some of the recent lines I think might be relevant:
<entry>
<record>188</record>
<time>2015/08/14 13:00:57.332</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [JavaScriptWebExtensionsPackage]</description>
<guid>{30DB8F9B-EC9F-44D6-B377-83C7C27A1A8B}</guid>
</entry>
<entry>
<record>189</record>
<time>2015/08/14 13:00:57.394</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [JavaScriptWebExtensionsPackage]</description>
<guid>{30DB8F9B-EC9F-44D6-B377-83C7C27A1A8B}</guid>
<hr>80131500</hr>
<errorinfo>Expected 1 export(s) with contract name "Microsoft.VisualStudio.JavaScript.Web.Extensions.ReferenceAutoSync.IReferencesFilePathProvider" but found 0 after applying applicable constraints.</errorinfo>
</entry>
<entry>
<record>190</record>
<time>2015/08/14 13:00:57.394</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [JavaScriptWebExtensionsPackage]</description>
<guid>{30DB8F9B-EC9F-44D6-B377-83C7C27A1A8B}</guid>
<hr>80131500</hr>
<errorinfo>Expected 1 export(s) with contract name "Microsoft.VisualStudio.JavaScript.Web.Extensions.ReferenceAutoSync.IReferencesFilePathProvider" but found 0 after applying applicable constraints.</errorinfo>
</entry>
I found answer here: Visual Studio 2015 RTM - Lost JavaScript support after update TypeSript Tools
These are the steps to fix it:
If the “Universal Windows App Development Tools” are still installed:
Go to Programs and Features, select Visual Studio 2015, click Change.
In Visual Studio setup, click Modify.
Deselect the feature “Universal Windows App Development Tools”
Select “Universal Windows App Development Tools” again, and click Update.
If you have already uninstalled the “Universal Windows App Development Tools”:
Reinstall “Universal Windows App Development Tools”
Or, take the following steps to reinstall the JavaScript project system and language service:
Download the installer for your edition of Visual Studio, e.g., vs_community.exe.
Open a CMD window, and run the following command: vs_community.exe /modify /installselectableitems JavaScript_Hidden /passive
I've followed the first steps and got back Javascript support.
Hope this helps
-UPDATED-
After I did the above steps, almost everything was working, except that I got an error message every time I opened a .js file, the following did the trick:
My guess is that only reinstalling the SDK didn't update the MEF cache. You can do this manually by following these steps:
Open a command prompt as administrator
CD into C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE
Run devenv /updateconfiguration
Run devenv /clearcache
That got rid of the last error, and everything is working fine.
Source: https://github.com/Microsoft/TypeScript/issues/4238
The issue seems to be fixed on Update 1. I'm on the professional version but I imagine that it applies to all versions.
To be clear, Intellisense was not working for me for css related stuff on razor files and post update 1 it seems to be working.
I know this question is clearly targeting Visual Studio 2015.
However, I wanted to put my two cents in for those who desperately tried out if the accepted answer also works for Visual Studio 2017.
In my case, the loss of syntax highlighting was caused by the new javascript language service. I got it back right after deselecting the following checkbox and restarting Visual Studio:
Tools > Options > Text Editor > JavaScript/TypeScript > Language
Service > Enable the new JavaScript language service.*
Reference: https://developercommunity.visualstudio.com/comments/34109/view.html
Environment:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51209
I have a website project that contains some javascript files. Visual Studio minifies javascript files automatically -- for example, if the "source" file is called "myscript.js" -- Visual Studio will also create a minified version called: "myscript.min.js" -- which is great...
When I right-click on the file name in Solution Explorer and select "Publish myscript.js" - Visual studio publishes three files:
myscript.js
myscript.min.js
myscript.min.js.map
However, I want to publish ONLY the minified version of the file to the web site -- problem is, if I use the "Exclude From Project" setting (right-click on "myscript.js" -> Exclude From Project"); Visual studio will also exclude the minified version of the source file.
Is there a setting in Visual Studio that allows us to specify that only the minimized version of the file be published when selecting the "Publish" option within Solution Explorer???
PLEASE NOTE: I am NOT asking for an MSBuild or MSDeploy solution (this is NOT a web APPLICATION; it is a website project) -- I want to be able to publish a single file at a time (in this case javascript) but I do NOT want the main source file published -- only the minified version.
The only solution I have found is to manually publish the minified version, and then manually delete the "source" file from the web site; but it would be nice if Visual Studio had a setting that would prevent the javascript "source" file from being uploaded to the server.
Perhaps no such option exists? (Guess I am just looking for confirmation).
Thanks.
My advice would be to use Web Essentials (http://vswebessentials.com/) and go to Web Essentials => Edit Global JSCS Settings (.jscssrc) and add
"excludeFiles": ["scripts/myfile.js","app/services/*", "app/controllers/*"]
More info here: How can I configure Web Essentials 2013 to ignore files?
I am starting with Visual Studio 2012 and porting a cordova/phonegap application, that's why I need to have a javascript editor for js file.
In order to get it, I followed this S.O. post
but there is nothing for javascript and I cannot install any extension (because it is an express version).
Is there a way to get anything better and still using VS as IDE?
I created a cordova project this way: