DiagnosticReporter class

An object used to create diagnostics and report them to a diagnostic listener.

Annotations
  • @AnalyzerPublicApi(message: 'Exported by package:analyzer/error/listener.dart')

Constructors

DiagnosticReporter.new(DiagnosticOrErrorListener _diagnosticListener, Source _source)
Initializes a newly created error reporter that will report diagnostics to the given _diagnosticListener.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Source
no setter

Methods

atConstructorDeclaration(ConstructorDeclaration node, DiagnosticCode diagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode and arguments.
atElement2(Element element, DiagnosticCode diagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode and arguments.
atEntity(SyntacticEntity entity, DiagnosticCode diagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode and arguments.
atNode(AstNode node, DiagnosticCode diagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode and arguments.
atOffset({required int offset, required int length, DiagnosticCode? errorCode, DiagnosticCode? diagnosticCode, List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode (or errorCode, deprecated) and arguments.
atSourceSpan(SourceSpan span, DiagnosticCode diagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode and arguments.
atToken(Token token, DiagnosticCode diagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) Diagnostic
Reports a diagnostic with the given diagnosticCode and arguments.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reportError(Diagnostic diagnostic) → void
Report the given diagnostic.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited