void (@NotNull DomElement element, @NotNull DomElementAnnotationHolder holder, @NotNull DomHighlightingHelper helper) { if (!(element instanceof Extension extension)) { return; } if (!isAllowed(holder)) return; ExtensionPoint extensionPoint = extension.getExtensionPoint(); if (extensionPoint == null) { return; } String epFqn = extensionPoint.getEffectiveQualifiedName(); if ("com.intellij.statusBarWidgetFactory".equals(epFqn)) { if (hasMissingAttribute(extension, "id")) { holder.createProblem(extension, DevKitBundle.message("inspection.plugin.xml.extension.registration.should.define.id.attribute"), new DefineAttributeQuickFix("id")); } return; } if ("com.intellij.applicationConfigurable".equals(epFqn) || "com.intellij.projectConfigurable".equals(epFqn)) { if (hasMissingAttribute(extension, "displayName") && hasMissingAttribute(extension, "key")) { holder.createProblem(extension, DevKitBundle.message( "inspection.plugin.xml.extension.registration.configurable.should.define.displayName.or.key.attribute"), new DefineAttributeQuickFix("displayName"), new DefineAttributeQuickFix("key")); } } if (!DomUtil.hasXml(extensionPoint.getBeanClass())) { return; } if (StubElementTypeHolderEP.class.getName().equals(extensionPoint.getBeanClass().getStringValue())) { if (hasMissingAttribute(extension, "externalIdPrefix")) { holder.createProblem(extension, DevKitBundle.message("inspection.plugin.xml.extension.registration.should.define.externalidprefix.attribute"), new DefineAttributeQuickFix("externalIdPrefix")); } return; } if (ServiceDescriptor.class.getName().equals(extensionPoint.getBeanClass().getStringValue())) { GenericAttributeValue<?> serviceInterface = DevKitDomUtil.getAttribute(extension, "serviceInterface"); GenericAttributeValue<?> serviceImplementation = DevKitDomUtil.getAttribute(extension, "serviceImplementation"); if (serviceInterface != null && serviceImplementation != null && StringUtil.equals(serviceInterface.getStringValue(), serviceImplementation.getStringValue())) { if (hasMissingAttribute(extension, "testServiceImplementation")) { highlightRedundant(serviceInterface, DevKitBundle.message("inspections.plugin.xml.service.interface.class.redundant"), ProblemHighlightType.WARNING, holder); } } return; } if (InheritanceUtil.isInheritor(extensionPoint.getBeanClass().getValue(), InspectionEP.class.getName())) { if (!hasMissingAttribute(element, "key")) { if (hasMissingAttribute(element, "bundle")) { checkDefaultBundle(element, holder); } } else if (hasMissingAttribute(element, "displayName")) { //noinspection DialogTitleCapitalization registerDefineAttributeProblem(element, holder, DevKitBundle.message("inspections.inspection.mapping.consistency.specify.displayName.or.key"), "displayName", "key"); } if (!hasMissingAttribute(element, "groupKey")) { if (hasMissingAttribute(element, "bundle") && hasMissingAttribute(element, "groupBundle")) { checkDefaultBundle(element, holder); } } else if (hasMissingAttribute(element, "groupName")) { //noinspection DialogTitleCapitalization registerDefineAttributeProblem(element, holder, DevKitBundle.message("inspections.inspection.mapping.consistency.specify.groupName.or.groupKey"), "groupName", "groupKey"); } } if (isExtensionPointWithLanguage(extensionPoint)) { DomAttributeChildDescription<?> languageAttributeDescription = extension.getGenericInfo().getAttributeChildDescription("language"); if (languageAttributeDescription != null) { if (!DomUtil.hasXml(languageAttributeDescription.getDomAttributeValue(extension))) { holder.createProblem(extension, DevKitBundle.message("inspection.plugin.xml.extension.registration.should.define.language.attribute", epFqn), new DefineAttributeQuickFix("language", "", LanguageResolvingUtil.getAnyLanguageValue(extensionPoint))); } return; } // IntentionActionBean, since 223 only DomFixedChildDescription languageTagDescription = extension.getGenericInfo().getFixedChildDescription("language"); if (languageTagDescription != null) { GenericDomValue<?> languageTag = DevKitDomUtil.getTag(extension, "language"); if (languageTag != null && !DomUtil.hasXml(languageTag)) { holder.createProblem(extension, DevKitBundle.message("inspection.plugin.xml.extension.registration.should.define.language.tag", epFqn), new AddLanguageTagQuickFix(LanguageResolvingUtil.getAnyLanguageValue(extensionPoint))); } } } }