visitTopLevelVariableDeclaration method

  1. @override
void visitTopLevelVariableDeclaration(
  1. TopLevelVariableDeclaration node
)
override

Record the name of the top level variable declaration we last encountered before seeing the Intl.message call.

Implementation

@override
void visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
  // We don't support names in list declarations,
  // e.g. String first, second = Intl.message(...);
  setFields(
    name: node.variables.variables.length == 1
        ? node.variables.variables.first.name.lexeme
        : null,
    documentation: node.documentationComment,
  );
  super.visitTopLevelVariableDeclaration(node);
  resetFields();
}