Skip to content

Add SpanSplitEnumerator.Source#113673

Merged
stephentoub merged 2 commits intodotnet:mainfrom
stephentoub:splitsource
Mar 19, 2025
Merged

Add SpanSplitEnumerator.Source#113673
stephentoub merged 2 commits intodotnet:mainfrom
stephentoub:splitsource

Conversation

@stephentoub
Copy link
Member

Closes #109874

Copilot AI review requested due to automatic review settings March 18, 2025 21:35
@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 18, 2025
@ghost
Copy link

ghost commented Mar 18, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Mar 18, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@stephentoub stephentoub added area-System.Memory and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Mar 18, 2025
Copy link
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 pull request introduces a new property, Source, to the SpanSplitEnumerator struct to expose the source span for enumeration. The changes include:

  • Adding the Source property in the ref assembly.
  • Adding an assertion in tests to verify the Source property.
  • Renaming internal fields and adjusting constructors in MemoryExtensions to use _source instead of _span.

Reviewed Changes

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

File Description
src/libraries/System.Memory/ref/System.Memory.cs Added the public Source property to SpanSplitEnumerator.
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/String.SplitTests.cs Added an assertion to check the Source property in the test.
src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs Renamed internal field _span to _source and updated constructors and comments accordingly.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@stephentoub stephentoub merged commit 8fffd57 into dotnet:main Mar 19, 2025
135 of 139 checks passed
@stephentoub stephentoub deleted the splitsource branch March 19, 2025 12:28
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Expose span on SpanSplitEnumerator

4 participants