VS 2015: No highlighting and intellisense in JS files - javascript

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

Related

getting jdk and intellicode errors in vs code. how do i fix it?

I am a very early beginner to coding. I downloaded VS Code so that I could, you know, have somewhere to code in Java. However, I keep getting these two errors telling me these two extensions that I already have installed on VS Code are not working here are the error messages. I already searched through the odds and ends of StackOverflow and have tried everything, and nothing has worked. Any help would be appreciated.
I inputted some code into settings.json under a "java.configuration.runtimes" thing but nothing in it worked. I conformed it to my installation directories and current Java version
Do you have a JDK (Java Development Kit) installed?
If you are on Windows, you can check by clicking on the start button, and search through applications and programs for a Java folder.
If you are on MacOS or Linux, you can open up the terminal/command line and type in "java -version" and if it is properly installed, it will display the version.
If you do not find a JDK installed, install one from https://www.oracle.com/ca-en/java/technologies/downloads/
Download and install the Coding Pack for Java.
It would be helpful to follow this documentation to get started.

Javascript file editing stopped working with Eclipse 2020-06

I have been working on the exact same file directory with eclipse for many years. It just worked. I am using PHP, CSS, JS, HTML files.
Occasionally, I ran an automatic upgrade as described here. This also just worked.
Now after the latest upgrade, several things just stopped working:
In PHP files, the core commands are not auto-completed anymore. I searched for a solution, to no avail.
Javascript files don't get any special editor anymore.
Now my most pressing question is:
Where do I re-enable the good old Javascript editor?
Here's my Installation details:
The Eclipse IDE for PHP Developers is made up of components from various Eclipse projects. In the Eclipse IDE 2020-06 release the JavaScript support for .js file is no longer provided by the JavaScript editor from JSDT, but by Eclipse Wild Web Developer.
Wild Web Developer does not provide a separate Editor for JavaScript, but extends the Generic Text Editor by code completion, syntax highlighting, validation, navigation, etc. for JavaScript.
To get back the JSDT JavaScript editor you have to uninstall Eclipse Wild Web Developer and install JavaScript Development Tools from the Eclipse IDE 2020-03 release (I guess the problems if you had both were solved by simply removing or disabling the JavaScript editor in the 2020-06 release):
Uninstall Eclipse Wild Web Developer: In Help > About Eclipse IDE: Installation Details, in the Installed Software tab select Eclipse Wild Web Developer and click Uninstall...
Install JavaScript Development Tools from the 2020-03 release: In Help > Install New Software... work with https://download.eclipse.org/releases/2020-03 and choose JavaScript Development Tools to install
See also Eclipse IDE 2020-06 > New & Noteworthy > Eclipse PHP Development Tools
Had the same issue, using 2020-09. I found that Wild Web Developer (in Help > Eclipse Marketplace..) was indeed installed, but then I checked more info and it said
To see it in action, open the desired file with the Generic Editor that's included by default in the Eclipse IDE.
and when I opened the javascript file in the Generic Editor, I get all the fancy I need...
go to Window -> Preferences then type file associations then select *.js on the right side list, then select "Generic Text Editor" below and click "Default" button
Yes versions above 2020-05 works with General Editor as default editor for JS files in eclipse
Window--> Preferences --> File Associations --> Select (*.js) and then select Generic Editor

Eclipse Window Builder error under Java 10

Eclipse is running under 0, but this Java project has a 10 Java compliance level, so WindowBuilder will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version.
That is the error I'm getting when I installed the window builder. I have made sure both Eclipse and the project are running the same versions yet it is still giving me that error.
Edit:
proof
A MORE SIMPLE SOLUTION: This problem was giving me some difficulty and I hated the hassle of rolling back to a previous version of java to fix it.
There were some developers that workshopped an alternative solution that involved using the install new software function and updating the version of WB via this function. Worked beautifully. The solution is as follows
Wim Jongman CLA Friend 2018-06-06 11:31:54 EDT
...I just got a report back from a user that tells me that upgrading to WB 19.2. helped to solve this issue for him:
Check the installing new software link from [1]
Use the update site from [2]
Select to install everything except stuff that requires WDP
[1] http://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-129.htm&cp=0_3_17
[2] http://download.eclipse.org/windowbuilder/WB/integration/4.8/
Solution FOUND
Drop down to Java 9 and make sure to have 3.a Eclipse and you are good!
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase9-3934878.html
There is a link to get Java 9.
Thank you, Everyone, that helped!!
This problem may still occur with WindwowBuilder 1.9.2 and JDK 11 and may be the result of Eclipse itself being launched with an older Java virtual machine.
To solve it, first verify that Project JDK compliance is 11 (Project..Java Compiler..JDK Compliance), and that Java Build Path (Project..Build Path..Libraries) is set to JavaSE-11 (Both settings can also be configured as default for all projects in Window..Preferences..Java..Compiler and Java..InstalledJREs..ExecutionEnvironment).
If that does not solve the problem, then go to
Help..About Eclipse IDE..Installation Details..Configuration
and check the -vm entry to make sure that Eclipse is started with JDK 11.
On Windows the -vm property may be set to something like:
C:\Program Files\Java\jdk-11.0.4\bin\server\jvm.dll
If the configuration's -vm entry points to a lower Java version, then close Eclipse and launch it from the command line by appending ('-vm "path-to-JDK11\bin\server\jvm.dll"). You can also check the eclipse.ini file for the -vm entry (or add the -vm entry to the eclipse.ini file).

How can I get a Cordova project template working in Visual Studio 2015?

I want to try my hand at a Cordova based mobile app. In Visual Studio's project templates, under Other Languages->JavaScript, there was an option to install the Cordova templates. I ran that, and after a lengthy install, the JavaScript template folder is gone, and there is a new TypeScript project template node, with one Blank App (Apache Cordova) template.
When I chose that template, I get an error message that says:
The template specified cannot be found. Please check that the full
path is correct
This is giving me the probably wrong impression that in VS2015, support for mobile development has only been given lip service, and there is probably a vast amount of DIY work required to get anything done.
What could be wrong that VS is telling me a template that it just installed is missing? I have a default setup of VS2015 with all default folder settings etc.
I had the same issue after installing update 2 of Cordova. I didn't want to do a 7gb update so I unchecked the Windows 10 related cross platform components as I was only interested in the Cordova update.
To fix the issue I installed all the options back into Visual Studio 2015.
I then received a new error when opening a Cordova Project. I looked in the ActivityLog of Visual Studio "SetSite failed for package [ApacheCordovaToolsPackage]"
To fix this issue I delete the ComponentModelCache of VisualStudio
"C:\Users[your user account]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache"

Eclipse config for Java Script

I am new to Eclipse - inherited unfinished project after employee who left. I downloaded war file and by trial and error installed missing components till it actually built app. I can edit java files, but when I try to open java script files, I get error:
Could not open visual page editor
no more handles
could not load SWT library
no swt-xulrunner-gtk-4234 in java.library.path
Linux Fedora 17, Eclipse Juno, SWT is reported as installed by yum. ~/.swt/lib/ is empty
It looks like you do not have the proper library to load browser widgets in your Eclipse, that is what swt-xulrunner refers to. This FAQ should help you.
What it is saying is that you need to start Eclipse with the following system property:
-Dorg.eclipse.swt.browser.XULRunnerPath=<path_to_xulrunner>
There should be a xulrunner already included in your Eclipse, but if not, you will need to download a new one from here.
Also, it could be that you are using the Ubuntu pre-packaged Eclipse. I would avoid doing that. This pre-packaged eclipse often has some missing things in it. I'd instead recommend downloading directly from Eclipse.org

Categories