Skip to content

Commit

Permalink
Fix Span Debugger Display String to correctly show the string contents (
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsonkhan authored Feb 22, 2018
1 parent 6a2904f commit ef1cab8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace System
/// or native memory, or to memory allocated on the stack. It is type- and memory-safe.
/// </summary>
[DebuggerTypeProxy(typeof(SpanDebugView<>))]
[DebuggerDisplay("{DebuggerDisplay,nq}")]
[DebuggerDisplay("{ToString(),raw}")]
public readonly ref partial struct ReadOnlySpan<T>
{
/// <summary>
Expand Down Expand Up @@ -108,9 +108,6 @@ internal ReadOnlySpan(Pinnable<T> pinnable, IntPtr byteOffset, int length)
_byteOffset = byteOffset;
}

//Debugger Display = System.ReadOnlySpan<T>[length]
private string DebuggerDisplay => string.Format("System.ReadOnlySpan<{0}>[{1}]", typeof(T).Name, Length);

/// <summary>
/// Returns the specified element of the read-only span.
/// </summary>
Expand Down
5 changes: 1 addition & 4 deletions src/libraries/System.Memory/src/System/Span.Portable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace System
/// or native memory, or to memory allocated on the stack. It is type- and memory-safe.
/// </summary>
[DebuggerTypeProxy(typeof(SpanDebugView<>))]
[DebuggerDisplay("{DebuggerDisplay,nq}")]
[DebuggerDisplay("{ToString(),raw}")]
public readonly ref partial struct Span<T>
{
/// <summary>
Expand Down Expand Up @@ -112,9 +112,6 @@ internal Span(Pinnable<T> pinnable, IntPtr byteOffset, int length)
_byteOffset = byteOffset;
}

//Debugger Display = System.Span<T>[length]
private string DebuggerDisplay => string.Format("System.Span<{0}>[{1}]", typeof(T).Name, _length);

/// <summary>
/// Returns a reference to specified element of the Span.
/// </summary>
Expand Down

0 comments on commit ef1cab8

Please sign in to comment.