reportAtPubNode method

void reportAtPubNode(
  1. PubspecNode node, {
  2. required DiagnosticCode diagnosticCode,
  3. List<Object> arguments = const [],
  4. List<DiagnosticMessage> contextMessages = const [],
})

Reports diagnosticCode at Pubspec node, with message arguments and contextMessages.

Implementation

void reportAtPubNode(
  PubspecNode node, {
  required DiagnosticCode diagnosticCode,
  List<Object> arguments = const [],
  List<DiagnosticMessage> contextMessages = const [],
}) {
  // Cache error and location info for creating `AnalysisErrorInfo`s.
  var error = Diagnostic.tmp(
    source: (node as PubspecNodeImpl).source,
    offset: node.span.start.offset,
    length: node.span.length,
    diagnosticCode: diagnosticCode,
    arguments: arguments,
    contextMessages: contextMessages,
  );
  _reporter.reportError(error);
}