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

Bug 362403

Summary: [content assist] assigning a property to a function makes it no longer being considered a function
Product: [WebTools] JSDT Reporter: Philippe Marschall <philippe.marschall>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
test case none

Description Philippe Marschall CLA 2011-10-29 11:10:17 EDT
Build Identifier: M20110909-1335

As soon as you add the property to a function the type inferencer does no longer seem to consider it a function but an object.

See the attached JS file.
- First we define a type ("jQueryObject")
- Then we add a property to the type ("add")
- then we define a function that returns this type ("jQuery")

At this point we get content assist on the return value. For example
jQuery("a").
proposes "add"

However once we add a property ("boxModel") to the function we no longer get content assist on
jQuery("a").

Reproducible: Always

Steps to Reproduce:
1. Define a function that returns a type
2. You should get autocompletion on the return value of the function
3. Add a property to the function
4. You no longer get autocompletion on the return value of the function
Comment 1 Philippe Marschall CLA 2011-10-29 11:11:50 EDT
Created attachment 206166 [details]
test case