Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2014-01-09 13:25:11 +0000
committervrubezhny2014-01-09 13:25:11 +0000
commitb51475df723d7e3ccd1503adea03f593f796cf53 (patch)
tree0ea458a7705b693f00254b40196c51d5235ae2f7
parent4d0a8ee3f67accde467c26df2612294d2e344536 (diff)
downloadwebtools.jsdt-b51475df723d7e3ccd1503adea03f593f796cf53.tar.gz
webtools.jsdt-b51475df723d7e3ccd1503adea03f593f796cf53.tar.xz
webtools.jsdt-b51475df723d7e3ccd1503adea03f593f796cf53.zip
[424131] JSDT Parser doesn't respect "Enable Semantic Validation" preference value
Problem reported is made to respect Enable Semantic Validation preference value for the preferences, so the problems market as ProblemSeverities.Optional (configurable problems) aren't reported in case of Semantic Validation is disabled. 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. Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java
index c780b3404..baaf07fe1 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java
@@ -616,7 +616,10 @@ public int computeSeverity(int problemID){
if (irritant != 0) {
if ((problemID & IProblem.Javadoc) != 0 && !this.options.docCommentSupport)
return ProblemSeverities.Ignore;
- return this.options.getSeverity(irritant);
+ int severity = this.options.getSeverity(irritant);
+ return (!options.enableSemanticValidation && ((severity & ProblemSeverities.Optional) != 0) ?
+ ProblemSeverities.Ignore :
+ severity);
}
return ProblemSeverities.Error | ProblemSeverities.Fatal;
}

Back to the top