diff --git a/platform/lang-impl/src/com/intellij/codeInspection/PlatformInspectionToolProvider.java b/platform/lang-impl/src/com/intellij/codeInspection/PlatformInspectionToolProvider.java deleted file mode 100644 index fdd4fe52f61c..000000000000 --- a/platform/lang-impl/src/com/intellij/codeInspection/PlatformInspectionToolProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.codeInspection; - -/** - * @author yole - */ -public class PlatformInspectionToolProvider implements InspectionToolProvider { - public Class[] getInspectionClasses() { - return new Class[] { - DefaultHighlightVisitorBasedInspection.AnnotatorBasedInspection.class, - DefaultHighlightVisitorBasedInspection.SyntaxErrorInspection.class, - LossyEncodingInspection.class, - }; - } -} diff --git a/platform/platform-resources/src/META-INF/LangExtensions.xml b/platform/platform-resources/src/META-INF/LangExtensions.xml index d993e2f537ad..2383a6b3e20b 100644 --- a/platform/platform-resources/src/META-INF/LangExtensions.xml +++ b/platform/platform-resources/src/META-INF/LangExtensions.xml @@ -635,7 +635,13 @@ - + + + diff --git a/plugins/devkit/resources/inspectionDescriptions/PluginXmlValidity.html b/plugins/devkit/resources/inspectionDescriptions/PluginXmlValidity.html new file mode 100644 index 000000000000..58869829eb03 --- /dev/null +++ b/plugins/devkit/resources/inspectionDescriptions/PluginXmlValidity.html @@ -0,0 +1,5 @@ + + +This inspection finds various problems in plugin.xml + + \ No newline at end of file diff --git a/plugins/devkit/src/inspections/PluginXmlDomInspection.java b/plugins/devkit/src/inspections/PluginXmlDomInspection.java index dcbd367df17f..b160cbf5dbd1 100644 --- a/plugins/devkit/src/inspections/PluginXmlDomInspection.java +++ b/plugins/devkit/src/inspections/PluginXmlDomInspection.java @@ -15,16 +15,11 @@ */ package org.jetbrains.idea.devkit.inspections; -import com.intellij.util.xml.DomElement; import com.intellij.util.xml.highlighting.BasicDomElementsInspection; -import com.intellij.util.xml.highlighting.DomElementAnnotationHolder; -import com.intellij.util.xml.highlighting.DomHighlightingHelper; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.devkit.DevKitBundle; -import org.jetbrains.idea.devkit.dom.Extension; import org.jetbrains.idea.devkit.dom.IdeaPlugin; /** @@ -52,25 +47,4 @@ public class PluginXmlDomInspection extends BasicDomElementsInspection\n" + - "\n" + - "This inspection finds various problems in plugin.xml\n" + - "\n" + - ""; - } - - protected void checkDomElement(final DomElement element, final DomElementAnnotationHolder holder, final DomHighlightingHelper helper) { - super.checkDomElement(element, holder, helper); - - if (element instanceof Extension) { - Extension extension = (Extension)element; - checkExtension(extension, holder, helper); - } - } - - private void checkExtension(final Extension extension, final DomElementAnnotationHolder holder, final DomHighlightingHelper helper) { - } } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathSupportLoader.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathSupportLoader.java index 72bab1320d5f..2b58cf89491e 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathSupportLoader.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathSupportLoader.java @@ -15,29 +15,15 @@ */ package org.intellij.lang.xpath; -import org.intellij.lang.xpath.validation.inspections.*; - -import com.intellij.codeInspection.InspectionToolProvider; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.fileTypes.FileTypeConsumer; import com.intellij.openapi.fileTypes.FileTypeFactory; import org.jetbrains.annotations.NotNull; -public class XPathSupportLoader extends FileTypeFactory implements InspectionToolProvider { +public class XPathSupportLoader extends FileTypeFactory { private static final boolean DBG_MODE = Boolean.getBoolean("xpath-lang.register-file-type"); - public Class[] getInspectionClasses() { - //noinspection unchecked - return new Class[]{ - CheckNodeTest.class, - ImplicitTypeConversion.class, - RedundantTypeConversion.class, - IndexZeroPredicate.class, - HardwiredNamespacePrefix.class, - }; - } - - public void createFileTypes(final @NotNull FileTypeConsumer consumer) { + public void createFileTypes(final @NotNull FileTypeConsumer consumer) { if (DBG_MODE || ApplicationManager.getApplication().isUnitTestMode()) { consumer.consume(XPathFileType.XPATH, XPathFileType.XPATH.getDefaultExtension()); consumer.consume(XPathFileType.XPATH2, XPathFileType.XPATH2.getDefaultExtension()); diff --git a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathHighlightingTest.java b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathHighlightingTest.java index a7435194e5f4..4d4d366b0350 100644 --- a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathHighlightingTest.java +++ b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathHighlightingTest.java @@ -16,12 +16,21 @@ package org.intellij.lang.xpath; import com.intellij.util.ArrayUtil; +import org.intellij.lang.xpath.validation.inspections.*; public class XPathHighlightingTest extends TestBase { @Override protected void setUp() throws Exception { super.setUp(); - myFixture.enableInspections(new XPathSupportLoader().getInspectionClasses()); + new XPathSupportLoader(); + //noinspection unchecked + myFixture.enableInspections(new Class[]{ + CheckNodeTest.class, + ImplicitTypeConversion.class, + RedundantTypeConversion.class, + IndexZeroPredicate.class, + HardwiredNamespacePrefix.class, + }); } public void testPathTypeMismatch() throws Throwable { diff --git a/plugins/xpath/xpath-view/src/META-INF/plugin.xml b/plugins/xpath/xpath-view/src/META-INF/plugin.xml index 62a2569317d6..bdf1f2c50c5a 100644 --- a/plugins/xpath/xpath-view/src/META-INF/plugin.xml +++ b/plugins/xpath/xpath-view/src/META-INF/plugin.xml @@ -82,7 +82,18 @@ - + + + + + + +