14

after updating my Eclipse IDE to the actual 2020-06 version the syntax highlighting for JavaScript does not work any more.

Is this a known/common problem and how can I fix this?

greg-449
  • 109,219
  • 232
  • 102
  • 145
omanthey
  • 321
  • 2
  • 8
  • 1
    Equivalent report on Eclipse Bugzilla is [here](https://bugs.eclipse.org/bugs/show_bug.cgi?id=564496) – greg-449 Jun 22 '20 at 10:11
  • 1
    I have the same problem after update. I ended up installing Wild Web Developer package, which provides its own JavaScript editor (although colors are different from standard Eclipse editors, maybe they can be configured, i didn't look too hard). – Andrey Jun 22 '20 at 18:04
  • 2
    Actually I found how to change color scheme. It's in Preferences -> TextMate -> Grammar, then set theme for source.js to "Eclipse Light". – Andrey Jun 22 '20 at 18:16
  • 2
    Actually you can just right-click the line numbers in the editor and will get a contextmenu containing "Switch to Theme" option :-) – omanthey Jun 23 '20 at 05:33

3 Answers3

29

After spending most of a day futzing with it, including installing a new instance of Eclipse PDT, I found that I could fix it simply by adding *.js to the File Associations preference page and setting its default to "Generic Text Editor".

nitind
  • 19,089
  • 4
  • 34
  • 43
Paul DeWolf
  • 311
  • 3
  • 5
10

Per the Eclipse Bugzilla Report:

Standalone JS Editor is not provided anymore.

To work with JavaScript/TypeScript projects users may install JS [1] or JEE [2] EPP packages, WildWebDeveloper [3] or other products.

[1] https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-web-and-javascript-developers

[2] https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-enterprise-java-developers

[3] https://marketplace.eclipse.org/content/eclipse-wild-web-developer-html-css-javascript-typescript-nodejs-angular-json-yaml

Basically this means that the Eclipse JavaScript Development Tools (JSDT) is no longer supported.

It could just be me, but [1] seems to be a pretty stripped-down version of Eclipse. It doesn't even include Package Explorer, which baffles me. [2] is a bit better in my opinion, at least having Package Explorer. (I do love Package Explorer ) However, I'm not really interested in installing a new version of Eclipse when the way [1] and [2] implement JavaScript support is through [3] Wild Web Developer ("WWD") anyway. (You don't have to follow that link for [3]; you can find it in the Eclipse Marketplace just fine. Also, you'll have to reopen any JavaScript files you have open for the update to work.)

I added WWD through the Eclipse Marketplace on my Windows x64 version of Eclipse IDE for Java Developers, 2020-06. I guess it works, but it sure doesn't integrate like JSDT did.

I'm not thrilled with WWD since the first thing I tried to do is comment a line in JavaScript using Ctrl+/ and it summons a dropdown of keyword and available function choices. Ctrl+. does the same thing, and feels more appropriate, so what's the deal? Want to change the keyboard shortcuts? Too bad. There's nothing under the Keys preference that has anything to do with TextMate/WWD actions.

Want to change the syntax coloring? Better love what you're given. There is no Syntax Coloring section or anything like it. There's a TextMate set of preferences, but it seems like anything regarding Theme doesn't actually work. Is it because I use DevStyle and the Darkest Dark theme? Who knows.

There's only one WWD preference (XML), which does nothing but tell you "See 'XML Catalogs' for XML catalogs preferences". Thanks? It's also version 0.10.0.etc, which feels like we're being forced to test it. Overall I'm pretty disappointed, especially since Eclipse just automatically upgraded itself from 2020-03 to 2020-06 and now I'm stuck with this. Boo to you on this move, Eclipse

nikodaemus
  • 1,918
  • 3
  • 21
  • 32
  • Their "solution" ugh. I had wtp or whatever its called installed (Jeezus, with the abbreviations...) but .js files didnot have much to offer with syntax highlighting, no code completion or anything. I HAVE node installed, and then I installed this Wild Web #&%¤#&. And now when I open a .js file I have no code completion AND no syntax highlighting at ALL o_O. So. their solution that you also mention here is totally worthless. I install Wild Web #&%=, it stops working, solution = install Wild Web #%&%#. ugh. – brat Aug 11 '20 at 16:55
  • Comment is Ctrl+Shift+C. Ctrl+/ is coming from another plugin... Ctrl+Space is the usual shortcut for content assist. You can still uninstall Wild Web Developer and install older versions of JSDT if you prefer, but don't be surprised with lack of support for new JS constructs and newer frameworks If you find bugs with WIld Web Developer, just report them on the GitHub repo. – Mickael Sep 27 '20 at 12:35
  • I'm also curious about what would make one prefer the Package Explorer over the more generic and powerful Project Explorer. – Mickael Sep 28 '20 at 10:28
5

This is how I fixed it:

  1. Install "Eclipse web developer tools 3.20" from Eclipse marketplace
  2. Restart
  3. Open a JS file. Right-click on line number > Switch to theme > Eclipse light.

Done.

kkid
  • 71
  • 1
  • 2