feat: source generator fail-safe (internal error diagnostics)#113
Merged
Conversation
…iagnostics Wrap parse and emit pipelines so unexpected generator exceptions report OBS* internal error diagnostics instead of crashing compilation. Adds shared GeneratorFailSafe helper, eight domain descriptors, SignalR regression tests, and marks ROADMAP E2 complete. Closes #112
2 tasks
Skymly
commented
Jul 7, 2026
Skymly
left a comment
Owner
Author
There was a problem hiding this comment.
Review comment
Solid E2 delivery. The shared GeneratorFailSafe split (ExecuteParse vs TryEmit) keeps domain generators thin, and consolidating emit fail-safe in each shproj IncrementalValuesProviderExtensions is the right place for it.
Highlights
OperationCanceledExceptionis rethrown on both paths — correct for incremental generators.- Per-domain internal error IDs avoid colliding with existing
*007analyzer slots. - Events
MessageArg2fix ensures OBS2005 reportstype: messageon both parse and emit paths. - SignalR coverage is practical: unit tests for the helper plus an
IInternalErrorProbehook scoped to theGeneratorTestsassembly.
Merge notes
- Companion docs PR: Observables.Docs#8 — merge after or together with this one.
- On the next release that ships these diagnostics, remember to move the new rules from each domain
AnalyzerReleases.Unshipped.mdintoShipped.md.
Verified locally (pre-PR)
dotnet build Observables.slnx -c ReleaseGeneratorFailSafeTests(3/3)- Events R3 generator tests (16/16)
- Nuke
Testtarget green
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
GeneratorFailSafehelper withExecuteParseandTryEmitto convert unexpected generator exceptions into compile-time diagnostics instead of crashing Roslyn.IncrementalValuesProviderExtensions.MessageArg+MessageArg2).IInternalErrorProbeintegration hook active only forGeneratorTestsassembly).Closes #112
Companion docs PR: Skymly/Observables.Docs (internal error diagnostic tables).
Test plan
dotnet build Observables.slnx -c Releasedotnet test Observables.SignalR.R3.SourceGenerators.Tests --filter GeneratorFailSafeTestsdotnet test Observables.Events.R3.SourceGenerators.TestsTesttarget (full manifest)