Skip to content

[Repo Assist] Split GenerateModel.fs (3232 lines) into focused files#1032

Merged
dsyme merged 2 commits intomainfrom
repo-assist/fix-issue-1022-split-generatemodel-v2-87431813866bbc52
Feb 26, 2026
Merged

[Repo Assist] Split GenerateModel.fs (3232 lines) into focused files#1032
dsyme merged 2 commits intomainfrom
repo-assist/fix-issue-1022-split-generatemodel-v2-87431813866bbc52

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Addresses #1022 (continuing work on splitting large files).

Summary

GenerateModel.fs was a monolithic 3232-line file. This PR splits it into 5 cohesive files with clear responsibilities:

File Lines Contents
ApiDocTypes.fs 708 Utils module, all public ApiDoc* types, ApiDocFileExtensions
CrossReferenceResolver.fs 448 CrossReferences module, CrefReference, CrossReferenceResolver
TypeFormatter.fs 225 TypeFormatter module (FCS type → HTML)
SymbolReader.fs 1621 SymbolReader module (assembly/symbol → API docs model)
GenerateModel.fs 327 ApiDocInput, ApiDocModel, obsolete aliases

Approach

The split follows the natural dependency order in the F# compilation pipeline:

  1. Public types first (no FCS dependencies in their definitions)
  2. Cross-reference resolution (uses public types)
  3. Type formatting (uses cross-reference resolver)
  4. Symbol reading (uses all of the above)
  5. Entry-point model (consumes everything)

Each file uses namespace rec FSharp.Formatting.ApiDocs and includes the necessary open declarations. ApiDocFileExtensions was moved to ApiDocTypes.fs (from the bottom of GenerateModel.fs) to resolve a type inference issue that arose from file ordering.

Test Status

✅ Build succeeds: dotnet build FSharp.Formatting.sln --configuration Release — 0 errors, 0 warnings (excluding pre-existing NU1904 advisory)

✅ All 72 ApiDocs tests pass: dotnet test tests/FSharp.ApiDocs.Tests/FSharp.ApiDocs.Tests.fsproj

✅ Code formatted with Fantomas

Previous Attempt

The previous split PR (#1029) was closed due to a conflict — it was based on a stale main before many PRs landed. This PR is freshly branched from the current main.

Generated by Repo Assist

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@afb00b92a9514fee9a14c583f059a03d05738f70

- ApiDocTypes.fs (708 lines): public API types and Utils module
- CrossReferenceResolver.fs (448 lines): cross-reference resolution
- TypeFormatter.fs (225 lines): FCS type → HTML formatting
- SymbolReader.fs (1621 lines): assembly/symbol reading logic
- GenerateModel.fs (327 lines): ApiDocInput, ApiDocModel, obsolete aliases

All 72 ApiDocs tests pass.

Addresses #1022

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review February 26, 2026 18:26
@dsyme
Copy link
Contributor

dsyme commented Feb 26, 2026

@nojaf Will merge to avoid merge conflicts

@dsyme dsyme merged commit 5408705 into main Feb 26, 2026
4 checks passed
@dsyme dsyme deleted the repo-assist/fix-issue-1022-split-generatemodel-v2-87431813866bbc52 branch February 26, 2026 18:27
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.

1 participant