return null;
List regions = new ArrayList();
+ // now add all comments first to the regions list
if (fFirstType == null && element instanceof IType) {
fFirstType = (IType) element;
IRegion headerComment = computeHeaderComment(fFirstType);
final int shift = range.getOffset();
int start = shift;
- regions.add(new Region(range.getOffset(), range.getLength()));
if (element instanceof IType) {
Scanner scanner = ToolFactory.createScanner(true, false, false, false);
scanner.setSource(contents.toCharArray());
continue;
}
}
- regions.add(new Region(start, shift + range.getLength() - start));
}
-
+ // at the end add the element region
+ regions.add(new Region(range.getOffset(), range.getLength()));
if (regions.size() > 0) {
IRegion[] result = new IRegion[regions.size()];