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

Bug 319880

Summary: [validation] Unexpected "Unexpected Tag" warnings in JSDoc
Product: [WebTools] JSDT Reporter: Michael Rennie <Michael_Rennie>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: cmjaun, curtis.windatt.public
Version: 3.2Keywords: plan
Target Milestone: Future   
Hardware: PC   
OS: Linux   
Whiteboard:

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.