Conversation
…tributes Resolves unqualified cref patterns that the F# compiler emits without the standard XML doc prefix (T:/M:/P:), and also partial type-qualified members that the compiler emits with a prefix but without a namespace. Changes to CrossReferenceResolver.fs: - Add stripGenericSuffix helper that strips backtick/angle-bracket suffixes - In resolveCrossReferenceForTypeByXmlSig: when both xmlDocNameToSymbol and niceNameEntityLookup lookups fail for a T: sig, check if typeName contains a dot (Type.Member pattern) and try niceNameEntityLookup with raw/stripped name - Add tryResolveUnqualifiedCref for crefs with no XML prefix (plain type names and Type.Member patterns via niceNameEntityLookup) - In tryResolveCrossReferenceForMemberByXmlSig: fall back to niceNameEntityLookup using both raw and stripped simple type name when full XML sig lookup fails Test additions: - Class9: unqualified type cref '<see cref="Class2" />' - Class10: unqualified Type.Member crefs '<see cref="Class2.Other" />' - Class11: generic type/member crefs '<see cref="GenericClass2`1.Property" />' - Uncomment previously-commented URL resolution test for Class1 Closes #605 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
approved these changes
Feb 26, 2026
nojaf
approved these changes
Feb 27, 2026
12 tasks
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. It implements the changes requested via
/repo-assist implement this pleaseon #605.Summary
Implements more tolerant resolution of
(see cref="...")attributes in API doc comments, addressing the scenarios described in #605.Problem
The F# compiler often can't resolve cross-references to types/members in XML doc comments without the full namespace, so it emits unqualified crefs like:
(see cref="MyType" /)(noT:prefix)(see cref="MyType.MyMember" /)(no prefix, member reference)(see cref="GenericClass21.Property" /)` (no namespace)Previously, these all fell through to an "Unresolved reference" warning with no link generated (or an incorrect external
.NETlink).Root Cause
Two issues in
CrossReferenceResolver.fs:SymbolReader.fsline 652: Crefs without:are prepended with"T:", so"Class2.Other"becomes"T:Class2.Other". The type lookup then fails since no type is named"Class2.Other", and the external fallback produces a bogus.NETdocs link.resolveCrossReferenceForTypeByXmlSig: When bothxmlDocNameToSymbolandniceNameEntityLookuplookups fail for aT:sig, it immediately falls through to an external link without attempting to split aType.Memberpattern.Fix
stripGenericSuffix: New helper that strips<...>and`Nsuffixes from type names.resolveCrossReferenceForTypeByXmlSig: When the lookup fails for aT:Type.Membersig, try splitting on the last.and looking up the type part inniceNameEntityLookup(trying both raw name like"GenericClass21"and stripped name like"GenericClass2"`).tryResolveUnqualifiedCref: New function for crefs with no XML prefix (reached viaResolveCref's catch-all case). Handles both plain type names andType.Memberpatterns.tryResolveCrossReferenceForMemberByXmlSig: When the fully-qualified type lookup fails, also tryniceNameEntityLookupwith the simple (last-segment) type name using raw and stripped forms.Test Cases Added
New test types in
crefLib2/Library2.fs:Class9:(see cref="Class2" /)— unqualified type referenceClass10:(see cref="Class2.Other" /)and(see cref="Class2.Method0" /)— unqualified Type.MemberClass11:(see cref="GenericClass21" /)and(see cref="GenericClass21.Property" /)— generic type/memberAlso uncommented the previously-disabled URL check for
creflib2-class1(Class1 uses(see cref="Class2" /)).Test Status
All 337 tests pass (
Passed: 72, Skipped: 4for ApiDocs; full suitePassed: 337, Skipped: 6).Closes #605