use of org.eclipse.xtext.formatting2.debug.TextRegionsWithTitleToString in project xtext-core by eclipse.
the class RegionsOutsideFrameException method getMessage.
@Override
public String getMessage() {
String regionsStr;
if (regions.length == 1) {
regionsStr = "region " + regions[0].getFirst();
} else {
List<String> titles = Lists.newArrayList();
for (Pair<String, ITextSegment> p : regions) titles.add(p.getFirst());
regionsStr = "regions " + Joiner.on(", ").join(titles);
}
StringBuilder builder = new StringBuilder();
builder.append("The " + regionsStr + " must not be outside " + frameTitle + ".\n");
TextRegionsWithTitleToString toStr = new TextRegionsWithTitleToString();
toStr.add(frameTitle, frameRegion);
for (Pair<String, ITextSegment> p : regions) toStr.add(p.getFirst(), p.getSecond());
builder.append(toStr);
return builder.toString();
}
use of org.eclipse.xtext.formatting2.debug.TextRegionsWithTitleToString in project xtext-core by eclipse.
the class ConflictingRegionsException method getMessage.
@Override
public String getMessage() {
StringBuilder builder = new StringBuilder();
builder.append(super.getMessage() + ".\n");
TextRegionsWithTitleToString toStr = new TextRegionsWithTitleToString();
for (RegionTrace trace : traces) toStr.add(trace.getMessage(), trace.getRegion());
builder.append(toStr);
return builder.toString();
}
Aggregations