Commit c728df5
feat(generator): add incremental source generator for NinoType discovery
Implement a proper incremental source generator to replace the old type
collection approach. Uses Roslyn's IIncrementalGenerator API with
optimized two-tier architecture:
TIER 1 - NinoType Definitions (per-item cached):
- Pipeline 1: Types with [NinoType] attribute (ForAttributeWithMetadataName)
- Pipeline 2: Types inheriting from NinoType
TIER 2 - Expanded Types (with deduplication):
- Pipeline 3: Recursive expansion of NinoType members/bases/interfaces
- Pipeline 4: Generic method type arguments
- Pipeline 5: Constructed generics from statements (polymorphism support)
Key performance optimizations:
- ForAttributeWithMetadataName API (99% fewer node evaluations)
- Value type data models (TypeModel record struct) for caching
- Custom EquatableArray for proper structural equality
- Object pooling (ThreadStatic) for hot paths
- Separate deduplication per pipeline for better cache granularity
- No CompilationProvider (avoids invalidation on every edit)
- Proper cancellation token forwarding
Follows Roslyn incremental generator best practices for minimal IDE
impact and fast incremental builds.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent e632cda commit c728df5
1 file changed
+746
-0
lines changed
0 commit comments