Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319879 - Completion proposal causes validation warning
Summary: Completion proposal causes validation warning
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 12:22 EDT by Michael Rennie CLA
Modified: 2010-09-28 11:42 EDT (History)
1 user (show)

See Also:
thatnitind: review+
Michael_Rennie: review+


Attachments
patch (3.99 KB, patch)
2010-09-08 15:57 EDT, Chris Jaun CLA
no flags Details | Diff

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: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.