registerNodeProcessors method

  1. @override
void registerNodeProcessors(
  1. RuleVisitorRegistry registry,
  2. RuleContext context
)

Registers node processors in the given registry.

The node processors may use the provided context to access information that is not available from the AST nodes or their associated elements.

Implementation

@override
void registerNodeProcessors(
  RuleVisitorRegistry registry,
  RuleContext context,
) {
  // df_safer_dart implements the abstractions whose @noFutures annotations
  // this rule enforces; its internals legitimately bridge Futures into the
  // safe types and must be exempt. The rule is for *consumers*.
  if (isInDfSaferDartPackage(context)) return;

  final visitor = _Visitor(this);
  registry.addFunctionDeclaration(this, visitor);
  registry.addMethodDeclaration(this, visitor);
  registry.addFunctionExpression(this, visitor);
}