use of com.intellij.xml.util.IncludedXmlTag in project intellij-community by JetBrains.
the class PluginDescriptorChooser method findOrCreateExtensionsForEP.
@NotNull
public static Extensions findOrCreateExtensionsForEP(DomFileElement<IdeaPlugin> domFileElement, String epName) {
final IdeaPlugin ideaPlugin = domFileElement.getRootElement();
final List<Extensions> extensionsList = ideaPlugin.getExtensions();
for (Extensions extensions : extensionsList) {
if (extensions.getXmlTag() instanceof IncludedXmlTag) {
continue;
}
String s = extensions.getDefaultExtensionNs().getStringValue();
if (s != null && epName.startsWith(s)) {
return extensions;
}
}
Extensions extensions = ideaPlugin.addExtensions();
final String epPrefix = StringUtil.getPackageName(epName);
extensions.getDefaultExtensionNs().setStringValue(epPrefix);
return extensions;
}
Aggregations