Closed
Description
While working on a more source generated approach, I noticed that Refit does not correctly use incremental generator caching. While a previous PR uses some of the more modern techniques such as CreateSyntaxProvider
, the lines 829-846 are functionally useless and will never successfully cache anything. This is due to how both ImmutableArray
handles equality and the passing of the reference type Compilation
(this will always change between re-runs).
- Methods should be represented by a structurally comparable object
- A benchmark could be created to confirm the benefits. Its possible that generating the code in a single pass is faster than caching.
- Tests should be added to verify that the caching works as intended
- Why is
PreserveAttribute.cs
added and then its namespace queried? Would the compiler change this? I assume it would always beglobal::RefitInternalGenerated.PreserveAttribute
CancellationToken
should be respected to reduce IDE lag
I'll start work on a PR for this but I don't promise anything.
Related #1389