Conversation
2d39bc6 to
df47208
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR resolves namespace conflicts by standardizing the interceptor namespace from DotNetCampus.CommandLine.Compiler to DotNetCampus.Cli.Compiler across the build props, code generator, and docs.
- Updated MSBuild properties to point at the new CLI compiler namespace.
- Hardcoded the interceptor generator’s namespace to
DotNetCampus.Cli.Compiler. - Aligned README examples (both Chinese and English) with the renamed namespace.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/DotNetCampus.CommandLine/Package/build/Package.props | Changed <InterceptorsNamespaces> and <InterceptorsPreviewNamespaces> to use the new Cli.Compiler namespace. |
| src/DotNetCampus.CommandLine.Analyzer/Generators/InterceptorGenerator.cs | Replaced dynamic {{GeneratorInfo.RootNamespace}}.Compiler with static DotNetCampus.Cli.Compiler. |
| docs/zh-hans/README.md | Updated example namespace to DotNetCampus.Cli.Compiler. |
| docs/en/README.md | Updated example namespace to DotNetCampus.Cli.Compiler. |
| #nullable enable | ||
|
|
||
| namespace {{GeneratorInfo.RootNamespace}}.Compiler | ||
| namespace DotNetCampus.Cli.Compiler |
There was a problem hiding this comment.
Hardcoding the namespace here removes flexibility for projects that customize the root namespace. Consider constructing it using GeneratorInfo.RootNamespace (e.g., ${GeneratorInfo.RootNamespace}.Compiler) to keep it in sync with the project’s actual root namespace.
| namespace DotNetCampus.Cli.Compiler | |
| namespace {{GeneratorInfo.RootNamespace}}.Compiler |
| <PropertyGroup> | ||
| <DotNetCampusCommandLineUseInterceptor Condition="'$(DotNetCampusCommandLineUseInterceptor)' == ''">true</DotNetCampusCommandLineUseInterceptor> | ||
| <InterceptorsNamespaces>$(InterceptorsNamespaces);DotNetCampus.CommandLine.Compiler</InterceptorsNamespaces> | ||
| <InterceptorsNamespaces>$(InterceptorsNamespaces);DotNetCampus.Cli.Compiler</InterceptorsNamespaces> |
There was a problem hiding this comment.
The DotNetCampus.Cli.Compiler string is duplicated in both InterceptorsNamespaces and InterceptorsPreviewNamespaces. Consider defining a single MSBuild property for the CLI compiler namespace to avoid repetition and simplify future updates.
| <InterceptorsNamespaces>$(InterceptorsNamespaces);DotNetCampus.Cli.Compiler</InterceptorsNamespaces> | |
| <DotNetCampusCliCompilerNamespace>DotNetCampus.Cli.Compiler</DotNetCampusCliCompilerNamespace> | |
| <InterceptorsNamespaces>$(InterceptorsNamespaces);$(DotNetCampusCliCompilerNamespace)</InterceptorsNamespaces> |
Fix #52