|
Loom C API
Public Loom compiler C API
|
Borrowed diagnostic view owned by a result object. More...
#include <diagnostic.h>
Data Fields | |
| loomc_diagnostic_severity_t | severity |
| Diagnostic severity. | |
| loomc_string_view_t | code |
| Stable diagnostic code. | |
| loomc_string_view_t | message |
| Human-readable rendered message. | |
| loomc_string_view_t | formatted_text |
| Canonical human-readable rendering of the complete diagnostic. | |
| loomc_source_range_t | range |
| Primary source range. | |
| const loomc_diagnostic_related_location_t * | related_locations |
| Related locations in producer order, or NULL when the count is zero. | |
| loomc_host_size_t | related_location_count |
| Number of entries in related_locations. | |
| loomc_host_size_t | related_location_omitted_count |
| Number of additional resolved locations omitted by the producer's limit. | |
| const loomc_diagnostic_parameter_t * | parameters |
| Named rendered parameters in diagnostic-definition order, or NULL when the count is zero. | |
| loomc_host_size_t | parameter_count |
| Number of entries in parameters. | |
| loomc_string_view_t | formatted_json |
| Canonical JSON object for the native compiler diagnostic, without a trailing newline. | |
Borrowed diagnostic view owned by a result object.
| loomc_string_view_t loomc_diagnostic_t::formatted_json |
Canonical JSON object for the native compiler diagnostic, without a trailing newline.
This preserves producer-specific fields, typed JSON parameters, source provenance, and fix hints that the common fields above do not express. It is rendered during the operation while compiler-owned values are available and remains valid until the result is released. Empty for diagnostics produced without a native compiler record.
| loomc_string_view_t loomc_diagnostic_t::formatted_text |
Canonical human-readable rendering of the complete diagnostic.
This includes source excerpts, carets, fix hints, and related locations when available, and ends with a newline. It is intended for terminal and log presentation; tools requiring stable data should consume the structured fields instead. The view is empty when no canonical rendering is available.