-
Notifications
You must be signed in to change notification settings - Fork 1
feat(v1.7): [ExtractProperty] and [WrapProperty] for entity↔primitive mapping (#127) #138
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
a294bd2
docs: implementation plan for v1.7 Feature 3 ([ExtractProperty]/[Wrap…
superyyrrzz c99f3e5
feat(v1.7): add [ExtractProperty] and [WrapProperty] attributes
superyyrrzz ebfe281
feat(v1.7): register FM0065-FM0071, FM0074 diagnostics for ExtractPro…
superyyrrzz 82f6159
feat(v1.7): add attribute-symbol fields and detection helpers for Ext…
superyyrrzz dd04e21
feat(v1.7): scaffold ExtractWrap module with FM0065 and FM0070 valida…
superyyrrzz baad397
feat(v1.7): emit [ExtractProperty] body with null-guard and built-in …
superyyrrzz 3fe14ef
feat(v1.7): emit [WrapProperty] body with strategy selection and tie-…
superyyrrzz 07d253d
feat(v1.7): dispatch [ExtractProperty]/[WrapProperty] from GenerateMe…
superyyrrzz 03eb234
test(v1.7): cover [ExtractProperty]/[WrapProperty] across diagnostics…
superyyrrzz ca080f4
chore(v1.7): mark Features 1 and 3 as implemented in spec status table
superyyrrzz 9d92037
fix(v1.7): tighten extract/wrap accessor checks and add DateTime→Date…
superyyrrzz 7924ead
fix(v1.7): force UTC kind in DateTime→DateTimeOffset wrap to mirror e…
superyyrrzz c6ee1db
fix(v1.7): support nullable DateTime↔DateTimeOffset in wrap coercion …
superyyrrzz 224bde3
fix(v1.7): walk inheritance chain in extract/wrap property and requir…
superyyrrzz c504243
fix(v1.7): handle Nullable<T> source in extract/wrap, required fields…
superyyrrzz c0ad400
chore: remove stray scratch files accidentally committed
superyyrrzz 45ccc13
fix(v1.7): respect StringToEnum config and short-circuit on FM0013 am…
superyyrrzz d561d5c
fix(v1.7): don't suppress required-member check by ctor param name
superyyrrzz 2575248
fix(v1.7): honor [ForgeConstructor] in WrapProperty ctor selection
superyyrrzz 8f7560d
docs(diagnostics): clarify FM0068 message to describe wrap-strategy v…
superyyrrzz 6d62503
docs(analyzer-releases): sort FM* rule IDs in ascending order
superyyrrzz 26a3b10
fix(v1.7): clarify FM0065, hard-fail [ForgeConstructor] mismatch, doc…
superyyrrzz 3cc253f
fix(v1.7): emit FM0068/FM0069 when [ForgeConstructor] mismatches wrap…
superyyrrzz 6ebab48
fix(v1.7): defer ctor selection when initializer wrap path is viable
superyyrrzz 2b29529
test(v1.7): regression test for [ForgeConstructor()] + viable wrap in…
superyyrrzz b8e3260
fix(v1.7): emit FM0069 (not FM0068) when wrap ctor param exists with …
superyyrrzz e36a226
fix(v1.7): reject abstract destinations in [WrapProperty] with FM0068
superyyrrzz a0e82d3
fix(wrap): honor parameterized [ForgeConstructor] and validate other-…
superyyrrzz e31bd45
fix(wrap): explicit parameterized [ForgeConstructor] never silently f…
superyyrrzz b1689be
chore: remove stray Copilot CLI scratch files
superyyrrzz ebb7e84
fix(wrap): init strategy must verify type compat with named property
superyyrrzz 3b5ee50
fix(wrap): trust [SetsRequiredMembers] on parameterless ctor for init…
superyyrrzz e4974d7
fix(extract): emit FM0007 when Nullable<T> property maps to non-nulla…
superyyrrzz 6d591ac
fix(extract/wrap): suppress FM0074 for Nullable<T> returns; clarify F…
superyyrrzz 2d2ca4a
fix(extract-wrap): accept set-only init targets and route empty [Forg…
superyyrrzz d3d23ed
fix(extract-wrap): scope FM0069 ctor scan to honor explicit [ForgeCon…
superyyrrzz 1aa4712
fix(extract-wrap): exclude non-viable ctors from FM0069 type-mismatch…
superyyrrzz 49e1f99
fix(extract): emit FM0007 for nullable-reference → non-nullable-refer…
superyyrrzz 5953cdc
fix(generator): reject interface destinations in WrapProperty as FM0068
superyyrrzz 6944538
fix(generator): emit FM0066/FM0068 for null/empty Extract/Wrap proper…
superyyrrzz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,636 changes: 1,636 additions & 0 deletions
1,636
docs/superpowers/plans/2026-04-21-v1.7-extract-wrap-property.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| using System; | ||
|
|
||
| namespace ForgeMap; | ||
|
|
||
| /// <summary> | ||
| /// Marks a partial forge method that returns a single property of the source object. | ||
| /// The method must have signature <c>partial TPrimitive MethodName(TEntity source)</c>. | ||
| /// The generator emits a null-guard governed by <c>NullHandling</c>, then returns | ||
| /// <c>source.PropertyName</c> (with built-in coercion if needed for the declared return type). | ||
| /// Available in ForgeMap v1.7+. | ||
| /// </summary> | ||
| [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] | ||
| public sealed class ExtractPropertyAttribute : Attribute | ||
| { | ||
| /// <summary> | ||
| /// Creates a new <see cref="ExtractPropertyAttribute"/>. | ||
| /// </summary> | ||
| /// <param name="propertyName">Name of the readable instance property on the source type to return.</param> | ||
| public ExtractPropertyAttribute(string propertyName) | ||
| { | ||
| PropertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName)); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the name of the source property to extract. | ||
| /// </summary> | ||
| public string PropertyName { get; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| using System; | ||
|
|
||
| namespace ForgeMap; | ||
|
|
||
| /// <summary> | ||
| /// Marks a partial forge method that constructs a new destination object from the source primitive | ||
| /// by assigning or binding it to the named property. The method must have signature | ||
| /// <c>partial TEntity MethodName(TPrimitive source)</c>. The destination type must either expose a | ||
| /// settable (<c>set</c> or <c>init</c>) property of that name or a constructor parameter of that name. | ||
| /// The generator emits the appropriate construction form (<c>new TEntity { Prop = source }</c> or | ||
| /// <c>new TEntity(prop: source)</c>), with null-guarding governed by <c>NullHandling</c>. | ||
| /// Available in ForgeMap v1.7+. | ||
| /// </summary> | ||
| [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] | ||
| public sealed class WrapPropertyAttribute : Attribute | ||
| { | ||
| /// <summary> | ||
| /// Creates a new <see cref="WrapPropertyAttribute"/>. | ||
| /// </summary> | ||
| /// <param name="propertyName">Name of the destination property or constructor parameter to assign.</param> | ||
| public WrapPropertyAttribute(string propertyName) | ||
| { | ||
| PropertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName)); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the name of the destination property or constructor parameter to assign. | ||
| /// </summary> | ||
| public string PropertyName { get; } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.