fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Improve type formatting for C# nested types with generic parameters

Open baronfel opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

FSharpType.Format for a C#-defined nested type is incorrect when the parent type contains a generic parameter.

The type annotation for builder in the following code:

open System.Collections.Immutable

let builder = ImmutableArray.CreateBuilder<int>()

is val builder: ImmutableArray`1.Builder<int>, when it more accurately should be ImmutableArray<int>.Builder to reflect the layout of the type declarations and the relationship between the parent and child.

Describe the solution you'd like

Generic parameters on parent types to be filled in at the point of declaration (`1) instead of at the end of the child type.

Describe alternatives you've considered

Custom logic to detect this scenario and render the types manually.

Additional context

This is using FCS 41.0.3

baronfel avatar May 27 '22 15:05 baronfel