Getting jQuery and AngularJS content assist / auto-complete in eclipse for standalone HTML "file"

Mahesha999 picture Mahesha999 · Aug 13, 2013 · Viewed 17.5k times · Source

I have followed the steps described here for adding the autocomplete functionality to the eclipse.

In this after installing JSDT plugin, I have to create a project, then add the plugin as a JS resource. I have found two weird things:

  • I can get autocomplete even I have included no jQuery library in my html enter image description here
  • I cannot get the autocomplete for HTML file that I created explicitly say in notepad and opened in eclipse. For example in screenshot above in tempq.html I can get the autocomplete but in angularjsexp.html which is open in the another tab and which is not the part of any project I cannot get the autocomplete for jQuery when I enter $().

Also how can I get similar autocomplete for angularjs in eclipse. I read somewhere using JSDT only I can get the autocomplete functionality for angularjs too. Is it possible?

Answer

Angelo picture Angelo · Jan 9, 2014

AngularJS Eclipse gives you completion for AngularJS (directive name (ng-app, ...), modules, controllers, expression on $scope model). It is based on tern.java which provides a jQuery plugin to benefit with jQuery (After configuring AngularJS nature in your project, you can select jQuery Tern Module on project properties Tern -> Modules).