int (@NotNull Project project, @NotNull PsiElement expression, @NotNull Document document) { TextRange range = expression.getTextRange(); String newPrefix = "new "; document.replaceString(range.getStartOffset(), range.getEndOffset(), newPrefix + expression.getText()); PsiDocumentManager.getInstance(project).commitDocument(document); return range.getStartOffset() + newPrefix.length(); }