Search in sources :

Example 1 with ActionScriptCreateConstructorFix

use of com.intellij.lang.javascript.validation.fixes.ActionScriptCreateConstructorFix in project intellij-plugins by JetBrains.

the class ActionScriptFunctionSignatureChecker method checkConstructorCall.

@Override
public void checkConstructorCall(@NotNull JSCallExpression node, @NotNull JSClass target) {
    if (node instanceof JSNewExpression || node.getMethodExpression() instanceof JSSuperExpression) {
        final JSArgumentList argumentList = node.getArgumentList();
        final JSExpression[] expressions = argumentList != null ? argumentList.getArguments() : JSExpression.EMPTY_ARRAY;
        if (expressions.length > 0) {
            final ActionScriptCreateConstructorFix fix = ActionScriptCreateConstructorFix.createIfApplicable(node);
            registerProblem(node, JSBundle.message("javascript.invalid.number.of.parameters", "0"), fix != null ? new LocalQuickFix[] { fix } : LocalQuickFix.EMPTY_ARRAY);
        }
    } else {
        reportProblemIfNotExpectedCountOfParameters(node, 1, "one");
    }
}
Also used : ActionScriptCreateConstructorFix(com.intellij.lang.javascript.validation.fixes.ActionScriptCreateConstructorFix) JSSuperExpression(com.intellij.lang.javascript.psi.ecmal4.JSSuperExpression) LocalQuickFix(com.intellij.codeInspection.LocalQuickFix)

Aggregations

LocalQuickFix (com.intellij.codeInspection.LocalQuickFix)1 JSSuperExpression (com.intellij.lang.javascript.psi.ecmal4.JSSuperExpression)1 ActionScriptCreateConstructorFix (com.intellij.lang.javascript.validation.fixes.ActionScriptCreateConstructorFix)1