-
-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance method header generation to include location type #30
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
WalkthroughReplaced a previously implicit expression-type mechanism with an abstract Changes
Sequence Diagram(s)(omitted — changes are localized to documentation emission and small overrides; no new runtime control flow to visualize) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧬 Code graph analysis (1)src/Linqraft.SourceGenerator/SelectExprInfoAnonymous.cs (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Linqraft.SourceGenerator/SelectExprInfo.cs (2)
139-140: Consider handling edge cases in path parsing.While the current implementation using
Split(['/', '\\']).Last()works for typical paths, it could return an empty string if the path ends with a separator. Consider a more defensive approach:Apply this diff for more robust filename extraction:
- var displayLocationRaw = location.GetDisplayLocation(); - var locationFileOnly = displayLocationRaw.Split(['/', '\\']).Last(); + var displayLocationRaw = location.GetDisplayLocation(); + var locationFileOnly = displayLocationRaw.Split(['/', '\\'], StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? displayLocationRaw;This ensures that even with trailing separators or edge cases, a meaningful location is always shown.
133-148: Optional: Consider using constants for type identifiers.The type identifiers ("anonymous", "explicit", "predefined") are currently hardcoded strings across multiple files. While functional, defining them as constants would improve maintainability and prevent typos:
Add constants to the base class:
protected const string TypeAnonymous = "anonymous"; protected const string TypeExplicit = "explicit"; protected const string TypePredefined = "predefined";Then update call sites to use
TypeAnonymous,TypeExplicit, andTypePredefinedrespectively. Given the small number of call sites (3) and stability of these values, this is purely a nice-to-have improvement.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/Linqraft.SourceGenerator/SelectExprInfo.cs(1 hunks)src/Linqraft.SourceGenerator/SelectExprInfoAnonymous.cs(1 hunks)src/Linqraft.SourceGenerator/SelectExprInfoExplicitDto.cs(1 hunks)src/Linqraft.SourceGenerator/SelectExprInfoNamed.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/Linqraft.SourceGenerator/SelectExprInfoAnonymous.cs (1)
src/Linqraft.SourceGenerator/SelectExprInfo.cs (1)
GenerateMethodHeaderPart(133-148)
src/Linqraft.SourceGenerator/SelectExprInfoNamed.cs (1)
src/Linqraft.SourceGenerator/SelectExprInfo.cs (1)
GenerateMethodHeaderPart(133-148)
src/Linqraft.SourceGenerator/SelectExprInfoExplicitDto.cs (1)
src/Linqraft.SourceGenerator/SelectExprInfo.cs (1)
GenerateMethodHeaderPart(133-148)
🔇 Additional comments (5)
src/Linqraft.SourceGenerator/SelectExprInfoAnonymous.cs (1)
48-48: LGTM! Call site correctly updated.The call to
GenerateMethodHeaderPartnow includes the type identifier "anonymous", which aligns with the updated signature and provides clearer context in generated documentation.src/Linqraft.SourceGenerator/SelectExprInfoNamed.cs (1)
53-53: LGTM! Call site correctly updated.The call to
GenerateMethodHeaderPartnow includes the type identifier "predefined", which is appropriate for named/predefined types and maintains consistency with the other variants.src/Linqraft.SourceGenerator/SelectExprInfoExplicitDto.cs (1)
172-172: LGTM! Call site correctly updated.The call to
GenerateMethodHeaderPartnow includes the type identifier "explicit", appropriately distinguishing this variant in the generated documentation.src/Linqraft.SourceGenerator/SelectExprInfo.cs (2)
133-137: LGTM! Method signature appropriately extended.The addition of the
typeparameter enables clearer documentation by distinguishing between method variants. All call sites across the derived classes have been correctly updated.
141-147: LGTM! Documentation format enhanced as intended.The updated XML summary now includes the type identifier (anonymous/explicit/predefined) and displays only the filename instead of the full path, which improves readability while maintaining sufficient context for debugging.
feat: add workflow to verify NuGet package installation and functionality (#29) docs: update C# version requirements and remove Polysharp references in README files docs: update C# version requirements and add details on language features in README files Enhance method header generation to include location type (#30) * feat: enhance method header generation to include location type in SelectExpr records * feat: add expression type string for documentation in SelectExpr records chore: remove branch restrictions from NuGet package verification workflow fix: update descendant node retrieval to include the current node in HasNullableAccess method fix: enable locked mode for dotnet restore in workflow files refactor: streamline NuGet package verification workflow by consolidating directory creation and file copying steps refactor: remove unnecessary TargetFrameworks from project files refactor: remove Windows from build matrix due to performance issues chore: Separate core functionalities into Linqraft.Core project (#31) * chore: Separate core functionalities from SourceGenerator project into Linqraft.Core project * feat: add GetExprTypeString method for documentation of anonymous expression types * chore: disable documentation file generation in Directory.Build.props fix: add missing comma and restore additionalVersions in devcontainer.json fix: add missing PropertyGroup for DevelopmentDependency in Linqraft.csproj close #35 fix: remove PolySharp package reference from Directory.Build.props Revert "fix: add missing PropertyGroup for DevelopmentDependency in Linqraft.csproj" This reverts commit 7916999. Revert "fix: add missing comma and restore additionalVersions in devcontainer.json" This reverts commit 8a386ab. Reapply "fix: add missing comma and restore additionalVersions in devcontainer.json" This reverts commit 1743adc. Reapply "fix: add missing PropertyGroup for DevelopmentDependency in Linqraft.csproj" This reverts commit ad3f14a. Revert "fix: remove PolySharp package reference from Directory.Build.props" This reverts commit 5b1a189. fix: add PolySharp package reference and update LangVersion instructions in README files fix: update generic type parameters in SelectExpr methods for consistency fix: update build instructions to ensure a clean build without incremental compilation fix: add clean-test.sh script for easier test cleanup and build process fix: update SelectExpr method signatures for consistency across implementations close #33 fix: change Issue33_SealedPatternTest class to partial for extensibility fix: refactor DummyExpression class and update SelectExpr method summaries for clarity (#38)
Improve the method header generation by adding the location type to the SelectExpr records, providing clearer context in the generated documentation.
Summary by CodeRabbit
Refactor
Documentation