Open Jack-Works opened 4 years ago
@rbuckton what are your thoughts?
I'd like to see this in public as well. In my transformer there are cases where I'm 100% sure that the error is possible and I need to notify about that somehow.
Any updates on this?
@rbuckton @RyanCavanaugh just a friendly ping (it seems that there is no answer since last Ryan's question, soooo...)
Probably after #54276 it would worth to re-visit this ticket? 😂 cc @jakebailey (sorry for pining)
Search Terms
custom transformer diagnostic
Suggestion
mark the method
addDiagnostic
inTransformationContext
as public and read the diagnostic result in the compilerUse Cases
I'm writing a custom transformer. In some cases, the transform will fail but I don't want to throw an Error. I want to add my error to the diagnostics.
Examples
I have tried to call the
addDiagnostic
by as anyBut that doesn't work. After digging into the source code, I found that it seems like the diagnostics only read in the
dts
generating.Checklist
My suggestion meets these guidelines: