PsiElement (PsiManager psiManager, Object object, PsiElement element) { if (object instanceof LiveTemplateLookupElementImpl) { TemplateImpl template = ((LiveTemplateLookupElementImpl)object).getTemplate(); final TemplateImpl templateFromSettings = TemplateSettings.getInstance().getTemplate(template.getKey(), template.getGroupName()); if (templateFromSettings != null) { return new LiveTemplateElement(templateFromSettings, psiManager); } } return null; }