Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ValueTuple<T1, T2> is not converted to links when using "outputFormat": "mref" #10317

Open
filzrev opened this issue Oct 23, 2024 · 0 comments
Labels
bug A bug to fix dotnet Generate .NET API reference docs

Comments

@filzrev
Copy link
Contributor

filzrev commented Oct 23, 2024

Describe the bug
When using "outputFormat": "mref" setting.
ValueTuple<T1, T2> cref DocComment is not resolved to link.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize docfx project and configure to include C# source code.
  2. Add following property to source code.
   /// <summary>
   /// - <see cref="System.ValueTuple" />
   /// - <see cref="System.ValueTuple{T}" />
   /// - <see cref="System.ValueTuple{_}" />
   /// - <see cref="System.ValueTuple{T1,T2}" />
   /// - <see cref="System.ValueTuple{_,_}" />
   /// - <see cref="System.Collections.Generic.Dictionary{_,_}" />
   /// </summary>
   public static class DummyClass
   {
   }
  1. Run docfx metadata command
  2. Run docfx build --serve command and confirm generated HTML
  3. Following cref links are rendered as plain text (<span class="xref">(T1, T2)</span>).
    5.1. <see cref="System.ValueTuple{T1,T2}" />
    5.2. <see cref="System.ValueTuple{_,_}" />

It seems caused by SymbolDisplay.ToDisplayParts Roslyn API returns custom ImmutableArray<SymbolDisplayPart> that don't contains href URL.

Generated yaml for ValueTuple<T1>

- uid: System.ValueTuple`1
  commentId: T:System.ValueTuple`1
  isExternal: true
  href: https://learn.microsoft.com/dotnet/api/system.valuetuple-1
  name: ValueTuple<T1>
  nameWithType: ValueTuple<T1>
  fullName: System.ValueTuple<T1>
  spec.csharp:
  - uid: System.ValueTuple`1
    name: ValueTuple
    isExternal: true
    href: https://learn.microsoft.com/dotnet/api/system.valuetuple-1
  - name: <
  - name: T1
  - name: '>'

Generated yaml for ValueTuple<T1,T2> (href link is missing)

- uid: System.ValueTuple`2
  commentId: T:System.ValueTuple`2
  name: (T1, T2)
  nameWithType: (T1, T2)
  fullName: (T1, T2)
  spec.csharp:
  - name: (
  - name: T1
  - name: ','
  - name: " "
  - name: T2
  - name: )
  spec.vb:
  - name: (
  - name: T1
  - name: ','
  - name: " "
  - name: T2
  - name: )

Expected behavior
ValueTuple<T1,T2> is rendered as link.

@filzrev filzrev added the bug A bug to fix label Oct 23, 2024
@yufeih yufeih added the dotnet Generate .NET API reference docs label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

2 participants