Skip to content

[Repo Assist] Split XmlDocReader out of SymbolReader.fs#1073

Merged
dsyme merged 3 commits intomainfrom
repo-assist/fix-issue-1022-split-symboldocreader-23573bfba5b6339f
Mar 8, 2026
Merged

[Repo Assist] Split XmlDocReader out of SymbolReader.fs#1073
dsyme merged 3 commits intomainfrom
repo-assist/fix-issue-1022-split-symboldocreader-23573bfba5b6339f

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Mar 8, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant, in response to a /repo-assist command from @dsyme on #1022.

Closes (partial progress on) #1022


Summary

SymbolReader.fs was 1703 lines. This PR extracts the XML and Markdown documentation comment reading helpers (~440 lines) into a new, focused XmlDocReader.fs, reducing SymbolReader.fs to 1263 lines.

What moved into XmlDocReader.fs

These functions form a coherent unit — they convert raw XML doc comments and Markdown doc comments into ApiDocComment/ApiDocHtml values — and have no dependency on ReadingContext. They only need CrossReferenceResolver and the ApiDoc* public types:

Function Purpose
removeSpaces Normalise indentation in doc comment text
readMarkdownCommentAsHtml Parse a LiterateDocument into ApiDocComment
findCommand Detect [key:value] commands in comment text
readXmlElementAsSingleSummary Wrap multiline <summary> in <pre>
readXmlElementAsHtml Recursively render XML doc elements to HTML
SummaryWithoutChildren Active pattern for leaf <summary> elements
readXmlCommentAsHtmlAux Core XML → ApiDocComment conversion
readXmlCommentAsHtml / readNamespaceDocs Mutually-recursive entry points
combineHtml / combineHtmlOptions / combineComments / combineNamespaceDocs Merge comments from inherited / partial definitions

File sizes before/after

File Before After
SymbolReader.fs 1703 lines 1263 lines
XmlDocReader.fs 458 lines (new)

The remaining content of SymbolReader.fs is: ReadingContext, the member/field/union-case readers, the inline-code link-wrapping helpers, comment-and-command readers (readCommentAndCommands, readCommentsInto), and the entity/namespace/assembly readers.

Test Status

Generated by Repo Assist for issue #1022 ·

To install this agentic workflow, run

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

Extract XML and Markdown documentation comment reading helpers
(~440 lines) into a new XmlDocReader.fs file. These functions form
a coherent unit (XML → ApiDocComment conversion) that does not
depend on ReadingContext; they only need CrossReferenceResolver
and the ApiDoc* types.

- New: src/FSharp.Formatting.ApiDocs/XmlDocReader.fs
  - removeSpaces
  - readMarkdownCommentAsHtml
  - findCommand
  - readXmlElementAsSingleSummary / readXmlElementAsHtml
  - readXmlCommentAsHtmlAux / readXmlCommentAsHtml / readNamespaceDocs
  - combineHtml / combineHtmlOptions / combineComments / combineNamespaceDocs
- Modified: SymbolReader.fs shrinks from 1703 → 1263 lines

Part of #1022.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 8, 2026 15:38
@dsyme dsyme merged commit b942f68 into main Mar 8, 2026
2 checks passed
@dsyme dsyme deleted the repo-assist/fix-issue-1022-split-symboldocreader-23573bfba5b6339f branch March 8, 2026 15:38
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.

Split large files across the repository

1 participant