mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 496720 - Respect scope filters for AST-based checkers
Change-Id: Ib96879ec50bdc5a14215abbe6d109bcf3767d4f4
This commit is contained in:
parent
d1528d0c5d
commit
d77511f4c4
1 changed files with 2 additions and 2 deletions
|
@ -152,13 +152,13 @@ public abstract class AbstractIndexAstChecker extends AbstractCheckerWithProblem
|
||||||
protected boolean shouldProduceProblem(IProblem problem, IProblemLocation loc, Object... args) {
|
protected boolean shouldProduceProblem(IProblem problem, IProblemLocation loc, Object... args) {
|
||||||
String suppressionComment = (String) getSuppressionCommentPreference(problem).getValue();
|
String suppressionComment = (String) getSuppressionCommentPreference(problem).getValue();
|
||||||
if (suppressionComment.isEmpty())
|
if (suppressionComment.isEmpty())
|
||||||
return true;
|
return super.shouldProduceProblem(problem, loc, args);
|
||||||
List<IASTComment> lineComments = getLineCommentsForLocation(loc);
|
List<IASTComment> lineComments = getLineCommentsForLocation(loc);
|
||||||
for (IASTComment astComment : lineComments) {
|
for (IASTComment astComment : lineComments) {
|
||||||
if (astComment.getRawSignature().contains(suppressionComment))
|
if (astComment.getRawSignature().contains(suppressionComment))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return super.shouldProduceProblem(problem, loc, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<IASTComment> getLineCommentsForLocation(IProblemLocation loc) {
|
protected List<IASTComment> getLineCommentsForLocation(IProblemLocation loc) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue