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 231277 - Netbeans ignores @returns JSDoc tag and inserts it's own guesses
Summary: Netbeans ignores @returns JSDoc tag and inserts it's own guesses
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal with 2 votes (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-14 13:32 UTC by Eccenux
Modified: 2016-07-19 14:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example code (747 bytes, application/x-javascript)
2013-06-14 13:32 UTC, Eccenux
Details
Different use case (91.99 KB, image/png)
2013-06-25 01:17 UTC, Eccenux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eccenux 2013-06-14 13:32:28 UTC
Created attachment 135804 [details]
Example code

I'm defining a function/class and specify @returns with a type for another function with that type but Netbeans insist in ignoring it and shows the type prefixed with _L5 (or _L13 in my other file)... This doesn't seem correct.

Expected:
If @returns (or @return) is specified Netbeans MUST use it.
Comment 1 Vladimir Riha 2013-06-17 06:44:28 UTC
This seems to be fixed, you can try it in Dev build from [1]


[1] http://bits.netbeans.org/netbeans/trunk/nightly/latest/
Comment 2 Petr Pisl 2013-06-24 23:18:06 UTC
I'm closing this issue as fixed. This case works fine in dev build now. Please reopen if doesn't work for you as expected. Thanks.
Comment 3 Eccenux 2013-06-25 01:17:54 UTC
Created attachment 136243 [details]
Different use case

Hi. The previous one was fixed, but another one popped out which was better in previous version. Attaching screen shot of a minimized use case.
Comment 4 gualtiero65 2013-10-25 13:41:54 UTC
Similar situation in NB 7.4 with following code:


/**
 * @param {String} str the string to check, may be null or undefined
 * @returns {Boolean}
 */
function isBlank1 (str) {
	var patt = /^[\s\xa0]*$/;
	return str === undefined || str === null || patt.test(str);
}

/**
 * @param {String} str the string to check, may be null or undefined
 * @returns {Boolean}
 */
function isBlank2 (str) {
	return str === undefined || str === null || /^[\s\xa0]*$/.test(str);
}

The two functions are identical expect for the inlined var.

In the Navigator window I have:

isBlank1(String str) : Boolean
isBlank2(String str) : Boolean|RegExp

The second line not only does not respect my annotation but also it is wrong (function never returns a RegExp)


In the second case (isBlank2) NB ignores the returns annotation and shows in the Navigator window:

isBlank2
Comment 5 Petr Hejl 2016-07-19 14:32:25 UTC
Seems to be fixed in dev build.