Skip to content

Commit 2328612

Browse files
auduchinokbaronfel
authored andcommitted
Add FSharpDisplayContext.WithShortTypeNames(bool) (#7651)
1 parent c1d6fc8 commit 2328612

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/fsharp/symbols/Symbols.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,12 @@ module Impl =
188188

189189
type FSharpDisplayContext(denv: TcGlobals -> DisplayEnv) =
190190
member x.Contents g = denv g
191+
191192
static member Empty = FSharpDisplayContext(fun g -> DisplayEnv.Empty g)
192193

194+
member x.WithShortTypeNames shortNames =
195+
FSharpDisplayContext(fun g -> { denv g with shortTypeNames = shortNames })
196+
193197

194198
// delay the realization of 'item' in case it is unresolved
195199
type FSharpSymbol(cenv: SymbolEnv, item: (unit -> Item), access: (FSharpSymbol -> CcuThunk -> AccessorDomain -> bool)) =

src/fsharp/symbols/Symbols.fsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ type [<Class>] public FSharpDisplayContext =
5050
internal new : denv: (TcGlobals -> Tastops.DisplayEnv) -> FSharpDisplayContext
5151
static member Empty: FSharpDisplayContext
5252

53+
member WithShortTypeNames: bool -> FSharpDisplayContext
54+
5355
/// Represents a symbol in checked F# source code or a compiled .NET component.
5456
///
5557
/// The subtype of the symbol may reveal further information and can be one of FSharpEntity, FSharpUnionCase

0 commit comments

Comments
 (0)