Skip to content

Sort extension members alphabetically within each extension block#121

Merged
Tyrrrz merged 3 commits intoprimefrom
copilot/sort-extension-members-alphabetically
Apr 17, 2026
Merged

Sort extension members alphabetically within each extension block#121
Tyrrrz merged 3 commits intoprimefrom
copilot/sort-extension-members-alphabetically

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

  • Reorder Net60/EnumerableExtensionsTests.cs: Chunk → DistinctBy → ElementAt → ElementAtOrDefault → ExceptBy → FirstOrDefault (×2) → IntersectBy → LastOrDefault (×2) → Max → MaxBy → Min → MinBy → SingleOrDefault (×2) → Take → UnionBy → Zip (×2)
  • Reorder Net80/CollectionExtensionsTests.cs: AddRange (×2) → CopyTo (×2) → InsertRange
  • Reorder Net90/EnumerableExtensionsTests.cs: AggregateBy → CountBy → Index
  • Reorder NetCore10/EnumerableExtensionsTests.cs: Append → Prepend
  • Reorder NetCore20/CollectionExtensionsTests.cs: GetValueOrDefault → Remove (×2) → TryAdd (×2)
  • Reorder NetCore20/EnumerableExtensionsTests.cs: SkipLast → TakeLast → ToHashSet
  • Reorder NetCore21/MemoryExtensionsTests.cs: Array AsMemory (×3) → AsSpan (×3) → CopyTo(Memory) → CopyTo(Span); ArraySegment AsSpan; String AsMemory (×3) → AsSpan (×3); Span IndexOf → Reverse → SequenceEqual (×3); ReadOnlySpan IndexOf → SequenceEqual (×2)

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 17, 2026

@copilot please make sure that the order of test methods reflects the order of the actual members they're testing

@Tyrrrz Tyrrrz marked this pull request as ready for review April 17, 2026 18:09
Copilot AI review requested due to automatic review settings April 17, 2026 18:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes member ordering within C# extension blocks across PolyShim by sorting extension members alphabetically (keeping delegating overloads adjacent to the primary overloads), improving readability and consistency in the polyfill surface area.

Changes:

  • Reordered extension methods in multiple polyfill files to be alphabetical within each extension block.
  • Kept overload groupings intact (callee overloads adjacent to delegating overloads) while reordering.
  • No functional logic changes intended; changes are organizational.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
PolyShim/Net60/EnumerableExtensions.cs Alphabetized and regrouped LINQ extension polyfills within the IEnumerable<T> extension block.
PolyShim/Net80/CollectionExtensions.cs Reordered AddRange / CopyTo / InsertRange within the List<T> extension block.
PolyShim/Net90/EnumerableExtensions.cs Reordered AggregateBy, CountBy, and Index within the IEnumerable<T> extension block.
PolyShim/NetCore10/EnumerableExtensions.cs Swapped Append / Prepend ordering within the IEnumerable<T> extension block.
PolyShim/NetCore20/CollectionExtensions.cs Reordered Remove and TryAdd within the IDictionary<TKey, TValue> extension block.
PolyShim/NetCore20/EnumerableExtensions.cs Reordered SkipLast / TakeLast within the IEnumerable<T> extension block.
PolyShim/NetCore21/MemoryExtensions.cs Reordered AsMemory/AsSpan groups and CopyTo overloads; moved Reverse above SequenceEqual in the Span<T> block.
PolyShim/NetCore30/TaskAsyncEnumerableExtensions.cs Reordered ConfigureAwait and WithCancellation within the IAsyncEnumerable<T> extension block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 98.61111% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.68%. Comparing base (7b40ef0) to head (7bb55a3).
⚠️ Report is 1 commits behind head on prime.

Files with missing lines Patch % Lines
PolyShim/NetCore21/MemoryExtensions.cs 78.57% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            prime     #121   +/-   ##
=======================================
  Coverage   90.68%   90.68%           
=======================================
  Files         286      286           
  Lines        4982     4982           
  Branches      406      406           
=======================================
  Hits         4518     4518           
  Misses        372      372           
  Partials       92       92           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants