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

Add missing APIs doc in ImmutableArrayExtensions #46014

Closed
wants to merge 3 commits into from

Conversation

himanshu8088
Copy link
Contributor

The param, exception, returns, and typeparam doc annotation was missing in various APIs

The partial API documentation was present in Where, Any, Aggregate, Single, First as per the documentation wiki

The pull request has initial documentation work, and various missing annotations are added in the APIs.
This documentation is not complete yet, it can be fixed in further PRs, this is just an initial draft.

Fix #43854

@ghost
Copy link

ghost commented Dec 13, 2020

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

The param, exception, returns, and typeparam doc annotation was missing in various APIs

The partial API documentation was present in Where, Any, Aggregate, Single, First as per the documentation wiki

The pull request has initial documentation work, and various missing annotations are added in the APIs.
This documentation is not complete yet, it can be fixed in further PRs, this is just an initial draft.

Fix #43854

Author: himanshu8088
Assignees: -
Labels:

area-System.Linq

Milestone: -

@dnfadmin
Copy link

dnfadmin commented Dec 13, 2020

CLA assistant check
All CLA requirements met.

@@ -614,6 +641,7 @@ public static T Single<T>(this ImmutableArray<T> immutableArray, Func<T, bool> p
/// </summary>
/// <typeparam name="T">The type of element contained by the collection.</typeparam>
/// <param name="immutableArray"></param>
/// <exception cref="ThrowNullRefIfNotInitialized">Thrown if the collection is empty.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, Make sure you add using statement for namespace for give type in that file!

@eiriktsarpalis
Copy link
Member

Hi @himanshu8088, our source of truth w.r.t. to API documentation is the https://github.com/dotnet/dotnet-api-docs/ repo. Any improvements should be made there. Note however that @carlossanlop is working towards porting dotnet-api-docs back to source code, so this is subject to change in the future.

Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

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

I left a few recommendations.

Comment on lines +82 to +83
/// <param name="immutableArray">The immutable array.</param>
/// <param name="predicate">The predicate.</param>
Copy link
Member

Choose a reason for hiding this comment

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

Can you please provide more elaborate descriptions for these two params?

@@ -94,6 +102,9 @@ public static IEnumerable<T> Where<T>(this ImmutableArray<T> immutableArray, Fun
/// </summary>
/// <typeparam name="T">The type of element contained by the collection.</typeparam>
/// <param name="immutableArray"></param>
/// <returns>
/// <c>true</c> if the <paramref name="immutableArray"/> contains any element; otherwise, <c>false</c>.
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere - Please use <see langword="true" /> and <see langword="false" />:

Suggested change
/// <c>true</c> if the <paramref name="immutableArray"/> contains any element; otherwise, <c>false</c>.
/// <see langword="true" /> if the <paramref name="immutableArray"/> contains any element; otherwise, <see langword="false" />.

Comment on lines +270 to +271
/// <param name="immutableArray"></param>
/// <param name="func"></param>
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere - Should not be empty.

@@ -106,6 +117,9 @@ public static bool Any<T>(this ImmutableArray<T> immutableArray)
/// <typeparam name="T">The type of element contained by the collection.</typeparam>
/// <param name="immutableArray"></param>
Copy link
Member

Choose a reason for hiding this comment

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

Should not be empty.

@@ -511,6 +536,8 @@ public static T Single<T>(this ImmutableArray<T> immutableArray, Func<T, bool> p
/// Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
/// </summary>
/// <typeparam name="T">The type of element contained by the collection.</typeparam>
/// <param name="immutableArray"></param>
/// <param name="predicate">The predicate.</param>
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere - Please provide a more specific/elaborate description.

@@ -614,6 +641,7 @@ public static T Single<T>(this ImmutableArray<T> immutableArray, Func<T, bool> p
/// </summary>
/// <typeparam name="T">The type of element contained by the collection.</typeparam>
/// <param name="immutableArray"></param>
/// <exception cref="ThrowNullRefIfNotInitialized">Thrown if the collection is empty.</exception>
Copy link
Member

Choose a reason for hiding this comment

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

No need to use the word "thrown" in exceptions; it's implied. Instead, you can use:

Suggested change
/// <exception cref="ThrowNullRefIfNotInitialized">Thrown if the collection is empty.</exception>
/// <exception cref="ThrowNullRefIfNotInitialized">The collection is empty.</exception>

Copy link
Member

Choose a reason for hiding this comment

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

The CI failed in all legs due to the following error:

Error CS1574: XML comment has cref attribute 'ThrowNullRefIfNotInitialized' that could not be resolved.

That is because ThrowNullRefIfNotInitialized is not an exception, it's a method that throws an exception. You'll have to inspect that method to see what exception it throws, and use that identifier for the cref.

@himanshu8088
Copy link
Contributor Author

I left a few recommendations.

thanks will accommodate recommended changes

@ericstj ericstj added the documentation Documentation bug or enhancement, does not impact product or test code label Feb 17, 2021
@carlossanlop carlossanlop changed the title add missing APIs doc in ImmutableArrayExtenstions.cs Add missing APIs doc in ImmutableArrayExtensions Feb 18, 2021
Base automatically changed from master to main March 1, 2021 09:07
@ericstj
Copy link
Member

ericstj commented Mar 8, 2021

@himanshu8088 were you planning to resume this PR?

@eiriktsarpalis
Copy link
Member

I'm going to close the PR due to lack of activity. @himanshu8088 feel free to reopen when you have the time to work on this again. Thanks.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 27, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Linq documentation Documentation bug or enhancement, does not impact product or test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API documentation debt - System.Linq
8 participants