void (final Project project, final Template template, final Document document, final RangeMarker templateRange, final Editor editor) { if (!template.isToShortenLongNames()) return; PsiDocumentManager.getInstance(project).commitDocument(document); final PsiFile file = PsiUtilBase.getPsiFileInEditor(editor, project); if (file instanceof GroovyFile) { DumbService.getInstance(project).withAlternativeResolveEnabled(() -> JavaCodeStyleManager.getInstance(project).shortenClassReferences(file, templateRange.getStartOffset(), templateRange.getEndOffset())); } PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document); }