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 pletion 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?
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 pletion 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?
Share Improve this question asked Feb 11, 2011 at 14:32 roeleroele 1333 silver badges8 bronze badges 3- 1 JavaScript "smart" code pletion is a fairly hard problem because the language is so dynamic. It's pretty hard for the editor environment to know what type of object a symbol might refer to because there are no type declarations. – Pointy Commented Feb 11, 2011 at 14:35
- 2 why is IntelliJ able to do it then? ;) – roele Commented Feb 11, 2011 at 14:40
- Is my understading that IntellJ can even do it, in a mixed scenario ( eg. jsp / javascript ) They have a different ( better ) architecture. – OscarRyz Commented Feb 11, 2011 at 16:35
2 Answers
Reset to default 8You 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...
- Project Properties -> Project Facets
- Click on "Convert to faceted form" link
- Check JavaScript and hit ok to close the dialog.
- 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 acmodates 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.
Does it work for you if you open up your .project file and add a new <nature>
into the <natures>
element? I've done that to apply the java nature to non-java projects which had other natures.