Skip to content
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

Change IEnumerable to ImmutableArray #50323

Closed
wants to merge 1 commit into from
Closed

Conversation

tmat
Copy link
Member

@tmat tmat commented Jan 8, 2021

Unshipped public API change

Return ImmutableArray instead of IEnumerable from GetSourceGeneratedDocumentsAsync

@tmat tmat requested a review from a team as a code owner January 8, 2021 01:09
@tmat
Copy link
Member Author

tmat commented Jan 8, 2021

@tmat tmat added this to Queue in IDEReadyForReview via automation Jan 8, 2021
/// <summary>
/// Gets all source generated documents in this project.
/// </summary>
public async ValueTask<ImmutableArray<SourceGeneratedDocument>> GetSourceGeneratedDocumentsAsync(CancellationToken cancellationToken = default)
Copy link
Member

Choose a reason for hiding this comment

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

Do we have an interface to return that is immutable but not directly ImmutableArray? I worry if we end up with projects with thousands of generated files whether the larger arrays will cause issues.

Copy link
Member

Choose a reason for hiding this comment

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

(and yes the implementation would need some tweaking in that case, but at least we're not locked in with the current signature)

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean we would not want to instantiate all of the SourceGeneratedDocuments?

@tmat
Copy link
Member Author

tmat commented Jan 8, 2021

Gonna keep this IEnumerable.

@tmat tmat closed this Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants