Bug 348319 - [content assist] function overloading not supported
Summary: [content assist] function overloading not supported
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-05 07:37 EDT by Philippe Marschall CLA
Modified: 2013-06-19 11:10 EDT (History)
0 users

See Also:


Attachments
function overlading using JSDoc (543 bytes, text/plain)
2011-06-05 07:38 EDT, Philippe Marschall CLA
no flags Details
function overloading repeating the function (559 bytes, text/plain)
2011-06-05 07:39 EDT, Philippe Marschall CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Marschall CLA 2011-06-05 07:37:39 EDT
While JavaScript does not support overloading a function like Java it is possible to call a function with different numbers of arguments or types. The function can then perform introspection and decide what to do. Several JavaScript libraries use this to implement setters and getters. If a function is called without and argument it acts as a getter. If it's called with an argument it acts as a setter.

JSDoc has a native way to support this http://code.google.com/p/jsdoc-toolkit/issues/detail?id=157 an other option imaginable would be to simply repeat the function several times.

Steps to Reproduce:
1. create a JavaScript library with one of the attached files
2. type jQuery("a") and hit Ctrl+Space

Expected Behavior
You get two "text" functions in the completion proposal, one with an argument, one without.

Actual Behavior
You only get one "text" function in the completion proposal.
Comment 1 Philippe Marschall CLA 2011-06-05 07:38:37 EDT
Created attachment 197356 [details]
function overlading using JSDoc
Comment 2 Philippe Marschall CLA 2011-06-05 07:39:18 EDT
Created attachment 197357 [details]
function overloading repeating the function