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

Bug 424131

Summary: JSDT Parser doesn't respect "Enable Semantic Validation" preference value
Product: [WebTools] JSDT Reporter: Victor Rubezhny <vrubezhny>
Component: GeneralAssignee: Victor Rubezhny <vrubezhny>
Status: RESOLVED FIXED QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: alkazako, thatnitind
Version: 3.6   
Target Milestone: 3.5.2   
Hardware: All   
OS: All   
Whiteboard:

Description Victor Rubezhny CLA 2013-12-16 09:54:13 EST
Even after fixing Bug #420333 (Remove JSDT semantic validation) I'm getting those error/warning error messages on "Missing Semicolon" even if Semantic Validation is turned off in JSDT.

I suppose that these error/warnings came from the JSDT Parser which doesn't respect this "Enable Semantic Validation" preference value.
Comment 1 Victor Rubezhny CLA 2013-12-16 10:26:31 EST
I suppose that the reason is the contradiction in following org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter.computeSeverity(int) method rows:

	/*
	 * If semantic validation is not enabled and this is anything but a
	 * syntax, documentation, or task problem, ignore.
	 */
	if (!this.options.enableSemanticValidation && (problemID & IProblem.Syntax) == 0 && (problemID & IProblem.Javadoc) == 0 && problemID != IProblem.Task) {
		return ProblemSeverities.Ignore;
	}

and the fact is that the "Missing Semicolon" problem is a kind of IProblem.Syntax problem. 

So, even if Semantic Validation is turned off the "Missing Semicolon" problem is still reported unless it's severity level isn't set to "Ignore".

The same goes to "Uninitialized local variables" preference value as well as for probably all the preferences listed under the JavaScript->Validator->Errors/Warnings.
Comment 4 Chris Jaun CLA 2014-01-08 15:12:59 EST
Or this fix, I should say.
Comment 5 Victor Rubezhny CLA 2014-01-08 20:07:58 EST
Re-opening the issue, since the current solution hides much more errors/warnings than it should.
Comment 6 Victor Rubezhny CLA 2014-01-09 08:47:57 EST
With this fix the build validation and as-you-type validation (errpr/warning annotations) are showing the same results, not configurable error/warning messages do not depend on the value of "Enable JavaScript semantic validation" preference value. 

All the JUnit Test cases of DualParseSyntaxErrorTest and SyntaxErrorTest passed successfully.

Pushed to 3.5.2:

http://git.eclipse.org/c/jsdt/webtools.jsdt.core.git/commit/?h=R3_5_maintenance&id=0395d4124e7b50623a164d076193c1b16b6b6d63

Pushed to 3.6:

http://git.eclipse.org/c/jsdt/webtools.jsdt.core.git/commit/?id=b51475df723d7e3ccd1503adea03f593f796cf53
Comment 7 Victor Rubezhny CLA 2014-01-13 08:01:02 EST
*** Bug 424193 has been marked as a duplicate of this bug. ***
Comment 8 Victor Rubezhny CLA 2014-01-16 15:58:49 EST
Reopenning in order to peek up the fix into webtools.jsdt (new merged) master repository.
Comment 9 Victor Rubezhny CLA 2014-01-16 16:43:44 EST
The commit is in merged webtools.jsdt master branch:

http://git.eclipse.org/c/jsdt/webtools.jsdt.git/commit/?id=b51475df723d7e3ccd1503adea03f593f796cf53
Comment 10 Victor Rubezhny CLA 2014-01-16 16:44:47 EST
already fixed