Community
Participate
Working Groups
Build Identifier: Helios There are screenshots here: http://kellicker.wordpress.com/2010/09/03/using-jsdt-4-adding-third-party-library. I have successfully added mooTools as a user library and seen content assist. However, JSDT seems to be confused when I add jQuery. Reproducible: Always Steps to Reproduce: 1. add uncompressed jQuery 1.4.2 as javascript user library. Add it to project 2. Create test.js. 3. Type jQ<ctrl-space>. Should see content assist for jQuery variable. Do not. 4. If I open the jQuery library in Explorer, the AST/DOM is clearly confused as the first 8 or so entries are "_load". See referenced screenshots.
Created attachment 178148 [details] jQuery .js file to add as a library
Scott, do you know what exactly breaks JSDT's parser in jQuery 1.4? In 1.3 I remember it was the use of "undefined" as a variable (bug 298577). After removing 1 line, all jQuery file was parsed correctly. I'm wondering what this time :-)
(In reply to comment #2) > Scott, > do you know what exactly breaks JSDT's parser in jQuery 1.4? In 1.3 I remember > it was the use of "undefined" as a variable (bug 298577). After removing 1 > line, all jQuery file was parsed correctly. > > I'm wondering what this time :-) No idea. I haven't taken the time to dig into it. I did take a glance at the log and didn't see anything obvious. The fact that _load is being considered a variable, makes me think that its tripping on constructs like this: var jsc = now(), rscript = /<script(.|\s)*?\/script>/gi, rselectTextarea = /select|textarea/i, rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i, jsre = /=\?(&|$)/, rquery = /\?/, rts = /(\?|&)_=.*?(&|$)/, rurl = /^(\w+:)?\/\/([^\/?#]+)/, r20 = /%20/g, // Keep a copy of the old load method _load = jQuery.fn.load;
Created attachment 178538 [details] proposed patch to treat undefined as a regular identifier and not a keyword (does not update syntax coloring)
I tried the proposed patch with latest source. There was no change in the behavior. I think the problem must be elsewhere.
Strange. Without the patch the Outline view simply shows a flat list of functions and variables. With it, a jQuery type is created, although it's missing every function that's added by jQuery.extend().
*** Bug 277165 has been marked as a duplicate of this bug. ***
*** Bug 325519 has been marked as a duplicate of this bug. ***
*** Bug 298577 has been marked as a duplicate of this bug. ***
*** Bug 326894 has been marked as a duplicate of this bug. ***
Created attachment 182052 [details] Updated patch
*** Bug 289806 has been marked as a duplicate of this bug. ***
*** Bug 289805 has been marked as a duplicate of this bug. ***
Could you provide a binary patch for WTP 3.2.2 in order to make testing easier ? Since this is a blocking issue for a lot of users, it could help a lot of people.
(In reply to comment #11) > Created an attachment (id=182052) [details] > Updated patch Unrelated change in org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit?
(In reply to comment #15) > (In reply to comment #11) > > Created an attachment (id=182052) [details] [details] > > Updated patch > > Unrelated change in > org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit? No, that is needed so that the junits pass.
Checked into 3.2.3 and HEAD.