[Repo Assist] fix: handle href and langword in seealso XML doc rendering#1463
Merged
Krzysztof-Cieslak merged 2 commits intomainfrom Feb 24, 2026
Merged
Conversation
The seealso section in tooltip/hover documentation incorrectly assumed all <seealso> tags use cref attributes, directly accessing Attributes.[0] without checking the attribute name. This could produce wrong output for <seealso href="url"/> tags and crashes if no attributes are present. Fix mirrors the behaviour of the <see> formatter: - cref: render as backtick-wrapped member name (unchanged) - href: render as a markdown link [text](url) or [url](url) - langword: render as inline code (consistent with <see langword="..."/>) - no recognised attribute: skip silently via Seq.choose Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Pull request created: #1463 |
Member
|
/repo-assist add tests to this PR |
…ord) Tests cover all four attribute variants handled by the fix in TipFormatter.fs: - cref renders as backtick-quoted member name - href (void) renders as auto-link - href (with inner text) renders as labelled Markdown link - langword renders as backtick-quoted keyword - unrecognised attribute is silently skipped (no garbled output) - multiple seealso entries all appear together Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Commit pushed:
|
Contributor
Author
|
🤖 This is an automated response from Repo Assist. I've added unit tests to this PR covering the
All 6 tests pass against the fixed code (and would fail against the old Test run:
|
24 tasks
github-actions bot
added a commit
that referenced
this pull request
Feb 24, 2026
Include all PRs merged since v0.83.0: - #1441: Fix SourceLink go-to-def failure on .NET 10 on Linux - #1452: Add FSharp.notifications.backgroundServiceProgress config option - #1449: Fix semantic token multiline range uint32 underflow - #1453: Fix spurious get/set rename in TextDocumentRename - #1454: Fix missing { interpolated string completion trigger - #1455: Fix non-ASCII path encoding in file URIs - #1456: Disable inline values by default to restore pipeline hints - #1457: Fix missing parens in function-type segments in AddExplicitTypeAnnotation - #1458: Fix signature help parameter types showing fully-qualified names - #1463: Fix seealso href/langword XML doc rendering 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.
Summary
Improves rendering of
(seealso)XML documentation tags in hover tooltips and documentation panels. The current code assumes every(seealso)node uses acrefattribute and accessesAttributes.[0]directly, which can produce wrong output or silently skip entries whenhrefis used.Root Cause
In
TipFormatter.fs, theseeAlsobinding uses aSeq.mapthat directly accessesnode.Attributes.[0].InnerTextwithout checking the attribute name:This works fine for
(seealso cref="T:Foo.Bar"/), but:(seealso href="(example.com/redacted)"/)renders the URL throughextractMemberText(which strips type-prefixes, e.g.T:) — wrong output(seealso href="(example.com/redacted)")Click here(/seealso)— same problem, inner text ignored(seealso langword="null"/)— rendered as a cref member name — wrong outputBy contrast, the inline
(see)formatter (also inTipFormatter.fs) already handleshref,cref, andlangwordcorrectly via named attribute lookups. Theseealsosection had fallen behind.Fix
Replace the
Seq.mapwith aSeq.choosethat inspects attribute names explicitly, mirroring theseeformatter's behaviour:cref→* `MemberText`(unchanged from current behaviour)href(with inner text) →* [inner text](url)href(void element) →* [url](url)langword→* `keyword`Test Status
dotnet build src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj -f net8.0succeeded with 0 warnings, 0 errors.dotnet fantomasreportsTipFormatter.fs was unchanged(code already matches fantomas style).seeAlsosequence expression insideXmlDocMember; it only adds properhref/langwordhandling and silently skips unrecognised nodes rather than crashing.Related
Partially addresses #1027 (see and seealso should render as links/commands) — this PR specifically fixes the
seealso hrefandlangwordcases. Full command-URI support forcrefentries is a larger task left for a follow-up.