Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359228

Summary: [content assist] Type information lost when extending class over several files
Product: [WebTools] JSDT Reporter: Ingo Rau <ingo.rau>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: vrubezhny
Version: unspecified   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
bug-1.js: Definition of class
none
bug-2.js: Extension of class
none
bug-3.js: Usage of class
none
bug-3.js: Usage of class none

Description Ingo Rau CLA 2011-09-28 09:08:11 EDT
Build Identifier: 20110916-0149, JSDT: 1.3.1.v20110810

Imagine we have a class A in file1.js, which is extended in file2.js:
A.prototype.func = function() { return new A(); }

When instantiating the class, the resulting variable correctly knows all methods defined in file1.js and file2.js, as does the return value of A.func().

However, now we add a third file3.js, where A is instantiated. The resulting variable again knows alls methods defined before, but the variable returned by A.func() only knows the methods defined in file2.js.

Reproducible: Always

Steps to Reproduce:
1.Import attached files (bug-1 to -3) into Eclipse
2.Hover mouse over bugXXXd.op1() in bug-3.js
3.Additionally, enter "bugXXXd." and press Ctrl-Space
Comment 1 Ingo Rau CLA 2011-09-28 09:09:35 EDT
Created attachment 204183 [details]
bug-1.js: Definition of class
Comment 2 Ingo Rau CLA 2011-09-28 09:10:08 EDT
Created attachment 204185 [details]
bug-2.js: Extension of class
Comment 3 Ingo Rau CLA 2011-09-28 09:10:28 EDT
Created attachment 204186 [details]
bug-3.js: Usage of class
Comment 4 Ingo Rau CLA 2011-09-28 09:11:11 EDT
Created attachment 204187 [details]
bug-3.js: Usage of class
Comment 5 Victor Rubezhny CLA 2013-12-13 19:38:15 EST
Probably the content assist functionality was fixed somehow in some other issue. At least I cannot reproduce the Content Assist or Hover problems (at least for the methods defined in class Bug359228).

But I see Content Outline problems here:

in bug-3.js: Variable bug359228d's type is displayed as "any" (but it should be of type "Bug359228" - if it's not, why content assist shows the methods of that class?);

in bug-2.js: Variable bug359228b's type is displayed as "any" (but it should be of type "Bug359228" - again, if it's not, why content assist shows the methods of that class?);

As well as Hover problems for variables:

For any file, if you'll hover the mouse cursor over any variable you'll see that every variable's type is displayed as "any" instead of correct type "Bug359228" (for example: "any bug359228c - bug-3.js"), even if Content Outline shows it's correct type "Bug359228".