aboutsummaryrefslogtreecommitdiffstats
path: root/lint/cli
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-06-18 22:33:39 -0700
committerTor Norbye <tnorbye@google.com>2012-06-22 14:42:30 -0700
commit5e290ab6060c3204be3a3eb6084db6f92c88adee (patch)
tree6edefecd33f674e453b070b38bb90813588f44e7 /lint/cli
parent960433ddfada5e246feccdc167a0af183f30bb0a (diff)
downloadsdk-5e290ab6060c3204be3a3eb6084db6f92c88adee.zip
sdk-5e290ab6060c3204be3a3eb6084db6f92c88adee.tar.gz
sdk-5e290ab6060c3204be3a3eb6084db6f92c88adee.tar.bz2
Add typo detector
This changeset adds a new typo detector. There are also some lint infrastructure fixes to better handle positions within text nodes, and to allow Eclipse lint quickfixes to supply multiple fixes for a single issue (such as multiple misspelling alternative replacements.) Change-Id: Ie26f0bafc571e02ae09ff27a7f4b221fe0c2ea5b
Diffstat (limited to 'lint/cli')
-rw-r--r--lint/cli/src/com/android/tools/lint/LintCliXmlParser.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java b/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java
index c13c41d..24149b3 100644
--- a/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java
+++ b/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java
@@ -72,7 +72,18 @@ public class LintCliXmlParser extends PositionXmlParser implements IDomParser {
@Override
public @NonNull Location getLocation(@NonNull XmlContext context, @NonNull Node node) {
- OffsetPosition pos = (OffsetPosition) getPosition(node);
+ OffsetPosition pos = (OffsetPosition) getPosition(node, 0, 0);
+ if (pos != null) {
+ return Location.create(context.file, pos, (OffsetPosition) pos.getEnd());
+ }
+
+ return Location.create(context.file);
+ }
+
+ @Override
+ public @NonNull Location getLocation(@NonNull XmlContext context, @NonNull Node node,
+ int start, int end) {
+ OffsetPosition pos = (OffsetPosition) getPosition(node, start, end);
if (pos != null) {
return Location.create(context.file, pos, (OffsetPosition) pos.getEnd());
}