Skip to content

[Repo Assist] Add regression test: type with same name as namespace appears in API docs (issue #944)#1092

Merged
dsyme merged 3 commits intomainfrom
repo-assist/fix-issue-944-same-name-type-namespace-regression-4b3f21f63a669691
Mar 14, 2026
Merged

[Repo Assist] Add regression test: type with same name as namespace appears in API docs (issue #944)#1092
dsyme merged 3 commits intomainfrom
repo-assist/fix-issue-944-same-name-type-namespace-regression-4b3f21f63a669691

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist.

Closes #944

Problem

Issue #944 reports that types whose name equals their enclosing namespace (e.g., type AvalonLog.AvalonLog inside namespace AvalonLog) are missing from generated API documentation. No one has confirmed whether this was ever fixed or is environment-specific.

What This PR Does

  1. Adds a minimal test library tests/FSharp.ApiDocs.Tests/files/SameNameLib/ with:

    • A single F# file declaring namespace SameNameLib and type SameNameLib(value: string)
    • A project file targeting netstandard2.1 (matching other test libraries)
  2. Adds a regression test ApiDocs includes type whose name matches its namespace (issue 944) that:

    • Loads SameNameLib.dll through ApiDocs.GenerateModel
    • Asserts the SameNameLib namespace is present
    • Asserts the SameNameLib type is present within that namespace
    • Asserts the URL base name for the type is non-empty (confirming it has a distinct page URL)

Findings

The test passes on the current codebase — meaning the bug reported in #944 is not present in the current version of FSharp.Formatting. This could mean:

  • The bug was fixed incidentally by a previous change, or
  • It was specific to the user's environment / library structure (e.g., a C# library or a particular F# pattern)

Either way, the test now serves as a regression guard: if a future change accidentally breaks same-name entity handling, CI will catch it.

Test Status

  • ✅ Build: dotnet build FSharp.Formatting.sln --configuration Release — succeeded (0 errors, 1 pre-existing FS0760 warning)
  • ✅ Tests: 88 passed, 4 skipped, 0 failed (was 87 before; +1 new test)
  • ✅ Format: dotnet fantomas tests/FSharp.ApiDocs.Tests/ApiDocsTests.fs — applied, no further changes needed

Files Changed

File Change
tests/FSharp.ApiDocs.Tests/files/SameNameLib/SameNameLib.fsproj New test library project
tests/FSharp.ApiDocs.Tests/files/SameNameLib/Library.fs New: type SameNameLib inside namespace SameNameLib
tests/FSharp.ApiDocs.Tests/FSharp.ApiDocs.Tests.fsproj Add ProjectReference to SameNameLib
FSharp.Formatting.sln Add SameNameLib project to solution
tests/FSharp.ApiDocs.Tests/ApiDocsTests.fs Add regression test
RELEASE_NOTES.md Add entry under [Unreleased]

Generated by Repo Assist ·

To install this agentic workflow, run

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

…docs (issue #944)

Adds a minimal test library `SameNameLib` with a single type named
`SameNameLib.SameNameLib` (type name = namespace name), and a test
that verifies the type is correctly included in the generated API docs.

The test confirms that the bug reported in #944 is not present in the
current codebase — the type appears in the namespace's entity list with
a non-empty URL base name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 14, 2026 12:21
@dsyme dsyme merged commit d314437 into main Mar 14, 2026
2 checks passed
@dsyme dsyme deleted the repo-assist/fix-issue-944-same-name-type-namespace-regression-4b3f21f63a669691 branch March 14, 2026 12:22
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.

Missing types in generated API

1 participant