DiagnosticsContainer

Diagnostics Container

Simple container type which holds records complying with DiagnosticInfo; functions as both a DiagnosticsReceiver and DiagnosticsBuffer. This container is thread-safe and can be locked to prevent further writes. Under the hood, it uses a simple ConcurrentLinkedQueue and atomics, so it is always safe but not the most performant choice possible.

Generally speaking, diagnostics are reported in cases where the engine intends to crash before continuing (compiler errors, warnings in strict mode).

Types

Link copied to clipboard
object Companion

Factory methods for diagnostics containers.

Properties

Link copied to clipboard
open override val count: UInt

Count of diagnostics included in this suite of results.

Link copied to clipboard
open val fatal: Boolean

Whether this suite represents a fatal failure.

Link copied to clipboard
open override val severity: Severity

Maximum severity level of reported diagnostics.

Functions

Link copied to clipboard
open override fun all(): Sequence<DiagnosticInfo>

Return a sequence of all reported diagnostic info records for the lifetime of this buffer.

Link copied to clipboard
open override fun clear()

Clear all held diagnostics.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun dirty(lang: String?): Boolean

Indicate whether this buffer has received diagnostics of type lang, or of any type if null is provided.

Link copied to clipboard
open override fun lock()

Lock this diagnostics receiver from further modification; if not called by first read, will be called by first operation.

Link copied to clipboard
open override fun query(consume: Boolean, criteria: Predicate<DiagnosticInfo>): Sequence<DiagnosticInfo>

Return a sequence of all reported diagnostic info records for the lifetime of this buffer that match the given criteria.

open override fun query(lang: String, tool: String?, consume: Boolean): Sequence<DiagnosticInfo>

Return a sequence of all reported diagnostic info records for the lifetime of this buffer that match the given language and/or tool.

Link copied to clipboard
open override fun report(diag: DiagnosticInfo)

Report a single diagnostic record to the receiver.

open override fun report(diags: Iterable<DiagnosticInfo>)

Report an iterable of diagnostic records to the receiver.

open override fun report(diags: Sequence<DiagnosticInfo>)

Report a sequence of diagnostic records to the receiver.

open override fun report(first: DiagnosticInfo, vararg rest: DiagnosticInfo)

Report one or more individual diagnostic record(s) to the receiver.