use of org.jetbrains.idea.devkit.dom.Dependency in project intellij-community by JetBrains.
the class RegistrationCheckerUtil method checkModule.
@Nullable
private static Set<PsiClass> checkModule(Module module, PsiClass psiClass, @Nullable Set<PsiClass> types, boolean includeActions) {
final XmlFile pluginXml = PluginModuleType.getPluginXml(module);
if (pluginXml == null)
return null;
final DomFileElement<IdeaPlugin> fileElement = DescriptorUtil.getIdeaPlugin(pluginXml);
if (fileElement == null)
return null;
final String qualifiedName = psiClass.getQualifiedName();
if (qualifiedName != null) {
final RegistrationTypeFinder finder = new RegistrationTypeFinder(psiClass, types);
// "main" plugin.xml
processPluginXml(pluginXml, finder, includeActions);
// <depends> plugin.xml files
for (Dependency dependency : fileElement.getRootElement().getDependencies()) {
final GenericAttributeValue<PathReference> configFileAttribute = dependency.getConfigFile();
if (!DomUtil.hasXml(configFileAttribute))
continue;
final PathReference configFile = configFileAttribute.getValue();
if (configFile != null) {
final PsiElement resolve = configFile.resolve();
if (!(resolve instanceof XmlFile))
continue;
final XmlFile depPluginXml = (XmlFile) resolve;
if (DescriptorUtil.isPluginXml(depPluginXml)) {
processPluginXml(depPluginXml, finder, includeActions);
}
}
}
types = finder.getTypes();
}
return types;
}
Aggregations