I have a typescript file which I want to edit dynamically from code. I want to pass the path of the typescript file to some sort of AST parser and then do manipulation on that AST and Save it. However, all this I want to do using C# code since I don't want dependency of node_modules. Is there a way we can do it in C#?
What I want is similar to below functionality(this works for c#)
AdhocWorkspace adhocWorkspace = new AdhocWorkspace();
var syntaxGenerator = SyntaxGenerator.GetGenerator(adhocWorkspace, LanguageNames.CSharp);
Using the syntaxGenerator
I can generate any c# code I want. Similarly I want to generate for TypeScript.
Can Roslyn do this? Or Is there any other way? Thanks.