Open mrmeku opened 3 years ago
Working on this in ts-patch
now - https://github.com/nonara/ts-patch/issues/35
I looked into this a bit. I'm not sure I see how this wouldn't work.
But, if it isn't working, I believe I found the solution.
For createIncrementalProgram
, look at the signature and you will see that it takes a createProgram
function as an argument. Pass ts.createProgram
to it (where ts
is your patched typescript instance) and it should work.
For createWatchProgram
you also need to pass it a WatchCompilerHost
, which is created using createWatchCompilerHost
. In that case, check the signature for createWatchCompilerHost
and you will see a parameter which takes a createProgram
function. Follow the same procedure for that, and it should work.
If it isn't working, create a reproduction using ts-patch
, and I'll have a look!
Currently ttypescript patches
createProgram
but does not patchcreateWatchProgram
orcreateIncrementalProgram
. As a result, transformations do not occur when calling those two APIs which is unexpected