Skip to content

SourceGenerators: Emit BuildAsync for async assemble - #329

Merged
Skymly merged 1 commit into
mainfrom
feature/generate-builder-build-async
Aug 17, 2026
Merged

SourceGenerators: Emit BuildAsync for async assemble#329
Skymly merged 1 commit into
mainfrom
feature/generate-builder-build-async

Conversation

@Skymly

@Skymly Skymly commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • When [BuilderAssemble] returns Task<T> or ValueTask<T>, emit type-state–gated BuildAsync(CancellationToken cancellationToken = default) instead of Build().
  • Forward at most one assemble CancellationToken (excluded from step binding) and return the assemble task/value-task directly.
  • Report DP086 for bare Task/ValueTask, duplicate assemble, and multiple CancellationToken parameters. Sync assemble still emits only Build().

Related Issue

Closes #326
Relates to #324
Follow-up docs: #327

Solution module

  • SourceGenerators (DesignPatterns.SourceGenerators/)

Type of change

  • Feature
  • Source generator / diagnostic / CodeFix change

Test plan

  • ./build.ps1 --target Ci --configuration Release (or CiPack if packaging changed)
  • Sibling samples (if API/generator behavior changed): clone DesignPatterns.Samples beside this repo and run ./build.ps1 --target Ci — tracked as DesignPatterns.Samples#29, not blocking this PR

Breaking changes

  • None

Checklist

  • This PR touches only one solution module (see AGENTS.md)
  • Commit messages are in English (no AI/agent tooling mentions in commits)
  • PR description is English only — no AI/agent/Cursor tool attribution, no auto-generated summary blocks
  • No version bumps, tags, releases, or NuGet publish steps included unless explicitly requested
  • Public API / diagnostic / generated code changes are documented if user-visible

Documentation checklist

Keep the required-step type-state gate for I/O assemble without a sync-over-async Build.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Autopilot: merge-ready.

  • Mergeable (no conflicts); head is 1 commit ahead of main, 0 behind.
  • Required CI green: build-test, build-test-net48, pack.
  • No unresolved review threads or actionable comments.

Leaving merge to @Skymly.

Open in Web View Automation 

Sent by Cursor Automation: DesignPatterns — Autopilot PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autopilot: merge-ready.

  • Mergeable (no conflicts); head is 1 commit ahead of main, 0 behind.
  • Required CI green: build-test, build-test-net48, pack.
  • No unresolved review threads or actionable comments.

Leaving merge to @Skymly.

Open in Web View Automation 

Sent by Cursor Automation: DesignPatterns — Autopilot PR

@Skymly
Skymly merged commit 88b6a15 into main Aug 17, 2026
4 checks passed
@Skymly
Skymly deleted the feature/generate-builder-build-async branch August 17, 2026 12:03
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.

SourceGenerators: Emit BuildAsync for async assemble + Verify

1 participant