getProcessor static method
Returns an error processor associated in the analysisOptions
for the
given diagnostic
, or null
if none is found.
Implementation
static ErrorProcessor? getProcessor(
// TODO(srawlins): Make `analysisOptions` non-nullable, in a breaking
// change release.
AnalysisOptions? analysisOptions,
Diagnostic diagnostic,
) {
return analysisOptions?.errorProcessors.firstWhereOrNull(
(processor) => processor.appliesTo(diagnostic),
);
}