Commit 2ad4d21d authored by Dennis Ushakov's avatar Dennis Ushakov
Browse files

skip empty ranges

empty ranges can appear when comment start/end token is separated from the comment body (e.g. xml)
these empty ranges break continuation matching
parent e9d51924
Showing with 4 additions and 2 deletions
+4 -2
......@@ -196,8 +196,10 @@ public class IndexPatternSearcher extends QueryExecutorBase<IndexPatternOccurren
builderForFile +
"; chars length:" +
chars.length();
commentRanges.add(new CommentRange(start, end,
builderForFile == null ? "" : builderForFile.getCharsAllowedInContinuationPrefix(tokenType)));
if (start != end) {
commentRanges.add(new CommentRange(start, end,
builderForFile == null ? "" : builderForFile.getCharsAllowedInContinuationPrefix(tokenType)));
}
lastEndOffset = end;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment