summaryrefslogtreecommitdiffstats
path: root/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java')
-rw-r--r--org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java b/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
index 2c87b07..d805f2f 100644
--- a/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
+++ b/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
@@ -85,12 +85,18 @@ public abstract class AbstractIndexAstChecker extends AbstractChecker implements
if (astFile == null) {
astFile = file;
}
- getProblemReporter().reportProblem(
- id,
- new ProblemLocation(astFile, astLocation
- .getStartingLineNumber()), message);
+ ProblemLocation loc;
+ if (astLocation.getStartingLineNumber() == astLocation
+ .getEndingLineNumber())
+ loc = new ProblemLocation(astFile, astLocation.getNodeOffset(),
+ astLocation.getNodeOffset() + astLocation.getNodeLength());
+ else
+ loc = new ProblemLocation(astFile, astLocation
+ .getStartingLineNumber());
+ getProblemReporter().reportProblem(id, loc, message);
}
+ @Override
public boolean runInEditor() {
return true;
}