Fix: multiple AutoGenerateBuilder(typeof) classes produce no output#78
Draft
Copilot wants to merge 3 commits into
Draft
Fix: multiple AutoGenerateBuilder(typeof) classes produce no output#78Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/StefH/FluentBuilder/sessions/bee1696e-f5c0-43bc-a820-be1fbf2e2842 Co-authored-by: StefH <249938+StefH@users.noreply.github.com>
…ating classes Agent-Logs-Url: https://github.com/StefH/FluentBuilder/sessions/bee1696e-f5c0-43bc-a820-be1fbf2e2842 Co-authored-by: StefH <249938+StefH@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix AutoGenerateBuilder not generating classes for multiple definitions
Fix: multiple AutoGenerateBuilder(typeof) classes produce no output
Mar 29, 2026
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.
When two or more
[AutoGenerateBuilder(typeof(T))]classes reference external/third-party types, the incremental source generator silently produces no output for any of them.Changes
FluentBuilderSourceGenerator— fix incremental generator pipelinediagnosticslist captured in lambda closures — a violation of incremental generator purity requirements that caused stale/duplicate diagnostics across incremental compilations(FluentData Data, Diagnostic? Diagnostic)tuple, reported via a dedicatedRegisterSourceOutputIsSyntaxTargetas the predicate (syntax-only, no modifier check) and move fullCheckSyntaxNodevalidation into the transform so diagnostics are never silently dropped for filtered-out nodesAutoGenerateBuilderSyntaxReceiver— fix silent pipeline abortHandleSyntaxNodeno longer throwsInvalidOperationExceptionwhenTryGetreturnsfalse(e.g. builder class missingpartial). Previously, this exception could abort the entireSyntaxProviderbatch, causing all builders in the compilation to generate nothingIsSyntaxTarget()— fast syntax-only candidate filter for use as the pipeline predicateFluentData— fix incremental cachingIEquatable<FluentData>with properList<string>content equality. The struct contained aList<string> Usingsfield; without this, Roslyn's equality check always returnedfalse(different list references), breaking the incremental cacheFluentBuilderClassesGenerator— defensive null guardFluentDataitems with null/emptyMetadataNameinGetClassSymbolsto safely handle any default-valued structs that reach the generatorExample scenario now working
Previously: neither
ABuilder.g.csnorBBuilder.g.cswas generated.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.