use of org.jetbrains.plugins.groovy.codeInspection.changeToOperator.transformations.Transformation in project intellij-community by JetBrains.
the class ChangeToOperatorInspection method buildVisitor.
@NotNull
@Override
protected BaseInspectionVisitor buildVisitor() {
return new BaseInspectionVisitor() {
@Override
public void visitMethodCallExpression(@NotNull GrMethodCallExpression methodCall) {
final String methodName = getMethodName(methodCall);
if (methodName == null)
return;
Transformation transformation = TRANSFORMATIONS.get(methodName);
if (transformation == null)
return;
PsiElement highlightElement = getHighlightElement(methodCall);
if (highlightElement == null)
return;
if (transformation.couldApply(methodCall, getOptions())) {
registerError(highlightElement, message("replace.with.operator.message", methodName), new LocalQuickFix[] { getFix(transformation, methodName) }, GENERIC_ERROR_OR_WARNING);
}
}
};
}
Aggregations