21 #define COLOUR_PATH eColourBlue
33 .heading_style = options.heading,
42 static void print_notify_note_simple(
notify_config_t *config,
const char *path,
const char *note)
60 .heading_style = options.heading,
66 const char *
id = diagnostic->
id;
73 char *level =
colour_format(format_context, severity_colour,
"%s %s:", severity_name,
id);
80 for (
size_t i = 0; i < len; i++)
83 print_notify_segment_simple(config, segment);
87 if (event->
notes != NULL)
90 for (
size_t i = 0; i < len; i++)
93 print_notify_note_simple(config, path, note);
107 print_notify_simple(¬ify_config, event);
116 for (
size_t i = 0; i < len; i++)
STA_DECL char * colour_format(format_context_t context, colour_t idx, const char *fmt,...)
#define STA_DECL
sal2 annotation on function implementations to copy annotations from the declaration
CT_IO_API size_t io_printf(io_t *io, STA_FORMAT_STRING const char *fmt,...)
printf to an io object
severity_t
the default severity of a diagnostic
#define CTASSERT(expr)
assert a condition, prints the condition as a message
CT_NODISCARD CT_PUREFN CT_STD_API size_t typevec_len(const typevec_t *vec)
get the length of a vector
CT_NODISCARD CT_PUREFN CT_STD_API void * typevec_offset(const typevec_t *vec, size_t index)
get a pointer to the value at the given index
CT_NODISCARD CT_PUREFN CT_STD_API void * vector_get(const vector_t *vector, size_t index)
get a value from a vector
CT_NODISCARD CT_PUREFN CT_STD_API size_t vector_len(const vector_t *vector)
get the length of a vector
const char * id
the id of the diagnostic should be in the format [A-Z]{2,3}[0-9]{4} e.g. CLI0001 this is not enforced...
severity_t severity
the severity of the diagnostic
an event handle TODO: make this and segment_t opaque
node_t node
the primary node that this event is attached to
vector_t * notes
extra notes that this event is attached to
STA_FIELD_STRING char * message
the primary message
typevec_t * segments
extra segments that this event is attached to
a formatting context when using colours
notification formatting options
print_options_t options
base print options
bool zero_indexed_lines
is the first line in a file 0 or 1
a segment inside an event
node_t node
the related node
STA_FIELD_STRING char * message
the message associated with this segment
A vector with a fixed type size.