Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the benefit of Javascript Resources in Eclipse?

When I make Dynamic Web Project in Eclipse it generates Javascript Resources meta-folder; before I tried to use it at first time I thought that it works just like Java Resources - if you add your source here IDE provides you with Intellisense, documentation and error checking.

But when I tried to add jquery.js there, I found nothing that I was expecting to see. Yes, eclipse shows me that it's aware of jQuery object now but it knows nothing about jQuery's methods (like jQuery.ajax(...)) and it also doesn't recognize $ shortcut.

How can I make eclipse recognize methods of js libraries that I include?

like image 630
tsds Avatar asked Oct 11 '22 00:10

tsds


1 Answers

The two things aren't related in the way you think. The JavaScript Resources node indicates all of the known globals and named "types", as well as their properties, organized according to the way you've set up the project's JavaScript Include Path. It represents everything that is known to the JavaScript (standalone and client-side) in your project--this is what Content Assist will be able to offer you, shown in what we hope is a nicely laid out and browseable structure.

What you've run into is that jQuery is more dynamic, and perhaps a little trickier syntactically, than JSDT understands. Googling for both jQuery and JSDT should help you find a plug-in that helps in that regard.

like image 75
nitind Avatar answered Oct 14 '22 01:10

nitind