-
Notifications
You must be signed in to change notification settings - Fork 0
添加第一批源生成器辅助方法(那些有争议的暂时还没放进来,慢慢再说吧,先用起来) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 PR introduces the first batch of source generator utility methods for code analysis tools. The changes add a comprehensive set of helper utilities for building and working with source generators in .NET projects.
- Adds core utility classes for source generation including identifier handling, source text building, and embedded file management
- Implements source generator infrastructure with template support and MSBuild property integration
- Sets up project structure with proper packaging configuration for NuGet distribution
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/dotnetCampus.CodeAnalysisUtils/DotNetCampus.CodeAnalysisUtils.csproj | Main project file with analyzer/generator configuration and NuGet packaging setup |
src/dotnetCampus.CodeAnalysisUtils/IdentifierHelper.g.cs | Utility for creating safe C# identifiers from arbitrary strings |
src/dotnetCampus.CodeAnalysisUtils/Generators/Builders/SourceTextBuilder.g.cs | Comprehensive builder for generating C# source code with proper formatting |
src/dotnetCampus.CodeAnalysisUtils/Generators/EmbeddedGenerator.cs | Source generator that processes embedded template files |
src/dotnetCampus.CodeAnalysisUtils/CodeAnalysis/AnalyzerConfigOptionsExtensions.g.cs | Extensions for accessing MSBuild properties in source generators |
src/dotnetCampus.CodeAnalysisUtils/GeneratorInfo.g.cs | Utility for generator metadata and symbol display formatting |
tests/DotNetCampus.CodeAnalysis.Tests/DotNetCampus.CodeAnalysis.Tests.csproj | Test project configuration for debugging source generators |
Directory.Build.props | Solution-wide build configuration and package metadata |
Comments suppressed due to low confidence (1)
src/dotnetCampus.CodeAnalysisUtils/Generators/Builders/SourceTextBuilder.g.cs:1
- The Chinese comment is incomplete. It should be '使其可以在异步上下文中安全地访问、修改和清除' (so that it can be safely accessed, modified and cleared in asynchronous contexts).
#nullable enable
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
来自 https://github.com/dotnet-campus/dotnetCampus.CommandLine 的代码:
能生成下面这样复杂的代码: