Repository navigation
Phase 3: Incremental generator migration, decomposition, and API polish - #367
Merged
Merged
Conversation
…or pipeline - Decompose StuntGenerator.cs and CSharpRewrite.cs into StuntDiscovery, StuntPipeline, CSharpFormatter, SyntaxText, HolderEmitter, ForwardingEmitter, WellKnownTypes, and instance-scoped GenProfile. - Migrate StuntGenerator and ProcessorContext to IIncrementalGenerator with CreateSyntaxProvider, equatable discovery records, and IStuntCandidatesProvider (WithCandidateProvider), removing RS1042 suppressions. - Normalize all generated source line endings to LF and batch large StuntRegistrations.Initialize bodies into NoInlining helpers to prevent stack overflow with thousands of generated stunts. - Fix literal Pack="!$(IsPackable)" in Stunts.CompiledProxy.targets so standalone Stunts.CompiledProxy packages do not erroneously pack Stunts.dll into lib/. - Add per-assembly StuntFactory.Register/Unregister/GetFactory so compiled and DynamicProxy assemblies coexist safely. - Add typed AddBehavior<TBehavior>/InsertBehavior<TBehavior> chaining on StuntReference, StuntBuilder, and StuntExtensions (C# and VB). Co-authored-by: CodeAlta <noreply@codealta.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 of the Stunts codebase audit: migrates
StuntGeneratortoIIncrementalGenerator, decomposes the monolithic generator and rewriter files, fixes standaloneStunts.CompiledProxypackaging, and improves runtime factory isolation and behavior chaining APIs.Generator Decomposition & Line-Ending Normalization
StuntGenerator.csintoStuntDiscovery,StuntPipeline,CSharpFormatter,SyntaxText, and instance-scopedGenProfile(removing static mutable profiler state).CSharpRewrite.csintoHolderEmitterandForwardingEmitter, keepingINamedTypeSymbolExtensionspublic.WellKnownTypesacrossStuntFingerprint,CSharpAot, andStuntRegistrations.\n(LF) and chunkedStuntRegistrations.Initialize()into[MethodImpl(MethodImplOptions.NoInlining)]batches above 256 statements to prevent stack overflows in large assemblies (e.g.Acceptance/Staticon Windows Debug).IIncrementalGeneratorMigration & Standalone PackagingProcessorContextaway fromGeneratorExecutionContext/ISyntaxReceiverand replacedIStuntCandidatesReceiverwith incrementalIStuntCandidatesProvider(WithCandidateProvider).StuntGeneratortoIIncrementalGenerator(CreateSyntaxProviderwith equatable discovery records and tracking names +RegisterSourceOutput).RS1042suppressions fromStunts.CompiledProxy.csproj,build/Stunts.CompiledProxy.targets, and tests.Pack="!$(IsPackable)"inStunts.CompiledProxy.targetsusing a computed_PackProjectReferencesproperty so the standaloneStunts.CompiledProxyNuGet package no longer packsStunts.dlldirectly intolib/.Runtime & Packaging API Polish
StuntFactory.Register,Unregister, andGetFactoryso compiled andDynamicProxyassemblies coexist safely within the same process (preservingLocalDefaultprecedence andStuntFactory.Defaultfallback).AddBehavior<TBehavior>()andInsertBehavior<TBehavior>(int)chaining onStuntReference<T>,StuntBuilder, andStuntExtensions(C# and VB).Verification
dotnet format whitespace --verify-no-changesanddotnet format style --verify-no-changesdotnet buildanddnx --yes retest(460 passed, 0 failed)dotnet pack+ verifiedStunts.CompiledProxyandStuntspackage layoutsAcceptance.slnx(Static,Dynamic, and VBDynamic.Basic) all passedThis pull request was created by CodeAlta.