Replies: 1 comment 16 replies
-
Why did you move off of the old system?
Can you explain what you mean by this? Intellisense should work with SG files just fine. If you're not seeing that, can you file a new issue with repro steps so we can try out your scenario?
This is doable. You can ask the compiler to emit the SG files to disk, then remove your generator, then only reference the generated files. I would actually recommend this as well, as it will vastly reduce the complexity in the system here. |
Beta Was this translation helpful? Give feedback.
-
I'm migrating from an old precursor of Source Generators by AArnott which I have customized a bit, to the modern Source Generators.
In my previous implementation Source Generators outputted generated code on disk which then passed compilation like normal file. It was also completely intellisensed, source controlled and debuggable.
If I'd remove the generator nothing would change as the generated code has already been created.
After migration I have lost all those QoL features like the code being properly intellisensed and especially DEBUGGABLE.
I've also placed the files adjacent to the sources. So if I had Test.cs then there'd be a Test.generated.cs next to it.
There is a similar discussion #64705, but I feel like the answer is not something I can accept.
Whatever files are outputted are unable to be matched by Rider, VS or otherwise to the symbols in the assembly, since they are not the ones who are fed to the compiler.
Instead the compiler is fed by the inmemory generated sources, while the emitted ones are just for show.
This is very frustrating, and I want to somehow get my QoL features back.
Prefferably source generator would emit the source files and those would be compiled, instead of those in memory.
Such that if I'd remove the source generator as a dependency the sources would remain.
And such that if I rebuild the project with the generator there'd be no duplication errors, since only the emitted files are used.
And such that I could place a breakpoint in those files and actually hit it.
Is there anything I can do for this to work?
Because the entire point of generating human readable sources is lost if I can't actually hit the debug breakpoints in it.
I mean, those are SOURCE generators after all, not inmemorytexts generators. One would assume you'd want the actual source files as the output, with all the features associated.
Beta Was this translation helpful? Give feedback.
All reactions