Skip to content

Refactor: move resolveCaseIdent to GeneratorHelpers, eliminating duplication across generators#259

Open
Copilot wants to merge 3 commits into
masterfrom
copilot/review-activity-march-2026
Open

Refactor: move resolveCaseIdent to GeneratorHelpers, eliminating duplication across generators#259
Copilot wants to merge 3 commits into
masterfrom
copilot/review-activity-march-2026

Conversation

Copilot AI commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

resolveCaseIdent (which qualifies DU case identifiers when RequireQualifiedAccess is present) was duplicated — once as a named function in CreateDUModule and once as inline logic in LensesGenerator. This consolidates it into GeneratorHelpers.

Changes

  • GeneratorHelpers.fs: Add resolveCaseIdent (requiresQualifiedAccess: bool) (parent: LongIdent) (id: Ident) : SynLongIdent helper
  • DUCasesGenerator.fs: Remove local resolveCaseIdent from CreateDUModule; update two call sites to GeneratorHelpers.resolveCaseIdent
  • LensesGenerator.fs: Replace inline matchCaseIdentParts + SynLongIdent.Create with GeneratorHelpers.resolveCaseIdent
// Before — DUCasesGenerator.fs (local copy)
let resolveCaseIdent (requiresQualifiedAccess: bool) (parent: LongIdent) (id: Ident) : SynLongIdent = ...

// Before — LensesGenerator.fs (inline)
let matchCaseIdentParts =
    if requiresQualifiedAccess then (parent |> List.map _.idText) @ [id.idText]
    else [id.idText]
let fullCaseName = SynLongIdent.Create matchCaseIdentParts

// After — both sites
let fullCaseName = GeneratorHelpers.resolveCaseIdent requiresQualifiedAccess parent id
Original prompt

This section details on the original issue you should resolve

<issue_title>[Repo Assist] Monthly Activity 2026-03</issue_title>
<issue_description>🤖 Repo Assist here — I'm an automated AI assistant for this repository.

Activity for March 2026

Suggested Actions for Maintainer

Comprehensive list of all pending actions requiring maintainer attention:

Future Work for Repo Assist

Run History

2026-03-11 10:06 UTC — Run

2026-03-10 10:07 UTC — Run

2026-03-09 10:11 UTC — Run

2026-03-08 09:50 UTC — Run


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…251

Co-authored-by: 7sharp9 <588746+7sharp9@users.noreply.github.com>
Copilot AI changed the title [WIP] Review pending pull requests for March 2026 Refactor: move resolveCaseIdent to GeneratorHelpers, eliminating duplication across generators Mar 11, 2026
@7sharp9 7sharp9 marked this pull request as ready for review March 14, 2026 16:57
Copilot AI review requested due to automatic review settings March 14, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Consolidates duplicated DU-case identifier qualification logic (handling RequireQualifiedAccess) into GeneratorHelpers.resolveCaseIdent, and updates generators to use the shared helper to keep behavior consistent across plugins.

Changes:

  • Added GeneratorHelpers.resolveCaseIdent to centralize DU case SynLongIdent construction.
  • Updated DUCasesGenerator to remove the local helper and call GeneratorHelpers.resolveCaseIdent.
  • Updated LensesGenerator to replace inline case-name construction with GeneratorHelpers.resolveCaseIdent.

Reviewed changes

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

File Description
src/Myriad.Plugins/GeneratorHelpers.fs Adds shared resolveCaseIdent helper for qualified DU case identifiers.
src/Myriad.Plugins/DUCasesGenerator.fs Removes local duplication and switches call sites to the shared helper.
src/Myriad.Plugins/LensesGenerator.fs Replaces inline RequireQualifiedAccess case-name logic with shared helper call.

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

Comment thread src/Myriad.Plugins/DUCasesGenerator.fs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment