textDiagnosticDecorations function
Implementation
List<TextDecorationRange> textDiagnosticDecorations(
Iterable<TextDiagnosticRange> diagnostics,
) {
final normalizedDiagnostics = normalizeTextDiagnostics(diagnostics);
if (normalizedDiagnostics.isEmpty) {
return const [];
}
return List<TextDecorationRange>.unmodifiable([
for (final diagnostic in normalizedDiagnostics)
TextDecorationRange(
startOffset: diagnostic.normalized().startOffset,
endOffset: diagnostic.normalized().endOffset,
styleKey: textDiagnosticStyleKey(diagnostic.severity),
),
]);
}