Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2014-01-09 13:27:22 +0000
committervrubezhny2014-01-09 13:27:22 +0000
commit0395d4124e7b50623a164d076193c1b16b6b6d63 (patch)
tree92c671834c1c2f1a0b98c7837a6ba501911ac793
parent62abc7a02e1c23f515fdfd7d0e72f799456bbe9b (diff)
downloadwebtools.jsdt.core-0395d4124e7b50623a164d076193c1b16b6b6d63.tar.gz
webtools.jsdt.core-0395d4124e7b50623a164d076193c1b16b6b6d63.tar.xz
webtools.jsdt.core-0395d4124e7b50623a164d076193c1b16b6b6d63.zip
[424131] JSDT Parser doesn't respect "Enable Semantic Validation" preference valuev201401091329
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 c780b340..baaf07fe 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