TypeScript
TypeScript copied to clipboard
Compiler API: convert a synthesized SourceFile to a real SourceFile
Suggestion
Have some way to convert a synthesized SourceFile to a real SourceFile that can be used in type checking.
Currently, this kind of SourceFile crashes the compiler because it lacks so much information (e.g. directives, parse tree)
🔍 Search Terms
compiler API parse
💻 Use Cases
Create a new SourceFile from AST Node that can be type checked via Program.emit(). Now I need to print the source file and re-parse it, it's a performance waste.