'Is there any way to create/edit a source file from within my custom TS worker?

I've used this option to provide my custom worker implementation that inherits the default one. I can get my ts.SourceFile with this._languageService.getProgram().getSourceFile() and I can call update on it. But how can I save it back to be able to analyze?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source