Skip to content

Conversation

@datacute
Copy link
Owner

@datacute datacute commented Aug 3, 2025

No description provided.

@datacute datacute requested a review from Copilot August 3, 2025 10:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This release PR bumps the version to 1.0.0 and introduces significant architectural changes to simplify the source generator implementation while modernizing the API design.

  • Replaces boolean properties with a flags-based enum system for better extensibility
  • Simplifies the codebase by leveraging external libraries for common functionality
  • Updates the build system to support different versioning profiles for CI/release scenarios

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
version.props Updates version to 1.0.0 and implements profile-based versioning system
global.json Updates SDK configuration for release builds
SourceGeneratorContext/Templates/SourceGeneratorContextAttribute.cs Replaces boolean properties with IncludeFlags enum parameter
SourceGeneratorContext/Templates/IncludeFlags.cs New flags enum defining what context information to include
SourceGeneratorContext/Generator.cs Modernized generator using external library for simplified pipeline management
SourceGeneratorContext/AttributeData.cs New data structure replacing AttributeContext with flag-based configuration
SourceGeneratorContext/CodeGenerator.cs Refactored to use new base class and simplified generation logic
README.md Comprehensive documentation for the new flags-based API

"version": "9.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
"rollForward": "latestFeature"
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing rollForward from 'latestMajor' to 'latestFeature' is more restrictive and may prevent the build from working with newer .NET versions. Consider keeping 'latestMajor' for better forward compatibility, especially for a 1.0.0 release.

Suggested change
"rollForward": "latestFeature"
"rollForward": "latestMajor"

Copilot uses AI. Check for mistakes.
/// <summary>
/// Includes all available details about the source generation context.
/// </summary>
All = ~0U
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ~0U for the All flag creates a magic number that includes all possible bits, including future ones. Consider explicitly defining All as the combination of current flags (e.g., AttributeContextTargetSymbol | AttributeContextTypeSymbol | ...) to avoid unexpected behavior if new flags are added.

Suggested change
All = ~0U
All =
AttributeContextTargetSymbol |
AttributeContextTypeSymbol |
AttributeContextNamedTypeSymbol |
AttributeContextTargetNode |
AttributeContextAttributes |
AttributeContextAllAttributes |
GlobalOptions |
Compilation |
CompilationOptions |
CompilationAssembly |
CompilationReferences |
ParseOptions |
AdditionalTexts |
AdditionalTextsOptions |
MetadataReferences

Copilot uses AI. Check for mistakes.

var cancellationToken = sourceProductionContext.CancellationToken;
cancellationToken.ThrowIfCancellationRequested();
cancellationToken.ThrowIfCancellationRequested(0);
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ThrowIfCancellationRequested method typically doesn't take parameters. This appears to be a custom extension method that may not behave as expected. Verify this is the intended API or use the standard ThrowIfCancellationRequested() method.

Suggested change
cancellationToken.ThrowIfCancellationRequested(0);
cancellationToken.ThrowIfCancellationRequested();

Copilot uses AI. Check for mistakes.
@datacute datacute merged commit c92492e into main Aug 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants