diff --git a/csharp/Lib/Generators/Gen.cs b/csharp/Lib/Generators/Gen.cs new file mode 100644 index 000000000..93d604216 --- /dev/null +++ b/csharp/Lib/Generators/Gen.cs @@ -0,0 +1,25 @@ +using Microsoft.CodeAnalysis; + +namespace InnovEnergy.Lib.Generators; + +[Generator] +public class MySourceGenerator : ISourceGenerator +{ + public void Initialize(GeneratorInitializationContext context) + { + } + + public void Execute(GeneratorExecutionContext context) + { + var file = "/home/eef/sync/work/Code/innovenergy/git/csharp/Lib/Protocols/Modbus/Reflection/Exec.cs"; + + File.WriteAllText(file, ""); + + throw new Exception("foo"); + + foreach (var st in context.Compilation.SyntaxTrees) + { + File.AppendAllText(file, st.GetText().ToString()); + } + } +} \ No newline at end of file