Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita50f4c5

Browse files
authored
Debugger View for lists (dotnet#4399)
1 parent551613c commita50f4c5

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

‎src/fsharp/FSharp.Core/prim-types.fs‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,30 +3043,35 @@ namespace Microsoft.FSharp.Collections
30433043
// List (debug view)
30443044
//-------------------------------------------------------------------------
30453045

3046-
and
3046+
and
30473047
ListDebugView<'T>(l:list<'T>)=
30483048

3049-
letListDebugViewMaxLength=50
3050-
let reccount l n=
3051-
match lwith
3052-
|[]-> n
3053-
|_::t->if n> ListDebugViewMaxLengththen nelse count t(n+1)
3049+
letListDebugViewMaxLength=50// default displayed Max Length
3050+
letListDebugViewMaxFullLength=5000// display only when FullList opened (5000 is a super big display used to cut-off an infinite list or undebuggably huge one)
3051+
let reccount l n max=
3052+
match lwith
3053+
|[]-> n
3054+
|_::t->if n> maxthen nelse count t(n+1) max
30543055

3055-
[<DebuggerBrowsable(DebuggerBrowsableState.RootHidden)>]
3056-
memberx.Items=
3057-
letn= count l0
3058-
letitems= zeroCreate n
3056+
letitems length=
3057+
letitems= zeroCreate length
30593058
let reccopy(items:'T[])l i=
30603059
match lwith
30613060
|[]->()
30623061
| h::t->
3063-
if i<nthen
3062+
if i<lengththen
30643063
SetArray items i h
30653064
copy items t(i+1)
30663065

30673066
copy items l0
30683067
items
30693068

3069+
[<DebuggerBrowsable(DebuggerBrowsableState.RootHidden)>]
3070+
memberx.Items= items(count l0 ListDebugViewMaxLength)
3071+
3072+
[<DebuggerBrowsable(DebuggerBrowsableState.Collapsed)>]
3073+
memberx._FullList= items(count l0 ListDebugViewMaxFullLength)
3074+
30703075
typeResizeArray<'T>= System.Collections.Generic.List<'T>
30713076

30723077
//-------------------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp