Bug 319880 - [validation] Unexpected "Unexpected Tag" warnings in JSDoc
Summary: [validation] Unexpected "Unexpected Tag" warnings in JSDoc
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2010-07-14 12:32 EDT by Michael Rennie CLA
Modified: 2014-05-29 13:51 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2010-07-14 12:32:55 EDT
build: 1.2.0.v201006041342-7C78FGDF9JgLWLMLM4Vsye

Steps:

1. create test script file like

/**
 * @returns a <code>new</code> Test
 */
function Test() {
	
}

2. save it - notice the warning created on the first < of <code> about an unexpected tag

Expected

That this should work without warning.

I tested this with a few other tags like <b>, <h4>, etc. It is not stated anywhere that using tags like this is not allowed in JSDoc...
Comment 1 Michael Rennie CLA 2010-07-14 12:36:46 EDT
even more cryptic, if you modify the snippet to:

/**
 * @returns <code>a</code> new Test
 */
function Test() {
	
}

you get an additional fun warning:

    JSdoc: Malformed link reference line 3

along with the other warning:

    JSdoc: Unexpected tag line 3
Comment 2 Michael Rennie CLA 2010-07-14 12:47:17 EDT
making sure the tags appear anywhere after the second word makes the warnings go away????

/**
 * @return a new <code>Test</code>
 */
function Test() {
	
}

makes all warnings go away (notice the update to not use @returns as well)
Comment 3 Nitin Dahyabhai CLA 2010-07-14 13:42:26 EDT
Which JSDoc do you mean?  I know of at least two slightly incompatible implementations out there.  The first blob after the @returns is expected to be the type name itself, optionally inside of curly braces.
Comment 4 Chris Jaun CLA 2010-07-14 13:43:39 EDT
You get the unexpected tag warning in your first example because there is no return statement in the function. That is working as designed.
Comment 5 Michael Rennie CLA 2010-07-14 13:50:42 EDT
(In reply to comment #3)
> Which JSDoc do you mean?  I know of at least two slightly incompatible
> implementations out there. 

I was not aware there was more than one, I looked at http://jsdoc.sourceforge.net/

> The first blob after the @returns is expected to be
> the type name itself, optionally inside of curly braces.

That makes sense, maybe the warning text could better explain this?
Comment 6 Chris Jaun CLA 2010-07-14 13:54:01 EDT
There are plans to clean up the errors/warnings messages in 3.3.

We can address this then.