Open mdonatas opened 2 months ago
@mdonatas thank you for the feedback. I haven't messed with this scenario within NetPad yet, but this is a great use case that I'd like to support. I'll check it out.
Update: I tried to create a fix for this for the upcoming release but as far as I can tell .NET is missing a couple APIs to make this possible via the implementation currently used by NetPad. I'll give it another push after the next update.
Thanks for the update and for the effort. I take it NetPad uses different pipelines for intellisense and for building as intellisense can handle generators. Best of luck with this! There are more and more generators being used in dotnet so it would be really nice to have support for them.
I take it NetPad uses different pipelines for intellisense and for building as intellisense can handle generators.
It does. The problem I'm facing currently is I need to get the code the generator would output to include it when compiling your user code but there's no straightforward way to do that programmatically with a generator defined in the BCL (and not in your user code) that I've found so far. One rather hacky way to do it is to create a temp project and have Roslyn run the generator and grab the output but I'm trying to find a more elegant solution.
A script with a Source Generator fails to compile when run although intelli-sense shows that a Source Generator has run (at least during edit time) as correct xml-doc was made for the partial method.