private static int getForwardLineNumber(Document document, PsiElement element) {
    while (element instanceof PsiWhiteSpace || element instanceof PsiComment) {
      element = element.getNextSibling();
    }
    if (element == null) return -1;

    TextRange range = element.getTextRange();
    return document.getLineNumber(range.getEndOffset());
  }
private static int getForwardLineNumber(Document document, PsiElement element)