use of com.intellij.lang.javascript.validation.fixes.RemoveASTNodeFix in project intellij-plugins by JetBrains.
the class FlexUnitMethodIsStaticInspection method visitPotentialTestMethod.
protected void visitPotentialTestMethod(JSFunction method, ProblemsHolder holder, FlexUnitSupport support) {
if (FlexUnitSupport.getCustomRunner((JSClass) method.getParent()) != null)
return;
if (method.getAttributeList() != null && method.getAttributeList().hasModifier(JSAttributeList.ModifierType.STATIC)) {
final ASTNode nameIdentifier = method.findNameIdentifier();
if (nameIdentifier != null) {
final ASTNode node = method.getAttributeList().getNode().findChildByType(JSTokenTypes.STATIC_KEYWORD);
assert node != null;
holder.registerProblem(nameIdentifier.getPsi(), FlexBundle.message("flexunit.inspection.testmethodisstatic.message"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new RemoveASTNodeFix("0.is.not.a.legal.name", node) {
@NotNull
@Override
public String getText() {
return FlexBundle.message("flexunit.fix.remove.static.modifier");
}
});
}
}
}
Aggregations