Repository navigation
Feat/component guard and generator throw rule - #42
Merged
kieronlanning merged 4 commits intoOct 22, 2026
Merged
Conversation
… diagnostic An exception escaping a source generator is reported as CS8785 in every consuming build and IDE, and the generator produces no output at all for that compilation, so the consumer also gets every "type or namespace not found" error that follows, with a stack trace through code they do not own. PSGFR44 flags a throw in code that runs during generation. ComponentGuard turns an escaping exception into a diagnostic for every component kind the framework supports: Run reports where there is a channel to report on (a generator, an analyzer), TryRun returns whether the body succeeded where there is not (suppressors, code fixes, refactorings, which should simply do nothing). Cancellation is never caught. The reported diagnostic defaults entirely from the component, because it belongs to the consumer: the id derives from the component namespace, the title from the component kind, the category from the root namespace. Every part is overridable through GenerationSettings.FailureOptions. Fixes two blind spots in PSGFR33: it matched banned types by exact display string, so INamedTypeSymbol never matched ISymbol, and it only walked named model types, so a transform returning a symbol was invisible. TypeLibraryModelLibrary no longer holds a symbol in a pipeline node, and three throw arms in AttributeDataModelGenerator are gone. RunIncremental now builds a fresh Compilation per run, matching what an IDE does; reusing one let a symbol-holding stage report Cached on reference equality alone and hid the regression these tests exist to catch.
kieronlanning
deleted the
feat/component-guard-and-generator-throw-rule
branch
October 22, 2026 11:36
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.
No description provided.