Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ private static IEnumerable<object[]> TestDebuggerAttributes_GenericDictionaries(
yield return new object[] { new ReadOnlyDictionary<int, string>(new Dictionary<int, string>()), new KeyValuePair<string, string>[0] };
yield return new object[] { new SortedDictionary<string, int>(), new KeyValuePair<string, string>[0] };
yield return new object[] { new SortedList<int, string>(), new KeyValuePair<string, string>[0] };
yield return new object[] { new OrderedDictionary<int, string>(), new KeyValuePair<string, string>[0] };

yield return new object[] { new Dictionary<int, string>{{1, "One"}, {2, "Two"}},
new KeyValuePair<string, string>[]
Expand Down Expand Up @@ -69,6 +70,14 @@ private static IEnumerable<object[]> TestDebuggerAttributes_GenericDictionaries(
new ("[2]", "\"Two\""),
}
};

yield return new object[] { new OrderedDictionary<int, string>{{1, "One"}, {2, "Two"}},
new KeyValuePair<string, string>[]
{
new ("[0/1]", "\"One\""),
new ("[1/2]", "\"Two\""),
}
};
}

private static IEnumerable<object[]> TestDebuggerAttributes_AdditionalGenericDictionaries()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<Compile Include="$(CoreLibSharedDir)System\Collections\ObjectModel\CollectionHelpers.cs" Link="Common\System\Collections\ObjectModel\CollectionHelpers.cs" />
<Compile Include="System\Collections\Generic\LinkedList.cs" />
<Compile Include="System\Collections\Generic\OrderedDictionary.cs" />
<Compile Include="System\Collections\Generic\OrderedDictionaryDebugView.cs" />
<Compile Include="System\Collections\Generic\PriorityQueue.cs" />
<Compile Include="System\Collections\Generic\PriorityQueueDebugView.cs" />
<Compile Include="System\Collections\Generic\SortedDictionary.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// Operations on the collection have algorithmic complexities that are similar to that of the <see cref="List{T}"/>
/// class, except with lookups by key similar in complexity to that of <see cref="Dictionary{TKey, TValue}"/>.
/// </remarks>
[DebuggerTypeProxy(typeof(IDictionaryDebugView<,>))]
[DebuggerTypeProxy(typeof(OrderedDictionaryDebugView<,>))]

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_WithPackages)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_WithPackages)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_WithPackages)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build Source-Build (Linux_x64))

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 26 in src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs#L26

src/libraries/System.Collections/src/System/Collections/Generic/OrderedDictionary.cs(26,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'OrderedDictionaryDebugView<,>' could not be found (are you missing a using directive or an assembly reference?)
[DebuggerDisplay("Count = {Count}")]
#if SYSTEM_COLLECTIONS
public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics;

namespace System.Collections.Generic
{
internal sealed class OrderedDictionaryDebugView<TKey, TValue> where TKey : notnull
{
private readonly OrderedDictionary<TKey, TValue> _dictionary;

public OrderedDictionaryDebugView(OrderedDictionary<TKey, TValue> dictionary)
{
ArgumentNullException.ThrowIfNull(dictionary);
_dictionary = dictionary;
}

[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public DebugViewOrderedDictionaryItem<TKey, TValue>[] Items
{
get
{
var items = new DebugViewOrderedDictionaryItem<TKey, TValue>[_dictionary.Count];
int index = 0;
foreach (KeyValuePair<TKey, TValue> kvp in _dictionary)
{
items[index] = new DebugViewOrderedDictionaryItem<TKey, TValue>(index, kvp.Key, kvp.Value);
index++;
}
return items;
}
}
}

/// <summary>
/// Defines an index/key/value triple for displaying an item of an ordered dictionary by a debugger.
/// </summary>
[DebuggerDisplay("{Value}", Name = "[{Index}/{Key}]")]
internal readonly struct DebugViewOrderedDictionaryItem<TKey, TValue>
{
public DebugViewOrderedDictionaryItem(int index, TKey key, TValue value)
{
Index = index;
Key = key;
Value = value;
}

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public int Index { get; }

[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
public TKey Key { get; }

[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
public TValue Value { get; }
}
}
Loading