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

Bug 319879

Summary: Completion proposal causes validation warning
Product: [WebTools] JSDT Reporter: Michael Rennie <Michael_Rennie>
Component: GeneralAssignee: Chris Jaun <cmjaun>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: cmjaun
Version: 3.2Flags: thatnitind: review+
Michael_Rennie: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch none

Description Michael Rennie CLA 2010-07-14 12:22:51 EDT
build:

steps:

1. create a test script like the following

/**
 *
 */
function Test() {
	
}

2. in the doc section start typing @ret and hit Ctrl+space - you should get the completion @returns entered.

3. add some postamble to the tag like 'a new test' to look like the following

/**
 * @returns a new test
 */
function Test() {
	
}

4. save the file - notice a new validator warning that you are missing a return type description and that the word 'new' is underlined??

Expected 

That everything would be fine. If I change @returns to @return all warnings go away. I would expect that since JSDT proposed @returns that it would be ok to use without warning (the JSDoc spec states they are synonyms for each other).

Maybe if the validator can't handle @returns it should not be proposed as a completion?
Comment 1 Michael Rennie CLA 2010-07-14 12:26:31 EDT
woops, noticed I forgot to specify the build: 1.2.0.v201006041342-7C78FGDF9JgLWLMLM4Vsye
Comment 2 Chris Jaun CLA 2010-07-15 16:56:06 EDT
That error message is correct. You do not have a return statement in your function.

I think the only bug here is that "return" does not show that error as well.
Comment 3 Chris Jaun CLA 2010-09-08 15:57:52 EDT
Created attachment 178437 [details]
patch
Comment 4 Michael Rennie CLA 2010-09-09 14:49:12 EDT
fix works good for me. the erroneous warnings no longer appear
Comment 5 Chris Jaun CLA 2010-09-28 11:42:28 EDT
Checked into 3.2.3 and HEAD.