Bug 359228 - [content assist] Type information lost when extending class over several files
Summary: [content assist] Type information lost when extending class over several files
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 09:08 EDT by Ingo Rau CLA
Modified: 2014-05-29 13:53 EDT (History)
1 user (show)

See Also:


Attachments
bug-1.js: Definition of class (290 bytes, application/x-javascript)
2011-09-28 09:09 EDT, Ingo Rau CLA
no flags Details
bug-2.js: Extension of class (292 bytes, application/x-javascript)
2011-09-28 09:10 EDT, Ingo Rau CLA
no flags Details
bug-3.js: Usage of class (265 bytes, application/x-javascript)
2011-09-28 09:10 EDT, Ingo Rau CLA
no flags Details
bug-3.js: Usage of class (265 bytes, application/x-javascript)
2011-09-28 09:11 EDT, Ingo Rau CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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".