PsiFile (@NotNull PsiFile copyFile, @NotNull Editor realEditor, int currentOffset) { Document document = copyFile.getViewProvider().getDocument(); assert document != null; CharSequence sequence = document.getCharsSequence(); StringBuilder fileContentWithSemicolon = new StringBuilder(sequence); if (isSemicolonNeeded(copyFile, realEditor)) { fileContentWithSemicolon.insert(currentOffset, ';'); return PostfixLiveTemplate.copyFile(copyFile, fileContentWithSemicolon); } return copyFile; }