1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Bug 496720 - Respect scope filters for AST-based checkers

Change-Id: Ib96879ec50bdc5a14215abbe6d109bcf3767d4f4
This commit is contained in:
Nathan Ridge 2016-10-15 01:34:43 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent d1528d0c5d
commit d77511f4c4

View file

@ -152,13 +152,13 @@ public abstract class AbstractIndexAstChecker extends AbstractCheckerWithProblem
protected boolean shouldProduceProblem(IProblem problem, IProblemLocation loc, Object... args) {
String suppressionComment = (String) getSuppressionCommentPreference(problem).getValue();
if (suppressionComment.isEmpty())
return true;
return super.shouldProduceProblem(problem, loc, args);
List<IASTComment> lineComments = getLineCommentsForLocation(loc);
for (IASTComment astComment : lineComments) {
if (astComment.getRawSignature().contains(suppressionComment))
return false;
}
return true;
return super.shouldProduceProblem(problem, loc, args);
}
protected List<IASTComment> getLineCommentsForLocation(IProblemLocation loc) {