Skip to content

[Repo Assist] Refactor: move resolveCaseIdent to GeneratorHelpers — closes #244#245

Open
github-actions[bot] wants to merge 5 commits intomasterfrom
repo-assist/fix-issue-244-resolve-case-ident-helper-6b915e96232c0348
Open

[Repo Assist] Refactor: move resolveCaseIdent to GeneratorHelpers — closes #244#245
github-actions[bot] wants to merge 5 commits intomasterfrom
repo-assist/fix-issue-244-resolve-case-ident-helper-6b915e96232c0348

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Mar 7, 2026

🤖 This is an automated pull request from Repo Assist.

Summary

Moves the resolveCaseIdent helper (which builds a fully-qualified DU case SynLongIdent when RequireQualifiedAccess is in effect) from DUCasesGenerator into GeneratorHelpers, and replaces the equivalent inline logic in LensesGenerator with a call to the shared helper.

Closes #244

Root Cause

DUCasesGenerator.fs defined a named helper resolveCaseIdent, while LensesGenerator.fs re-implemented the exact same logic inline as matchCaseIdentParts. Any future change to qualified-access case name resolution had to be applied in two places, risking silent divergence.

Fix

  • GeneratorHelpers.fs — added resolveCaseIdent (requiresQualifiedAccess) (parent) (id) returning a SynLongIdent
  • DUCasesGenerator.fs — removed the local resolveCaseIdent definition; updated call sites to GeneratorHelpers.resolveCaseIdent
  • LensesGenerator.fs — replaced the inline matchCaseIdentParts block with a single call to GeneratorHelpers.resolveCaseIdent

Trade-offs

None — pure refactor with no behaviour change. Both generators produce identical output before and after.

Test Status

dotnet build src/Myriad.Plugins/Myriad.Plugins.fsproj — succeeded, 0 warnings, 0 errors
✅ Integration tests (Myriad.IntegrationPluginTests) — all passed, 0 failed, 0 errored

Generated by Repo Assist

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@ee49512da7887942965ac0a0e48357106313c9dd. View source at https://github.com/githubnext/agentics/tree/ee49512da7887942965ac0a0e48357106313c9dd/workflows/repo-assist.md.

…ication

DUCasesGenerator and LensesGenerator both had the same logic for resolving
a DU case identifier (qualifying with parent type name when RequireQualifiedAccess
is present). Move the shared implementation to GeneratorHelpers.resolveCaseIdent
and update both generators to call it.

Closes #244

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

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

Refactors Myriad.Plugins generators to centralize DU case identifier qualification logic (handling RequireQualifiedAccess) into a shared helper, eliminating duplicated implementations across generators (closes #244).

Changes:

  • Added GeneratorHelpers.resolveCaseIdent to build a fully-qualified SynLongIdent for DU cases when qualified access is required.
  • Updated DUCasesGenerator to use the shared helper and removed its local implementation.
  • Updated LensesGenerator to replace inline qualification logic with the shared helper.

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 Introduces shared resolveCaseIdent helper used by multiple generators.
src/Myriad.Plugins/DUCasesGenerator.fs Removes duplicated helper and routes DU case name resolution through GeneratorHelpers.
src/Myriad.Plugins/LensesGenerator.fs Replaces inline DU case qualification logic with GeneratorHelpers.resolveCaseIdent.

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

@7sharp9
Copy link
Copy Markdown
Collaborator

7sharp9 commented Mar 11, 2026

@copilot Can you resolve the merge conflicts please.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

@7sharp9 I've opened a new pull request, #261, to work on those changes. Once the pull request is ready, I'll request review from you.

…CaseMatchClause

Co-authored-by: 7sharp9 <588746+7sharp9@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

🤖 This is an automated response from Repo Assist.

This PR has been superseded and can be safely closed.

The same fix — moving resolveCaseIdent from DUCasesGenerator into GeneratorHelpers and replacing the inline matchCaseIdentParts logic in LensesGenerator — was independently implemented by Copilot and merged via PR #253 on 2026-03-11.

GeneratorHelpers.resolveCaseIdent is now in master. There is nothing left to merge here, and this branch has conflicts with master. No action needed beyond closing this PR.

Generated by Repo Assist

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@ee49512da7887942965ac0a0e48357106313c9dd. View source at https://github.com/githubnext/agentics/tree/ee49512da7887942965ac0a0e48357106313c9dd/workflows/repo-assist.md.

7sharp9 and others added 2 commits March 14, 2026 16:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Resolve merge conflicts with master; rename `indent` → `ident` in `createCaseMatchClause`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate Code: resolveCaseIdent Logic Duplicated Across DUCasesGenerator and LensesGenerator

3 participants