Community
Participate
Working Groups
Build Identifier: Helios and current Sep 2, 2010 JSDT source code Not sure if the jsDocs in this $foobar function are correct, but shouldn't throw an exception. !STACK 0 java.lang.IllegalArgumentException at org.eclipse.wst.jsdt.core.Signature.toCharArray(Signature.java:1168) at org.eclipse.wst.jsdt.core.Signature.toCharArray(Signature.java:1135) at org.eclipse.wst.jsdt.core.Signature.toCharArray(Signature.java:1240) at org.eclipse.wst.jsdt.core.Signature.toString(Signature.java:1599) at org.eclipse.wst.jsdt.ui.JavaScriptElementLabels.getTypeSignatureLabel(JavaScriptElementLabels.java:752) at org.eclipse.wst.jsdt.ui.JavaScriptElementLabels.getMethodLabel(JavaScriptElementLabels.java:486) at org.eclipse.wst.jsdt.ui.JavaScriptElementLabels.getElementLabel(JavaScriptElementLabels.java:428) at org.eclipse.wst.jsdt.ui.JavaScriptElementLabels.getElementLabel(JavaScriptElementLabels.java:405) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover.getInfoText(JavadocHover.java:218) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:166) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo(AbstractJavaEditorTextHover.java:116) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo(BestMatchHover.java:99) at org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo(JavaEditorTextHoverProxy.java:67) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168) Reproducible: Always Steps to Reproduce: 1. Add tstlib_bug1.js as a user library to a Static Web Project 2. Create test.js 3. Using content assist verify can do $foo<ctrl-space> to add foobar 4. Now hover over foo bar and get exception.
Created attachment 178219 [details] user library
Comment on attachment 178219 [details] user library The @param says 'a' instead of 'obj'. Same crash even if changed to 'obj'.
The problem seems to be in JavaScriptElements.getMethodLabel() when the resolvedKey seems to get incorrectly translated to resolvedSig: public static void getMethodLabel(IFunction method, long flags, StringBuffer buf) { try { BindingKey resolvedKey= getFlag(flags, USE_RESOLVED) && method.isResolved() ? new BindingKey(method.getKey()) : null; String resolvedSig= (resolvedKey != null) ? resolvedKey.toSignature() : null; . . . } resolvedKey is "X/moo/WebContent/mootools-1.2.4-core-nc.js;.$random(AA)A" resolvedSig is ";". BTW, I've observed this with mootools 1.2.4 core.js as well. Add mootools1.2.4-core.js to WebContext. Create test.js Add $random(1,5). Hover over random. Same result.
Created attachment 178982 [details] patch Removed some closure/wildcare stuff from the BindingKeyParser.
I tested with top of tree + patch. Works great-- No NPE and even a hover. Nice.
Checked into HEAD and maintenance.