public String getLineTextAt(String text, int offset) { StringCharSource charSource = new StringCharSource(text); charSource.consumeAmount(offset); return LexingUtils.stringUntilNewline(charSource); }