String (String text, int startOffset, int endOffset) { LineColumn start = StringUtil.offsetToLineColumn(text, startOffset); assert start != null: "textLength = " + text.length() + ", startOffset = " + startOffset; LineColumn end = StringUtil.offsetToLineColumn(text, endOffset); assert end != null : "textLength = " + text.length() + ", endOffset = " + endOffset; if (start.line == end.line) { return String.format("(%d:%d/%d)", start.line + 1, start.column + 1, end.column - start.column); } else { return String.format("(%d:%d..%d:%d)", start.line + 1, end.line + 1, start.column + 1, end.column + 1); } }