I am currently trying to hunt down a bug in the SystemGenerator that fails to recognize calls to Schedule&Co if they are executed on an return value of a function directly.
Basically:
public partial struct TestSystem : ISystem
{
public void OnUpdate(ref SystemState state)
{
var job = Create(ref state);
job.Schedule(); // works
Create(ref state).Schedule(); // broken
new Job().Schedule(); // works (of course)
}
Job Create(ref SystemState state) => new();
partial struct Job : IJobEntity { void Execute() { } }
}```
If I call .Schedule() (or Run or any other of these methods) directly on the return value of a function, the source generator fails to pick up and replace the call. 😮
I am currently "just staring" at some code, e.g. IjeSchedulingSyntaxWalker.VisitInvocationExpression or maybe inside JobEntityInstanceInfo.GetAndAddScheduleExpression..
Anyone has hints how to debug the SystemGenerator (or maybe where the actual issue is?) I tried setup a Rider launchsettings.json like I did for our own project source generators, but the dots entity one seems to be a bit more complicated to get running. Any howtos?