David Sherret
David Sherret
@likuner well I won't be able to fix it because I don't have time and it's a bug with the TypeScript compiler. If you need this fixed then you can...
@Kingwl does `sourceFile.applyTextChanges` do what you need? There is also `applyChanges` on a few other objects. https://github.com/dsherret/ts-morph/blob/3c27c37713a99c110d2349d4573e724540f07b60/packages/ts-morph/lib/ts-morph.d.ts#L7286
Oh, nevermind. I should have clicked the link earlier 😅
@zaach the workaround right now is to use what's outlined on [this page](https://ts-morph.com/manipulation/#replacing-any-node-with-new-text) or to use [AST Transforms](https://ts-morph.com/manipulation/transforms) (both solutions are not very ideal... maybe using `replaceWithText` is your best...
Yeah, it would be nice to add this, but not sure the best way. Just looking at the compiler code and it seems like there are `isDiscriminantProperty` and `findDiscriminantProperties` functions...
There is a very high chance of mis-use (ex. providing an out of date node). I should make all these methods actually private.
Thinking about it more, I think we could expose this method, but the public one would do some additional checks on the provided compiler node to make sure it's still...
Thanks for the idea @Liero! I will add some help pages with examples for code generation specifically. There's a way to do it extremely fast that I'm not even using...
@jon9090 check `project.getPreEmitDiagnostics()` for any diagnostics after creating the source files. At a glance, it looks like the code is using the import specifier `"./index.ts"`, which should be `"./index"` to...
@jon9090 check the output by doing something like `console.log(project.getPreEmitDiagnostics())`