String (@NotNull PsiElement heredocContent, @NotNull Document document) { TextRange textRange = heredocContent.getTextRange(); int lineNumber = document.getLineNumber(textRange.getStartOffset()); int startOffset = document.getLineStartOffset(lineNumber); int endOffset = document.getLineEndOffset(lineNumber); return document.getText(TextRange.create(startOffset, endOffset)).trim() + "..."; }