-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete debugger story for ReadOnlySequence #25178
Comments
You've got two separate issues here; want to move
To a different issue as it will currently break for |
Code for
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public readonly partial struct ReadOnlySequence<T>
{
private string DebuggerDisplay
{
// Output:
// IMemoryList<Byte>[90] 10 .. 100
// OwnedMemory<Byte>[100] 0 .. 100
// Char[8] 10 .. 18
get
{
if (_sequenceStart.Segment == null)
{
return "(default)";
}
GetTypeAndIndices(_sequenceStart.Index, _sequenceEnd.Index, out SequenceType type, out var startIndex, out var endIndex);
if (type == SequenceType.String)
{
return "\"" + ((string)_sequenceStart.Segment).Substring(startIndex, endIndex - startIndex) + "\"";
}
string typeName;
if (type == SequenceType.Array)
{
typeName = $"{typeof(T).Name}[{Length}]";
}
else
{
typeName = $"{type}<{typeof(T).Name}>[{Length}]";
}
string range;
if (type == SequenceType.IMemoryList)
{
var start = (IMemoryList<T>)_sequenceStart.Segment;
var end = (IMemoryList<T>)_sequenceEnd.Segment;
range = $"{start.RunningIndex + startIndex} .. {end.RunningIndex + endIndex}";
}
else
{
range = $"{startIndex} .. {endIndex}";
}
return $"{typeName} {range}";
}
}
} |
related dotnet/corefx#27338 |
@pakrym can this issue be closed now? |
@pakrym was it fully addressed in dotnet/corefx#28857 or were there additional changes for this? (double checking that all necessary parts made it into 2.1) |
We need to add implementation for
ReadOnlySequence<char>
same as inSpan<char>
andMemory<char>
.We also need a better way to display positions - with masks removed, possibly segments visualized.
/cc @ahsonkhan @davidfowl @KrzysztofCwalina
The text was updated successfully, but these errors were encountered: