boolean (VirtualFile file, PsiClass psiClass) { if (psiClass == null || psiClass instanceof SyntheticElement) return false; if (file == null || file.getNameWithoutExtension().equals(psiClass.getName())) return true; TemplateManager templateManager = TemplateManager.getInstance(psiClass.getProject()); return ContainerUtil.exists(EditorFactory.getInstance().getAllEditors(), editor -> templateManager.getActiveTemplate(editor) != null); }