Search in sources :

Example 11 with LocalInspectionToolWrapper

use of com.intellij.codeInspection.ex.LocalInspectionToolWrapper in project intellij-community by JetBrains.

the class RedundantSuppressTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myInspectionToolWrappers = new InspectionToolWrapper[] { new LocalInspectionToolWrapper(new JavaDocReferenceInspection()), new LocalInspectionToolWrapper(new I18nInspection()), new LocalInspectionToolWrapper(new RawUseOfParameterizedTypeInspection()), new GlobalInspectionToolWrapper(new EmptyMethodInspection()), new GlobalInspectionToolWrapper(new UnusedDeclarationInspection()) };
    myWrapper = new GlobalInspectionToolWrapper(new RedundantSuppressInspection() {

        @NotNull
        @Override
        protected InspectionToolWrapper[] getInspectionTools(PsiElement psiElement, @NotNull InspectionManager manager) {
            return myInspectionToolWrappers;
        }
    });
}
Also used : JavaDocReferenceInspection(com.intellij.codeInspection.javaDoc.JavaDocReferenceInspection) GlobalInspectionToolWrapper(com.intellij.codeInspection.ex.GlobalInspectionToolWrapper) I18nInspection(com.intellij.codeInspection.i18n.I18nInspection) RawUseOfParameterizedTypeInspection(com.siyeh.ig.migration.RawUseOfParameterizedTypeInspection) EmptyMethodInspection(com.intellij.codeInspection.emptyMethod.EmptyMethodInspection) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper) UnusedDeclarationInspection(com.intellij.codeInspection.deadCode.UnusedDeclarationInspection) NotNull(org.jetbrains.annotations.NotNull) GlobalInspectionToolWrapper(com.intellij.codeInspection.ex.GlobalInspectionToolWrapper) InspectionToolWrapper(com.intellij.codeInspection.ex.InspectionToolWrapper) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper) PsiElement(com.intellij.psi.PsiElement)

Example 12 with LocalInspectionToolWrapper

use of com.intellij.codeInspection.ex.LocalInspectionToolWrapper in project intellij-community by JetBrains.

the class TestOnlyInspectionTest method doTest.

private void doTest() {
    TestOnlyInspection i = new TestOnlyInspection();
    doTest("testOnly/" + getTestName(true), new LocalInspectionToolWrapper(i), "java 1.5");
}
Also used : TestOnlyInspection(com.intellij.codeInspection.testOnly.TestOnlyInspection) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper)

Example 13 with LocalInspectionToolWrapper

use of com.intellij.codeInspection.ex.LocalInspectionToolWrapper in project intellij-community by JetBrains.

the class JavaDocInspectionTest method testPackageInfo.

public void testPackageInfo() {
    JavaDocLocalInspection inspection = new JavaDocLocalInspection();
    inspection.IGNORE_DEPRECATED = true;
    inspection.setPackageOption("public", "@author");
    myFixture.testInspection("packageInfo", new LocalInspectionToolWrapper(inspection));
}
Also used : LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper) JavaDocLocalInspection(com.intellij.codeInspection.javaDoc.JavaDocLocalInspection)

Example 14 with LocalInspectionToolWrapper

use of com.intellij.codeInspection.ex.LocalInspectionToolWrapper in project intellij-community by JetBrains.

the class UnnecessaryParenthesesInspectionTest method test.

public void test() throws Exception {
    final UnnecessaryParenthesesInspection inspection = new UnnecessaryParenthesesInspection();
    inspection.ignoreParenthesesOnConditionals = true;
    final LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject());
    final LanguageLevel level = levelProjectExtension.getLanguageLevel();
    try {
        levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_8);
        doTest("com/siyeh/igtest/style/unnecessary_parentheses", new LocalInspectionToolWrapper(inspection), "java 1.8");
    } finally {
        levelProjectExtension.setLanguageLevel(level);
    }
}
Also used : LanguageLevel(com.intellij.pom.java.LanguageLevel) LanguageLevelProjectExtension(com.intellij.openapi.roots.LanguageLevelProjectExtension) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper)

Example 15 with LocalInspectionToolWrapper

use of com.intellij.codeInspection.ex.LocalInspectionToolWrapper in project intellij-community by JetBrains.

the class InterfaceNeverImplementedInspectionTest method test.

public void test() throws Exception {
    final LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject());
    final LanguageLevel level = levelProjectExtension.getLanguageLevel();
    try {
        levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_8);
        doTest("com/siyeh/igtest/inheritance/interface_never_implemented", new LocalInspectionToolWrapper(new InterfaceNeverImplementedInspection()), "java 1.8");
    } finally {
        levelProjectExtension.setLanguageLevel(level);
    }
}
Also used : LanguageLevel(com.intellij.pom.java.LanguageLevel) LanguageLevelProjectExtension(com.intellij.openapi.roots.LanguageLevelProjectExtension) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper)

Aggregations

LocalInspectionToolWrapper (com.intellij.codeInspection.ex.LocalInspectionToolWrapper)26 NotNull (org.jetbrains.annotations.NotNull)11 InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)6 Nullable (org.jetbrains.annotations.Nullable)6 GlobalInspectionToolWrapper (com.intellij.codeInspection.ex.GlobalInspectionToolWrapper)4 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)4 RefElement (com.intellij.codeInspection.reference.RefElement)3 TextRange (com.intellij.openapi.util.TextRange)3 List (java.util.List)3 AnalysisScope (com.intellij.analysis.AnalysisScope)2 IntentionAction (com.intellij.codeInsight.intention.IntentionAction)2 IntentionManager (com.intellij.codeInsight.intention.IntentionManager)2 IntentionHintComponent (com.intellij.codeInsight.intention.impl.IntentionHintComponent)2 InspectionManager (com.intellij.codeInspection.InspectionManager)2 LocalInspectionTool (com.intellij.codeInspection.LocalInspectionTool)2 ProblemDescriptor (com.intellij.codeInspection.ProblemDescriptor)2 RedundantCastInspection (com.intellij.codeInspection.redundantCast.RedundantCastInspection)2 RefEntity (com.intellij.codeInspection.reference.RefEntity)2 RefManagerImpl (com.intellij.codeInspection.reference.RefManagerImpl)2 RefVisitor (com.intellij.codeInspection.reference.RefVisitor)2