February 9, 2008

Add jQuery autocompletion to your Eclipse

It's easy with jQueryWTP. It is not an Eclipse plugin, it is a nice tool, which modifies some WTP plugin autocompletion definitions to make it support jQuery.

Installation is easy:

  • run the tool
  • find the plugin jar and patch it
The complete instructions with a video guide are available on the jqueryWTP homepage.

It works nicely, there is one gotcha however, which is not mentioned in the official instructions. You must choose the correct jar, the one, which is being used by WTP. It is possible to have multiple version of the same plugin jar - it is even anticipated if you update your plugins. So choose the correct version - it should be the most recent, with the highest version number. If you are unsure, try all of them, but don't forget to do a backup of the original plugin jar.

It can spare you few key strokes and eventually few trips to visualjquery.


12 comments:

Michał Mech said...

jQueryWTP doesn't support an fluent interfaces. It will autocomplete when you type
$(this).
but not when you will type
$(this).html("Blah, blah, blah").

12789 said...

Can u run it on WTP3.0.2

Bill said...

An internal error occurred during: "org.eclipse.wst.javascript.ui".
Either the manifest file or the signature file has been tampered in this jar: C:\ProgramFiles\eclipse-jee-ganymede-win32\eclipse\plugins\org.eclipse.wst.javascript.ui_1.0.200.v200805160650.jar

Craig said...

I've just attempted to install the plug in. All went well but Eclipse still reports an error for every instance of '$'. I'm running:-
Version: 3.4.1
Build id: M20080911-1700
PDT 2.0
wst file: eclipse.wst.javascript.ui_1.0.200.v200805160650.jar

At my wits end as I'm new to PHP and Linux. Thought I was going to get productive today!

Any advice appreciated.

Tomáš Kramár said...

Are you sure that you have patched the correct version of the wtp jar?

In any case, I am sure, you will get more educated help from the author of the jqueryWTP tool.

Craig said...

The only one that matches the pattern given in the instructions is the one quoted in my previous message.So I guess it's the right one. I've tried doing it twice, carefully but still no joy. A comment from the auther would be great though:)

Craig

Anonymous said...

No luck with Eclipse 3.4

biobob said...

Zdravím Ťa. Knižnicu jQuery považujem za veľmi výkonný nástroj. Skúšal som aj napísať niekoľko jednoduchších rozšírení.
Keď som objavil toto rozšírenie do Eclipsu, tak som ho okamžite chcel. Ale už sa s tým trápim niekoľko dní. Vyskúšal som niekoľko rôznych distribúcii Eclipsu v kombinácii s rôznymi verziami WTP. Už som dokonnca ručne prepisoval ten JAR súbor. Začínam aj rozumieť Context Assistant formátu, ale stále mám ten istý problém (ako mnoho ďalších ľudí, ako tak čítam na iných fórach). Pridané položky sa mi proste nezobrazujú.
Správnosť vybraného súboru som kontroloval viackrát. Možno je to vo verziách Eclipsu alebo WTP. Nevedel by si si, prosím Ťa, spomenúť, na akých verziách si to skúšal?
Všimol som si, že môj Eclipse s WTP obsahuje dva editory HTML - predpokladám, že ten od Amateras to nie je (aj keď som skúšal vždy aj ten). Neviem, či do projektu pridávaš aj "JavaScript Support" knižnice. Ale toto sa už chytám slamky...

Tomáš Kramár said...

Čau, na toto si naozaj nepamätám. Písal a používal som to už viac ako pred rokom. Bolo to isto v tom editore, ktorý poskytuje WTP a nie Amateras.

Je možné že je to verziami, naozaj neviem, odporúčam obrátiť sa na autora pluginu. Starý notebook na ktorom som to mal nainštalované už nefunfuje a kedže momentálne nerobím nič v Jave, tak na novom ešte Eclipse ani nemám nainštalovaný.

Wildan Maulana said...

Same here with eclipse 3.4, is there any other alternative ?

Kevin Hamer said...

Also available is Aptana's web plugins, one of which can provide jquery support.