Fix multiple registration for redeclaration errors

This commit is contained in:
Nikolay Krasko
2013-10-23 14:25:46 +04:00
parent 28c0ebe104
commit e96c76b0d8
@@ -179,10 +179,12 @@ public class JetPsiChecker implements Annotator, HighlightRangeExtension {
return;
}
if (!isMarkedWithRedeclaration && Errors.REDECLARATION_DIAGNOSTICS.contains(diagnostic.getFactory())) {
isMarkedWithRedeclaration = true;
Annotation annotation = holder.createErrorAnnotation(diagnostic.getTextRanges().get(0), "");
setUpAnnotation(diagnostic, annotation, null);
if (Errors.REDECLARATION_DIAGNOSTICS.contains(diagnostic.getFactory())) {
if (!isMarkedWithRedeclaration) {
isMarkedWithRedeclaration = true;
Annotation annotation = holder.createErrorAnnotation(diagnostic.getTextRanges().get(0), "");
setUpAnnotation(diagnostic, annotation, null);
}
return;
}