DiagnosticsReceiver
Diagnostics Receiver
Receives diagnostics emitted from a compiler, tool, or other developer-oriented non-runtime step; diagnostics model such concepts as compiler warnings, linter notices, and so on. Diagnostics are received in several ways: for JVM, diagnostics can be reported to any DiagnosticsReceiver-compliant instance. For native code, a singleton static instance of DiagnosticsReceiver is provided at Diagnostics.
In all cases, the receiver buffers diagnostics for later querying, with a hook being made available to indicate that no diagnostics will be consumed past a certain point.