Search in sources :

Example 1 with SuppressForTestsScopeFix

use of com.siyeh.ig.fixes.SuppressForTestsScopeFix in project intellij-community by JetBrains.

the class EmptyCatchBlockInspection method buildFixes.

@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
    final PsiElement context = (PsiElement) infos[0];
    final SuppressForTestsScopeFix fix = SuppressForTestsScopeFix.build(this, context);
    if (fix == null) {
        return new InspectionGadgetsFix[] { buildFix(infos) };
    }
    return new InspectionGadgetsFix[] { buildFix(infos), fix };
}
Also used : InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) SuppressForTestsScopeFix(com.siyeh.ig.fixes.SuppressForTestsScopeFix) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with SuppressForTestsScopeFix

use of com.siyeh.ig.fixes.SuppressForTestsScopeFix in project intellij-community by JetBrains.

the class StringConcatenationInspection method buildFixes.

@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
    final InspectionGadgetsFix[] fixes = super.buildFixes(infos);
    final PsiPolyadicExpression polyadicExpression = (PsiPolyadicExpression) infos[0];
    final SuppressForTestsScopeFix suppressFix = SuppressForTestsScopeFix.build(this, polyadicExpression);
    if (suppressFix == null) {
        return fixes;
    }
    final InspectionGadgetsFix[] newFixes = Arrays.copyOf(fixes, fixes.length + 1);
    newFixes[fixes.length] = suppressFix;
    return newFixes;
}
Also used : PsiPolyadicExpression(com.intellij.psi.PsiPolyadicExpression) InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) SuppressForTestsScopeFix(com.siyeh.ig.fixes.SuppressForTestsScopeFix) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with SuppressForTestsScopeFix

use of com.siyeh.ig.fixes.SuppressForTestsScopeFix in project intellij-community by JetBrains.

the class StaticImportInspection method buildFixes.

@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
    final PsiElement context = (PsiElement) infos[0];
    final SuppressForTestsScopeFix fix = SuppressForTestsScopeFix.build(this, context);
    if (fix == null) {
        return new InspectionGadgetsFix[] { buildFix(infos) };
    }
    return new InspectionGadgetsFix[] { buildFix(infos), fix };
}
Also used : InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) SuppressForTestsScopeFix(com.siyeh.ig.fixes.SuppressForTestsScopeFix) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with SuppressForTestsScopeFix

use of com.siyeh.ig.fixes.SuppressForTestsScopeFix in project intellij-community by JetBrains.

the class TooBroadThrowsInspection method buildFixes.

@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
    final PsiElement context = (PsiElement) infos[2];
    final SuppressForTestsScopeFix suppressFix = SuppressForTestsScopeFix.build(this, context);
    if (suppressFix == null) {
        return new InspectionGadgetsFix[] { buildFix(infos) };
    }
    return new InspectionGadgetsFix[] { buildFix(infos), suppressFix };
}
Also used : InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) SuppressForTestsScopeFix(com.siyeh.ig.fixes.SuppressForTestsScopeFix) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

InspectionGadgetsFix (com.siyeh.ig.InspectionGadgetsFix)4 SuppressForTestsScopeFix (com.siyeh.ig.fixes.SuppressForTestsScopeFix)4 NotNull (org.jetbrains.annotations.NotNull)4 PsiElement (com.intellij.psi.PsiElement)3 PsiPolyadicExpression (com.intellij.psi.PsiPolyadicExpression)1