Search in sources :

Example 1 with PerlUseVarsQuickFix

use of com.perl5.lang.perl.idea.quickfixes.PerlUseVarsQuickFix in project Perl5-IDEA by Camelcade.

the class PerlUseVarsInspection method buildVisitor.

@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
    return new PerlVisitor() {

        @Override
        public void visitUseStatement(@NotNull PsiPerlUseStatement o) {
            if (PACKAGE_VARS.equals(o.getPackageName())) {
                PerlUseVarsQuickFix quickFix = new PerlUseVarsQuickFix(o);
                holder.registerProblem(o, quickFix.isRemoval() ? PerlBundle.message("perl.redundant.code") : PerlBundle.message("perl.inspection.use.vars"), quickFix.isRemoval() ? ProblemHighlightType.LIKE_UNUSED_SYMBOL : ProblemHighlightType.GENERIC_ERROR_OR_WARNING, quickFix);
            }
        }
    };
}
Also used : PsiPerlUseStatement(com.perl5.lang.perl.psi.PsiPerlUseStatement) PerlUseVarsQuickFix(com.perl5.lang.perl.idea.quickfixes.PerlUseVarsQuickFix) PerlVisitor(com.perl5.lang.perl.psi.PerlVisitor) NotNull(org.jetbrains.annotations.NotNull) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PerlUseVarsQuickFix (com.perl5.lang.perl.idea.quickfixes.PerlUseVarsQuickFix)1 PerlVisitor (com.perl5.lang.perl.psi.PerlVisitor)1 PsiPerlUseStatement (com.perl5.lang.perl.psi.PsiPerlUseStatement)1 NotNull (org.jetbrains.annotations.NotNull)1