void (@NotNull Template template, boolean brokenOff) { PsiDocumentManager.getInstance(project).commitDocument(newEditor.getDocument()); final int offset = newEditor.getCaretModel().getOffset(); final PsiLocalVariable localVariable = PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiLocalVariable.class, false); if (localVariable != null) { TypeSelectorManagerImpl.typeSelected(localVariable.getType(), defaultType.getType()); ApplicationManager.getApplication().runWriteAction(() -> { CodeStyleManager.getInstance(project).reformat(localVariable); }); } }