private @Nullable Indent computeTemplateIndent(TextRange nodeTextRange) {
    Document document = PsiDocumentManager.getInstance(myFile.getProject()).getDocument(myFile);
    if (document == null) return null;
    int lineNumber = document.getLineNumber(nodeTextRange.getStartOffset());
    int lineStartOffset = document.getLineStartOffset(lineNumber);

    if (!StringUtilRt.isEmptyOrSpaces(document.getCharsSequence().subSequence(lineStartOffset, nodeTextRange.getStartOffset()))) return null;

    return new IndentImpl(Indent.Type.SPACES, true, nodeTextRange.getStartOffset() - lineStartOffset, false, false);
  }
private @Nullable Indent computeTemplateIndent(TextRange nodeTextRange)