Community
Participate
Working Groups
Due to JDT ancestry, dollars in signatures are replaced with dots in JSDT. Let's get rid of that, specially that JavaScript developers like dollars a lot! (aka jQuery & Prototype)
Created attachment 172202 [details] screenshot
Created attachment 172203 [details] patch remove the $->'.' conversion
Let's try and get this in 3.2.1. Jacek...do you know if there are any cases where it may be valid to change $ to .? Under what circumstances to signatures get generated with $? Do you think that is that just something left over from JDT?
I think it's left over from JDT. In JavaScript, thanks to their hashmap-ish nature, you can use pretty much anything as a field name. E.g. org.jQuery = function () {}; // valid org['jQuery'](); // valid, invokes function defined above org['jQ$&*/\@ery'] = function () {}; // valid org.jQ$&*/\@ery(); // invalid, parser will complain org['jQ$&*/\@ery'](); // valid, parser won't complain :-) At least Prototype and jQuery make use of such strange names, i.e. $W, $A, $$, $H, jQuery selectors: >, ., *=, etc. However, there may be more left overs in JSDT, that also specially treat $. So far I didn't noticed any, and I'm running with patch applied.
Patch checked in.
Thanks, Jacek.
This patch is getting backed out of 3.2.1. Will re-target this bug to 3.2.2. I discovered that it break's content assist for namespaced types.
any example where it breaks?
Let me work up an example for you Jacek. If you can fix the patch by next Wednesday we may still be able to get it in 3.2.1, but it will have to be very well tested.
Created attachment 174074 [details] Updated Patch
Updated the patch to make sure signatures don't get generated with $ in them. Looks like a mistake made in BUG305694 allowed that to happen for namespaced types. Nitin, marked you for review. Not sure about putting this in 3.2.1 or not. Need to test it a lot.
Jacek, I marked you for review as well.
Here is some example code: var obj = {}; obj.form = {}; obj.form.CheckBox = function() {}; obj.form.CheckBox.prototype = new Object(); Put that in one file and attempt content assist in another file. Type to filter down the proposals.
hi, patch looks good to me, altough searching jsdt.core for "'$'" gives another 90 results, out of which at least few are "replace('.', '$')" or "replace('$', '.')". Not sure if they're ever reached though
Yeah, in my testing I did not see any other problems and the junits pass. I think this specific case was causing a problem due to the error I made in BUG305694.
After deciding we aren't sure exactly all the possible uses of $ in type signatures Nitin and I decided to move this one out to 3.2.2.
Possibly something we can fix once bug 306958 is addressed?
Fixed this as part of https://bugs.eclipse.org/bugs/show_bug.cgi?id=343691.