ttypescript
ttypescript copied to clipboard
addDiagnostic is unavaliable
Hello, I'm writing a transformer which could transform some restricted types to runtime code, and when someone write some type unsupported, I want to show a typescript diagnostic.
I found the addDiagnostic
method created by addDiagnosticFactory
and try use it, but it did not work.
https://github.com/cevek/ttypescript/blob/505e3aa95e26b90dd30efa2d2d6612a6882a2baa/packages/ttypescript/src/PluginCreator.ts#L100-L102
Then I found the commented code: https://github.com/cevek/ttypescript/blob/505e3aa95e26b90dd30efa2d2d6612a6882a2baa/packages/ttypescript/src/patchCreateProgram.ts#L97-L98
What typescript 3.7 done to make you have to disable the addDiagnostic
?
And could you uncomment these code and make addDiagnostic
avaliable now?
If it helps, ts-patch
supports diagnostics manipulation.
Thanks, I will try it.