Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Diagnostic : Record

Describes a diagnostic event which was emitted by a tool such as a compiler or linter; such events carry a severity along with some source and span information.

Link copied to clipboard
interface DiagnosticInfo

Describes information supported by a Diagnostic; extended into mutable form where this type is used by builders.

Link copied to clipboard

Provides static utility methods for working with Diagnostic and MutableDiagnostic records, as well as native entrypoints for reporting to the diagnostics buffer.

Link copied to clipboard

Provides the readable end of a DiagnosticsReceiver; supplies facilities for querying against diagnostics held from the receiver. In most cases, a receiver is also a buffer.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Complements DiagnosticsBuffer with additional query functionality. Represents a collection of diagnostics that are related and can be summarized.

Link copied to clipboard

Describes a class which carries fully mutable diagnostic information; this class is also made available reflectively for spawning new diagnostics from native contexts.

Link copied to clipboard

Describes information supported by a Diagnostic; extended into mutable form where this type is used by builders. All properties on this object are rendered mutable (particularly for use by builders).

Link copied to clipboard
Link copied to clipboard
@Serializable
enum Severity : Enum<Severity> , Symbolic<String>

Enumerates severity levels for diagnostic events issued by tools such as compilers, linters and formatters. Severity is typically mapped from a tool's own internal severity levels.

Link copied to clipboard
@Serializable
data class SourceLocation(val line: UInt, val column: UInt) : Record

Data class representing a source location; a source location uses the combination of a line and column to identify where a Diagnostic was triggered in source code.

Link copied to clipboard
typealias SourcePosition = UInt

Source position: describes a zero-based absolute position within a source file.

Link copied to clipboard
sealed interface SourceReference

Describes source code originating from some place and which was/is eligible as guest code; this includes file sources or simple code snippets.

Link copied to clipboard

Relative source position: describes a zero-based offset-expressed position within a source file, relative to some other position (typically the first type provided as a SourcePosition).

Link copied to clipboard
@Serializable
data class SourceSpan : Record

Describes a span of source code, expressed as a start and (relative) end position within some source file or snippet of code.

Functions

Link copied to clipboard
fun Diagnostic<*>.toDiagnostic(tool: String = JAVAC_TOOL_COMPILER): Diagnostic

Create an immutable diagnostic record from a Java compiler diagnostic.

Link copied to clipboard
fun Diagnostic<*>.toDiagnosticInfo(tool: String = JAVAC_TOOL_COMPILER): DiagnosticInfo

Create an immutable diagnostic record from a Java compiler diagnostic.