aboutsummaryrefslogtreecommitdiffstats
path: root/lint/libs/lint_api
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-07-23 15:05:10 -0700
committerTor Norbye <tnorbye@google.com>2012-07-23 15:17:35 -0700
commitdb39de536209298ed0c09a0e5aaf69c9df5715d3 (patch)
treee3806402e216fc1f5c2495872a641aa84abee2c9 /lint/libs/lint_api
parent099c517c0d151cfb096c829e95737aa81b81ee1c (diff)
downloadsdk-db39de536209298ed0c09a0e5aaf69c9df5715d3.zip
sdk-db39de536209298ed0c09a0e5aaf69c9df5715d3.tar.gz
sdk-db39de536209298ed0c09a0e5aaf69c9df5715d3.tar.bz2
Tweaks to the lint CLI offsets
Change-Id: I20592372d41235b36227a0d36014d77c23c7fc58
Diffstat (limited to 'lint/libs/lint_api')
-rw-r--r--lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java
index f5e7595..1e3b9fa 100644
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java
+++ b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java
@@ -243,7 +243,7 @@ public class Location {
}
char c = contents.charAt(offset);
if (c == '\n') {
- lineOffset = offset;
+ lineOffset = offset + 1;
line++;
}
}
@@ -353,6 +353,10 @@ public class Location {
return new Location(file, new DefaultPosition(line, column, index),
new DefaultPosition(line, -1, end + patternEnd.length()));
}
+ } else if (hints != null && (hints.isJavaSymbol() || hints.isWholeWord())) {
+ return new Location(file, new DefaultPosition(line, column, index),
+ new DefaultPosition(line, column + patternStart.length(),
+ index + patternStart.length()));
}
return new Location(file, new DefaultPosition(line, column, index),
new DefaultPosition(line, column, index + patternStart.length()));