use of com.intellij.util.xml.impl.AttributeChildDescriptionImpl in project intellij-community by JetBrains.
the class AbstractDomChildrenDescriptor method getAttributesDescriptors.
@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable final XmlTag context) {
if (context == null)
return XmlAttributeDescriptor.EMPTY;
DomElement domElement = myManager.getDomElement(context);
if (domElement == null)
return XmlAttributeDescriptor.EMPTY;
final List<? extends DomAttributeChildDescription> descriptions = domElement.getGenericInfo().getAttributeChildrenDescriptions();
List<XmlAttributeDescriptor> descriptors = new ArrayList<>();
for (DomAttributeChildDescription description : descriptions) {
descriptors.add(new DomAttributeXmlDescriptor(description, myManager.getProject()));
}
List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
for (CustomDomChildrenDescription custom : customs) {
CustomDomChildrenDescription.AttributeDescriptor descriptor = custom.getCustomAttributeDescriptor();
if (descriptor != null) {
for (EvaluatedXmlName variant : descriptor.getCompletionVariants(domElement)) {
AttributeChildDescriptionImpl childDescription = new AttributeChildDescriptionImpl(variant.getXmlName(), String.class);
descriptors.add(new DomAttributeXmlDescriptor(childDescription, myManager.getProject()));
}
}
}
return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
}
Aggregations