addDiagnostic method
Build a meaningful diagnostic message from the current
runtime information and original message info.
Implementation
void addDiagnostic(String info) {
final msg = switch (debugPath) {
final String path => '$info\n\t... in "$path".',
_ => info,
};
results.addDiagnostic(msg);
}