dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
708 stars 1.55k forks source link

Fixing errors in SortedDictionary<TKey,TValue>.IDictionary.Keys Property page #7109

Open ryank425 opened 3 years ago

ryank425 commented 3 years ago

https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.sorteddictionary-2.system-collections-idictionary-keys?view=net-5.0#System_Collections_Generic_SortedDictionary_2_System_Collections_IDictionary_Keys

This weblink contains weird empty blocks. Seems like someone forgot to delete this.

image

Corresponding sample file refers to


//<Snippet32>
    }
}
//</Snippet32>

from https://github.com/dotnet/dotnet-api-docs/blob/main/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/CS/source.cs

https://github.com/dotnet/dotnet-api-docs/blob/main/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb

ryank425 commented 3 years ago

I think I figured what those blocks were trying to achieve. Thought it was an error.

image

Wish this could be more of a nested block to avoid confusion.

Example:

image

Changing the label from an error to suggestion/improvement/featurerequest might be more appropriate.

gewarren commented 2 years ago

@ryank425 Thanks for noting this. It's due to the crazy snippet arrangement in this file https://github.com/dotnet/dotnet-api-docs/blob/main/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/CS/source.cs. To fix this, we should have one snippet each for these APIs.