This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215764 - Variable type returned by function not recognized
Summary: Variable type returned by function not recognized
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 162305 222514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-20 09:20 UTC by Vladimir Riha
Modified: 2012-11-25 03:09 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-07-20 09:20:49 UTC
Maybe should be ENHANCEMENT, not sure if this is planned/supposed to work


/**
 * @return {Date} Some date
 */
function foo() {
    var a = new Date();
    return a;
}

var e = foo();
e.


Completion for "e." should offer items for Date object. I've tried it with/without the JSDoc, no difference

Product Version: NetBeans IDE Dev (Build 201207191713)
Java: 1.7.0_06-ea; Java HotSpot(TM) Client VM 23.2-b08
System: Linux version 3.0.0-21-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Eccenux 2012-08-29 12:33:51 UTC
It should be "@returns" (note the "s" at the end). But it does work for me in 7.2 with and without "s".
Comment 2 Martin Fousek 2012-09-24 08:18:58 UTC
*** Bug 162305 has been marked as a duplicate of this bug. ***
Comment 3 Vladimir Riha 2012-11-21 09:06:11 UTC
Is there any update? This would really help with proper code completion.
Comment 4 Tomas Mysik 2012-11-21 09:09:57 UTC
*** Bug 222514 has been marked as a duplicate of this bug. ***
Comment 5 Tomas Mysik 2012-11-21 09:11:27 UTC
Sorry, I do not think that this is P3, moreover if this works in NB 7.2 (see comment #1, cannot verify myself) then it is likely a "regression".

Thanks.
Comment 6 Petr Pisl 2012-11-22 15:21:20 UTC
This case fixed in web-main. Now it works due to JS doc.

http://hg.netbeans.org/web-main/rev/b429934924ce
Comment 7 Petr Pisl 2012-11-22 15:24:46 UTC
I have created new issue #222601 to improve the code completion without a documentation.
Comment 8 Vladimir Riha 2012-11-23 15:41:07 UTC
Thanks a lot, type is resolved correctly. Code completion offers methods/properties correctly and Navigator shows correct variable type.


Product Version: NetBeans IDE Dev (Build web-main-9317-on-20121123)
Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b16
System: Linux version 3.2.0-33-generic-pae running on i386; UTF-8; en_US (nb)
Comment 9 Quality Engineering 2012-11-25 03:09:19 UTC
Integrated into 'main-golden', will be available in build *201211250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b429934924ce
User: Petr Pisl <ppisl@netbeans.org>
Log: #215764 - Variable type returned by function not recognized