Skip to content

feat: add Partial keyword fluent API for partial classes#8

Merged
fengb3 merged 2 commits into
mainfrom
feat/partial-keyword-api
Apr 13, 2026
Merged

feat: add Partial keyword fluent API for partial classes#8
fengb3 merged 2 commits into
mainfrom
feat/partial-keyword-api

Conversation

@fengb3
Copy link
Copy Markdown
Owner

@fengb3 fengb3 commented Apr 13, 2026

Closes #7. Add Partial property to TypeOption and NamespaceOption, add NestedClass extension on KeywordOptionConfigurator. All 64 tests pass.

Expose the existing Partial keyword through TypeOption and NamespaceOption
properties, and add NestedClass extension on KeywordOptionConfigurator<TypeOption>.
This enables convenient fluent syntax like ns.Partial.Class(...),
ns.Public.Static.Partial.Class(...), and parent.Partial.NestedClass(...).

Closes #7

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 13, 2026 16:05
Copy link
Copy Markdown
Contributor

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 PR adds fluent keyword configurators to make generating partial types more ergonomic (per #7), including support for chaining Partial at the namespace/type level and creating nested partial classes via a keyword configurator extension.

Changes:

  • Add Partial keyword fluent property to TypeOption and NamespaceOption.
  • Add NestedClass(...) extensions on KeywordOptionConfigurator<TypeOption> to support parent.Partial.NestedClass(...)-style chaining.
  • Add new xUnit coverage validating partial class generation in namespaces and nested types.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
EasyCodeBuilder/Csharp/TypeOption.cs Exposes Partial keyword configurator for fluent chains on TypeOption.
EasyCodeBuilder/Csharp/NamespaceOption.cs Exposes Partial keyword configurator for fluent chains when adding types to a namespace.
EasyCodeBuilder/Csharp/OptionConfigurations/OptionConfigurations.cs Adds NestedClass extensions for KeywordOptionConfigurator<TypeOption> so keywords can be applied to nested types.
EasyCodeBuilder.Test/Csharp/PartialKeywordTests.cs Adds tests for Partial fluent API usage in namespaces and nested classes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread EasyCodeBuilder/Csharp/OptionConfigurations/OptionConfigurations.cs Outdated
…ns.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fengb3 fengb3 merged commit 2ee6d17 into main Apr 13, 2026
4 checks passed
@fengb3 fengb3 deleted the feat/partial-keyword-api branch April 13, 2026 16:12
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.

支持 partial 类和 static partial 类的便捷 API

2 participants