[repo-assist] Support top-level (seealso) XML doc tags in API docs - #1264
Open
github-actions[bot] wants to merge 1 commit into
Open
[repo-assist] Support top-level (seealso) XML doc tags in API docs#1264github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Renders a 'See also' section (list of links) for members and entities that have top-level <seealso cref="..."/> XML doc tags, per the xmldoc recommended-tags convention. Previously these tags were silently ignored. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant, in response to a
/repo-assistcommand from@dsymeon issue #1256.Closes #1256
Root cause
Per the [xmldoc recommended tags]((learn.microsoft.com/redacted),
<seealso cref="..."/>is meant to be a top-level doc-comment section (distinct from the inline<see cref="..."/>tag). FSharp.Formatting's XML doc reader (XmlDocReader.fs) only handled<seealso>as an inline tag (identically to<see>), so top-level<seealso>elements were silently dropped and never rendered.Fix
SeeAlso: (string * string option * ApiDocHtml) listmember toApiDocComment, modeled on the existingExceptionsfield.XmlDocReader.readXmlCommentAsHtmlAuxnow collects direct-child<seealso>elements (resolvingcrefvia the existing cross-reference resolver, same as<exception cref="...">), and excludes them from the generic "unrecognised tag" raw-data bucket.combineCommentsnow mergesSeeAlsolists when doc comments are combined.GenerateHtml.fsandGenerateMarkdown.fsrender a "See also" section (as a bullet/list of links) for members and entities that have one or more top-level<seealso>tags, following the existing rendering style used forNotes/Examples.Inline
<see cref="..."/>behavior (and the pre-existing inline handling of<seealso>embedded in running text) is unchanged.Trade-offs / notes
<seealso>elements of the member/type doc comment are treated as a top-level section; a<seealso>nested inside<para>/<summary>etc. still falls back to inline rendering (same as<see>), which matches how<exception>is already handled.FSharp.Formatting.ApiDocs.Test Status
dotnet build src/FSharp.Formatting.ApiDocs/... -c Release,dotnet build tests/FSharp.ApiDocs.Tests/... -c Release)ApiDocs Markdown generates See also section for top-level seealso tags,ApiDocs HTML generates See also section for top-level seealso tags) exercising a newSeeAlsoExamplesmodule added to theFsLib2test fixture.FSharp.ApiDocs.Testssuite: 90 passed, 0 failed, 4 skipped (pre-existing skips, unrelated to this change)dotnet fantomas src tests --check— no formatting issuesAs always, a human maintainer should review before merging. Thanks for reporting,
@Tarmil!Add this agentic workflow to your repo
To install this agentic workflow, run