@@ -702,13 +702,16 @@ and /// Represents a type definition, exception definition, module definition or
702702 | _ -> x.entity_ opt_ data <- Some { Entity.NewEmptyEntityOptData() with entity_ compiled_ name = name }
703703
704704 /// The display name of the namespace, module or type, e.g. List instead of List`1, and no static parameters
705- member x.DisplayName = x.GetDisplayName( false , false )
705+ member x.DisplayName = x.GetDisplayName()
706+
707+ /// The display name of the namespace, module or type with <'T, 'U, 'V> added for generic types, plus static parameters if any
708+ member x.DisplayNameWithStaticParametersAndTypars = x.GetDisplayName( withStaticParameters= true , withTypars= true , withUnderscoreTypars= false )
706709
707710 /// The display name of the namespace, module or type with <_, _, _> added for generic types, plus static parameters if any
708- member x.DisplayNameWithStaticParametersAndUnderscoreTypars = x.GetDisplayName( true , true )
711+ member x.DisplayNameWithStaticParametersAndUnderscoreTypars = x.GetDisplayName( withStaticParameters = true , withTypars = false , withUnderscoreTypars = true )
709712
710713 /// The display name of the namespace, module or type, e.g. List instead of List`1, including static parameters if any
711- member x.DisplayNameWithStaticParameters = x.GetDisplayName( true , false )
714+ member x.DisplayNameWithStaticParameters = x.GetDisplayName( withStaticParameters = true , withTypars = false , withUnderscoreTypars = false )
712715
713716#if ! NO_ EXTENSIONTYPING
714717 member x.IsStaticInstantiationTycon =
@@ -717,15 +720,20 @@ and /// Represents a type definition, exception definition, module definition or
717720 args.Length > 0
718721#endif
719722
720- member x.GetDisplayName ( withStaticParameters , withUnderscoreTypars ) =
723+ member x.GetDisplayName (? withStaticParameters , ? withTypars , ? withUnderscoreTypars ) =
724+ let withStaticParameters = defaultArg withStaticParameters false
725+ let withTypars = defaultArg withTypars false
726+ let withUnderscoreTypars = defaultArg withUnderscoreTypars false
721727 let nm = x.LogicalName
728+
722729 let getName () =
723730 match x.TyparsNoRange with
724731 | [] -> nm
725732 | tps ->
726733 let nm = DemangleGenericTypeName nm
727- if withUnderscoreTypars && not ( List.isEmpty tps) then
728- nm + " <" + String.concat " ," ( Array.create tps.Length " _" ) + " >"
734+ if ( withUnderscoreTypars || withTypars) && not ( List.isEmpty tps) then
735+ let typearNames = tps |> List.map ( fun typar -> if withUnderscoreTypars then " _" else typar.Name)
736+ nm + " <" + String.concat " ," typearNames + " >"
729737 else
730738 nm
731739
@@ -854,7 +862,7 @@ and /// Represents a type definition, exception definition, module definition or
854862 member x.Typars m = x.entity_ typars.Force m
855863
856864 /// Get the type parameters for an entity that is a type declaration, otherwise return the empty list.
857- member x.TyparsNoRange = x.Typars x.Range
865+ member x.TyparsNoRange : Typars = x.Typars x.Range
858866
859867 /// Get the type abbreviated by this type definition, if it is an F# type abbreviation definition
860868 member x.TypeAbbrev =
@@ -3362,6 +3370,9 @@ and
33623370 /// The display name of the namespace, module or type, e.g. List instead of List`1, not including static parameters
33633371 member x.DisplayName = x.Deref.DisplayName
33643372
3373+ /// The display name of the namespace, module or type with <'T, 'U, 'V> added for generic types, including static parameters
3374+ member x.DisplayNameWithStaticParametersAndTypars = x.Deref.DisplayNameWithStaticParametersAndTypars
3375+
33653376 /// The display name of the namespace, module or type with <_, _, _> added for generic types, including static parameters
33663377 member x.DisplayNameWithStaticParametersAndUnderscoreTypars = x.Deref.DisplayNameWithStaticParametersAndUnderscoreTypars
33673378
0 commit comments