use of com.perl5.lang.perl.idea.quickfixes.PerlFancyMethodQuickFix in project Perl5-IDEA by Camelcade.
the class PerlFancyMethodCallInspection method buildVisitor.
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
return new PerlVisitor() {
@Override
public void visitMethod(@NotNull PsiPerlMethod o) {
if (o.isObjectMethod() && o.getLastChild() instanceof PerlNamespaceElement) {
String packageName = o.getPackageName();
if (packageName == null) {
return;
}
PerlSubNameElement subNameElement = o.getSubNameElement();
if (subNameElement == null) {
return;
}
String properForm = String.format("%s->%s", packageName, subNameElement.getName());
holder.registerProblem(o, PerlBundle.message("perl.inspection.fancy.call", properForm), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new PerlFancyMethodQuickFix(properForm));
}
}
};
}
Aggregations