Search in sources :

Example 36 with UnusedDeclarationInspection

use of com.intellij.codeInspection.deadCode.UnusedDeclarationInspection in project android by JetBrains.

the class AndroidMenuTest method testOnClickHighlightingJava.

public void testOnClickHighlightingJava() throws Throwable {
    myFixture.enableInspections(new UnusedDeclarationInspection());
    final VirtualFile f = myFixture.copyFileToProject(myTestFolder + "/" + getTestName(true) + ".java", "src/p1/p2/MyActivity1.java");
    myFixture.configureFromExistingVirtualFile(f);
    myFixture.checkHighlighting(true, false, false);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) UnusedDeclarationInspection(com.intellij.codeInspection.deadCode.UnusedDeclarationInspection)

Example 37 with UnusedDeclarationInspection

use of com.intellij.codeInspection.deadCode.UnusedDeclarationInspection in project android by JetBrains.

the class AndroidInspectionsTest method getUnusedDeclarationWrapper.

private static GlobalInspectionToolWrapper getUnusedDeclarationWrapper() {
    final InspectionEP ep = new InspectionEP();
    ep.presentation = UnusedDeclarationPresentation.class.getName();
    ep.implementationClass = UnusedDeclarationInspection.class.getName();
    ep.shortName = UnusedDeclarationInspectionBase.SHORT_NAME;
    UnusedDeclarationInspection tool = new UnusedDeclarationInspection(true);
    return new GlobalInspectionToolWrapper(tool, ep);
}
Also used : GlobalInspectionToolWrapper(com.intellij.codeInspection.ex.GlobalInspectionToolWrapper) InspectionEP(com.intellij.codeInspection.InspectionEP) UnusedDeclarationPresentation(com.intellij.codeInspection.deadCode.UnusedDeclarationPresentation) UnusedDeclarationInspection(com.intellij.codeInspection.deadCode.UnusedDeclarationInspection)

Example 38 with UnusedDeclarationInspection

use of com.intellij.codeInspection.deadCode.UnusedDeclarationInspection in project android by JetBrains.

the class AndroidInspectionsTest method getAndroidEntryPoint.

@NotNull
private AndroidComponentEntryPoint getAndroidEntryPoint() {
    AndroidComponentEntryPoint result = null;
    for (EntryPoint entryPoint : ((UnusedDeclarationInspection) myUnusedDeclarationToolWrapper.getTool()).getExtensions()) {
        if (entryPoint instanceof AndroidComponentEntryPoint) {
            try {
                result = (AndroidComponentEntryPoint) entryPoint;
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
    assertNotNull(result);
    return result;
}
Also used : EntryPoint(com.intellij.codeInspection.reference.EntryPoint) UnusedDeclarationInspection(com.intellij.codeInspection.deadCode.UnusedDeclarationInspection) IOException(java.io.IOException) NotNull(org.jetbrains.annotations.NotNull)

Example 39 with UnusedDeclarationInspection

use of com.intellij.codeInspection.deadCode.UnusedDeclarationInspection in project android by JetBrains.

the class AndroidLayoutDomTest method testOnClickHighlightingJava.

public void testOnClickHighlightingJava() throws Throwable {
    myFixture.enableInspections(new UnusedDeclarationInspection());
    VirtualFile f = myFixture.copyFileToProject(myTestFolder + "/" + getTestName(true) + ".java", "src/p1/p2/MyActivity1.java");
    myFixture.configureFromExistingVirtualFile(f);
    myFixture.checkHighlighting(true, false, false);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) UnusedDeclarationInspection(com.intellij.codeInspection.deadCode.UnusedDeclarationInspection)

Aggregations

UnusedDeclarationInspection (com.intellij.codeInspection.deadCode.UnusedDeclarationInspection)39 RedundantCastInspection (com.intellij.codeInspection.redundantCast.RedundantCastInspection)3 UncheckedWarningLocalInspection (com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 PsiElement (com.intellij.psi.PsiElement)3 JavacQuirksInspection (com.intellij.codeInspection.compiler.JavacQuirksInspection)2 GlobalInspectionToolWrapper (com.intellij.codeInspection.ex.GlobalInspectionToolWrapper)2 JavaDocReferenceInspection (com.intellij.codeInspection.javaDoc.JavaDocReferenceInspection)2 NotNull (org.jetbrains.annotations.NotNull)2 HighlightDisplayKey (com.intellij.codeInsight.daemon.HighlightDisplayKey)1 InspectionEP (com.intellij.codeInspection.InspectionEP)1 UnusedDeclarationPresentation (com.intellij.codeInspection.deadCode.UnusedDeclarationPresentation)1 EmptyMethodInspection (com.intellij.codeInspection.emptyMethod.EmptyMethodInspection)1 InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)1 LocalInspectionToolWrapper (com.intellij.codeInspection.ex.LocalInspectionToolWrapper)1 I18nInspection (com.intellij.codeInspection.i18n.I18nInspection)1 EntryPoint (com.intellij.codeInspection.reference.EntryPoint)1 PsiField (com.intellij.psi.PsiField)1 CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)1 ApplyChangeSignatureAction (com.intellij.refactoring.changeSignature.inplace.ApplyChangeSignatureAction)1