Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java and JavaScript nature simultaneously

I have a larger maven multi-module project where multiple languages are involved. Now with Eclipse JDT and JSDT installed the code coloring works fine but code completion in JavaScript does not work very well which makes it hard to be productive. Eclipse does not seem to find JavaScript classes in my project so i am also not able to jump around JavaScript methods very easily. Mapping JavaScript classes seems also not possible since this is a Java project and i see no way to mix up project natures.

Is there a way to improve this behavior? Or are there any other JavaScript Plugins which are able to do so and work simultaneously with JDT?

like image 848
roele Avatar asked Feb 11 '11 14:02

roele


1 Answers

You can definitely mix Java and JavaScript development in Eclipse. The Dynamic Web Project creates such a configuration by default.

To add JavaScript support to any Java project, do the following...

  1. Project Properties -> Project Facets
  2. Click on "Convert to faceted form" link
  3. Check JavaScript and hit ok to close the dialog.
  4. Make sure that you are in a perspective that has "Project Explorer" view as opposed to "Package Explorer", which is standard in Java perspective or open that view yourself. Unlike the Java-specific Package Explorer, the Project Explorer view accommodates different technology extensions, such as JavaScript.

Enjoy. Facets are somewhat like natures, but unlike natures the can be user-manipulated without hacking metadata files. New Eclipse tooling, like JSDT has been moving to providing facets to make enablement easier.

like image 70
Konstantin Komissarchik Avatar answered Oct 16 '22 01:10

Konstantin Komissarchik