Indent (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 (!StringsKt.isBlank(document.getCharsSequence().subSequence(lineStartOffset, nodeTextRange.getStartOffset()))) return null; return new IndentImpl(Indent.Type.SPACES, true, nodeTextRange.getStartOffset() - lineStartOffset, false, false); }