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
Methods
-
atConstructorDeclaration(
ConstructorDeclaration node, DiagnosticCode diagnosticCode, {List< Object> ? arguments, List<DiagnosticMessage> ? contextMessages, Object? data}) → Diagnostic -
Reports a diagnostic with the given
diagnosticCode
andarguments
. -
atElement2(
Element element, DiagnosticCode diagnosticCode, {List< Object> ? arguments, List<DiagnosticMessage> ? contextMessages, Object? data}) → Diagnostic -
Reports a diagnostic with the given
diagnosticCode
andarguments
. -
atEntity(
SyntacticEntity entity, DiagnosticCode diagnosticCode, {List< Object> ? arguments, List<DiagnosticMessage> ? contextMessages, Object? data}) → Diagnostic -
Reports a diagnostic with the given
diagnosticCode
andarguments
. -
atNode(
AstNode node, DiagnosticCode diagnosticCode, {List< Object> ? arguments, List<DiagnosticMessage> ? contextMessages, Object? data}) → Diagnostic -
Reports a diagnostic with the given
diagnosticCode
andarguments
. -
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
(orerrorCode
, deprecated) andarguments
. -
atSourceSpan(
SourceSpan span, DiagnosticCode diagnosticCode, {List< Object> ? arguments, List<DiagnosticMessage> ? contextMessages, Object? data}) → Diagnostic -
Reports a diagnostic with the given
diagnosticCode
andarguments
. -
atToken(
Token token, DiagnosticCode diagnosticCode, {List< Object> ? arguments, List<DiagnosticMessage> ? contextMessages, Object? data}) → Diagnostic -
Reports a diagnostic with the given
diagnosticCode
andarguments
. -
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