Generators.Blazor icon indicating copy to clipboard operation
Generators.Blazor copied to clipboard

Source generators should implement IIncrementalGenerator instead of ISourceGenerator

Open sharwell opened this issue 3 years ago • 2 comments

The following source generators implement the "V1" API and use a syntax receiver, which requires reprocessing the entire project after every edit to a source file. This behavior quickly and unavoidably overwhelms the IDE for medium to large projects.

Switching to IIncrementalGenerator allows for incremental processing of syntax to avoid this overhead.

sharwell avatar Jan 20 '22 22:01 sharwell

This Visual Studio Developer Community issue was root caused to this: https://developercommunity.visualstudio.com/t/visual-studio-is-near-2022-uselessly-slow-for-me/1638239.

davkean avatar Jan 20 '22 23:01 davkean

Thanks for raising this. I can see why incremental generators are superior and wish they had been a thing from earlier on. Unfortunately I don't have the time to transition this project to using them, but I'm happy to review PRs that do so.

Side note: the usefulness of this project of this project is unfortunately limited, since one has to make the trade-off between the razor source generator and this library. Both cannot be used simultaneously, which is a huge shame.

stefanloerwald avatar Jan 22 '22 09:01 stefanloerwald