diff --git a/plugins/devkit/src/inspections/PluginXmlDomInspection.java b/plugins/devkit/src/inspections/PluginXmlDomInspection.java index f67dbebc1ab9..59423b3f9b08 100644 --- a/plugins/devkit/src/inspections/PluginXmlDomInspection.java +++ b/plugins/devkit/src/inspections/PluginXmlDomInspection.java @@ -99,6 +99,9 @@ public class PluginXmlDomInspection extends BasicDomElementsInspection xmlnsAttribute = extensions.getXmlns(); if (DomUtil.hasXml(xmlnsAttribute)) { - holder.createProblem(xmlnsAttribute, - ProblemHighlightType.LIKE_DEPRECATED, - "Use defaultExtensionNs instead", null).highlightWholeElement(); + highlightDeprecated(xmlnsAttribute, "Use defaultExtensionNs instead", holder, false, true); return; } @@ -185,8 +188,10 @@ public class PluginXmlDomInspection extends BasicDomElementsInspection skipForDefault = projectComponent.getSkipForDefaultProject(); + if (skipForDefault.exists()) { + highlightDeprecated(skipForDefault, + "'skipForDefaultProject' is deprecated; project components are not loaded in the default project by default", + holder, true, true); + } + } + private static void annotateResolveProblems(DomElementAnnotationHolder holder, GenericAttributeValue attributeValue) { final XmlAttributeValue value = attributeValue.getXmlAttributeValue(); if (value != null) { @@ -339,6 +346,20 @@ public class PluginXmlDomInspection extends BasicDomElementsInspection foo.Bar - <unknown/> diff --git a/plugins/devkit/testData/codeInsight/SkipForDefaultProject.xml b/plugins/devkit/testData/codeInsight/SkipForDefaultProject.xml new file mode 100644 index 000000000000..e969e2ec5ee9 --- /dev/null +++ b/plugins/devkit/testData/codeInsight/SkipForDefaultProject.xml @@ -0,0 +1,9 @@ + + + + foo.Bar + + <unknown/> + + + \ No newline at end of file diff --git a/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy b/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy index 6e25266a721e..5c3d4c015143 100644 --- a/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy +++ b/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy @@ -394,6 +394,11 @@ public class MyErrorHandler extends ErrorReportSubmitter {} myFixture.testHighlighting(true, true, true) } + void testSkipForDefaultProject() throws Exception { + configureByFile() + myFixture.testHighlighting(true, true, true) + } + void testCreateRequiredAttribute() { myFixture.configureByFile(getTestName(true) + ".xml") myFixture.launchAction(myFixture.findSingleIntention("Define class attribute"))