use of com.perl5.lang.perl.psi.PsiPerlSubCallExpr in project Perl5-IDEA by Camelcade.
the class PerlFancyMethodQuickFix method applyFix.
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
PsiElement method = descriptor.getPsiElement();
assert method instanceof PerlMethod;
PsiElement currentCallExpression = method.getParent();
assert currentCallExpression instanceof PsiPerlSubCallExpr;
// fixme ok, this is works, but we make syntax tree invalid, will be updated with next reparsing. Not sure it's a problem
PerlNamespaceElement namespaceElement = ((PerlMethod) method).getNamespaceElement();
assert namespaceElement != null;
PerlSubNameElement subNameElement = ((PerlMethod) method).getSubNameElement();
assert subNameElement != null;
method.replace(PerlElementFactory.createMethodCall(project, namespaceElement.getCanonicalName(), subNameElement.getName()));
}
Aggregations