boolean (final XmlAttributeValue host, final String languageId) { final XmlAttribute attribute = PsiTreeUtil.getParentOfType(host, XmlAttribute.class, true); final XmlTag tag = attribute == null? null : attribute.getParent(); if (tag != null) { final XmlAttributeInjection injection = new XmlAttributeInjection(); injection.setInjectedLanguageId(languageId); injection.setAttributeName(attribute.getLocalName()); injection.setAttributeNamespace(attribute.getNamespace()); injection.setTagName(tag.getLocalName()); injection.setTagNamespace(tag.getNamespace()); injection.generatePlaces(); doEditInjection(host.getProject(), host.getContainingFile(), injection); return true; } return false; }