-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
API Proposal: Make char.IsAscii public #40936
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Not sure what the right area label for corelib stuff is. |
Note there is already |
Unless @GrabYourPitchforks has any objections, this feels like a sensible addition. |
We're also adding But I agree, targeted duplication like what's suggested here could help discoverability. |
namespace System
{
public readonly struct Char
{
public static bool IsAscii(char ch);
}
} |
Correction: the parameter should be named c, not ch. That matches other static APIs on the |
Anyone in the community interested in picking this up? |
You can assign it to me -- will send a PR tomorrow. Is https://github.com/dotnet/runtime/blob/master/src/libraries/System.Runtime/tests/System/CharTests.cs the right place to add some tests for this?
There is a bit of mix on |
@gfoidl it's yours! :)
Looks like we use c for our public APIs and ch (sometimes) for our internal APIs? I can't find any counterexamples offhand but admittedly I didn't look that hard. I wouldn't bother normalizing any other internal methods during this PR. |
For the record, in .Net Core 3.1 corelib, I count 29 methods with
|
@svick right, I'm only considering existing static public methods on the |
Are there any steps needed for the documentation? |
@gfoidl it's complicated -- normally the simple answer is "add XML docs in the src for this new public method" and that may be the correct answer. It's complicated because unlike almost everyone else, the core libraries don't historically generate their docs from the sources. We do want to use XML docs going forward, but only for seeding the docs.microsoft.com text initially. We have a tool that does this seeding so I think the answer is we'll need another PR to add Now I've typed that, I see it's documented by @carlossanlop here https://github.com/dotnet/runtime/blob/c87e75e8ef260ccc6e979f9df1cc012536ee036f/docs/coding-guidelines/adding-api-guidelines.md#documentation |
@danmosemsft it was easy to miss, as no other api in
So I'll send a PR with the doc comments (for this new public API)? |
@gfoidl certainly that is true, and it is because until recent years, there was no path from our source code to docs at all, and I guess we have not added much to Char recently. Yes, all that is needed is one for the new member. thanks |
System.Char currently defines a private
IsAscii
method. It think it might make sense to make this public?public readonly struct Char { + public static bool IsAscii(char ch); }
The text was updated successfully, but these errors were encountered: