-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add documentation for CompareOptions.NumericOrdering #10721
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
base: main
Are you sure you want to change the base?
Add documentation for CompareOptions.NumericOrdering #10721
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-globalization |
This comment was marked as outdated.
This comment was marked as outdated.
|
Learn Build status updates of commit 15a5d3b:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| xml/System.Globalization/CompareInfo.xml | View | Details | |
| xml/System.Globalization/GlobalizationExtensions.xml | View | Details | |
| xml/System.Globalization/CompareOptions.xml | ✅Succeeded | View |
xml/System.Globalization/CompareInfo.xml
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'format' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'. - Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'.
xml/System.Globalization/GlobalizationExtensions.xml
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Globalization.CompareOptions.NumericOrdering'.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
There was a problem hiding this 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 adds documentation for the new CompareOptions.NumericOrdering API introduced in dotnet/runtime#109861. The changes update several XML documentation files to include references to the new option and clarify when it's valid or invalid for use.
- Adds the
NumericOrderingmember documentation toCompareOptions.xml - Updates existing
CompareOptionsmember summaries to use consistent phrasing ("A string comparison that..." instead of "Indicates that...") - Adds
NumericOrderingto parameter documentation lists acrossCompareInfoandGlobalizationExtensionsmethods - Updates remarks sections to note that
NumericOrderingis invalid for indexing methods (likeIndexOf,IsPrefix,IsSuffix,LastIndexOf)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| xml/System.Globalization/CompareOptions.xml | Adds NumericOrdering member documentation; updates existing member summaries to use consistent style; improves remarks section with present tense |
| xml/System.Globalization/GlobalizationExtensions.xml | Adds NumericOrdering to the GetStringComparer options parameter documentation |
| xml/System.Globalization/CompareInfo.xml | Adds NumericOrdering to Compare, GetSortKey parameter documentation; updates remarks to note NumericOrdering is invalid for indexing methods |
| </ReturnValue> | ||
| <MemberValue>32</MemberValue> | ||
| <Docs> | ||
| <summary>A string comparison that sorts sequences of digits (Unicode general category "Nd") based on their numeric value. For example, "2" comes before "10". Non-digit characters such as decimal points and minus or plus signs aren't considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as <see cref="CompareInfo.IndexOf(string, string, CompareOptions)"/> and <see cref="CompareInfo.IsPrefix(string, string, CompareOptions)"/>).</summary> |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation guidelines, sentences should end with a period. The last sentence in this summary is missing a period.
| <Member MemberName="NumericOrdering"> | ||
| <MemberSignature Language="C#" Value="NumericOrdering" /> | ||
| <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Globalization.CompareOptions NumericOrdering = int32(32)" /> | ||
| <MemberSignature Language="DocId" Value="F:System.Globalization.CompareOptions.NumericOrdering" /> | ||
| <MemberSignature Language="VB.NET" Value="NumericOrdering" /> | ||
| <MemberSignature Language="F#" Value="NumericOrdering = 32" Usage="System.Globalization.CompareOptions.NumericOrdering" /> | ||
| <MemberSignature Language="C++ CLI" Value="NumericOrdering" /> | ||
| <MemberType>Field</MemberType> | ||
| <AssemblyInfo> | ||
| <AssemblyName>System.Runtime</AssemblyName> | ||
| <AssemblyVersion>10.0.0.0</AssemblyVersion> | ||
| </AssemblyInfo> | ||
| <ReturnValue> | ||
| <ReturnType>System.Globalization.CompareOptions</ReturnType> | ||
| </ReturnValue> | ||
| <MemberValue>32</MemberValue> | ||
| <Docs> | ||
| <summary>A string comparison that sorts sequences of digits (Unicode general category "Nd") based on their numeric value. For example, "2" comes before "10". Non-digit characters such as decimal points and minus or plus signs aren't considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as <see cref="CompareInfo.IndexOf(string, string, CompareOptions)"/> and <see cref="CompareInfo.IsPrefix(string, string, CompareOptions)"/>).</summary> | ||
| </Docs> | ||
| </Member> |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NumericOrdering member is duplicated in this file. It appears both at lines 378-409 and again at lines 546-565. Only one definition should be present. Additionally, the two definitions have inconsistencies in their documentation format and see cref styles.
| <Member MemberName="NumericOrdering"> | |
| <MemberSignature Language="C#" Value="NumericOrdering" /> | |
| <MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Globalization.CompareOptions NumericOrdering = int32(32)" /> | |
| <MemberSignature Language="DocId" Value="F:System.Globalization.CompareOptions.NumericOrdering" /> | |
| <MemberSignature Language="VB.NET" Value="NumericOrdering" /> | |
| <MemberSignature Language="F#" Value="NumericOrdering = 32" Usage="System.Globalization.CompareOptions.NumericOrdering" /> | |
| <MemberSignature Language="C++ CLI" Value="NumericOrdering" /> | |
| <MemberType>Field</MemberType> | |
| <AssemblyInfo> | |
| <AssemblyName>System.Runtime</AssemblyName> | |
| <AssemblyVersion>10.0.0.0</AssemblyVersion> | |
| </AssemblyInfo> | |
| <ReturnValue> | |
| <ReturnType>System.Globalization.CompareOptions</ReturnType> | |
| </ReturnValue> | |
| <MemberValue>32</MemberValue> | |
| <Docs> | |
| <summary>A string comparison that sorts sequences of digits (Unicode general category "Nd") based on their numeric value. For example, "2" comes before "10". Non-digit characters such as decimal points and minus or plus signs aren't considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as <see cref="CompareInfo.IndexOf(string, string, CompareOptions)"/> and <see cref="CompareInfo.IsPrefix(string, string, CompareOptions)"/>).</summary> | |
| </Docs> | |
| </Member> |
| <para>For example, "2" comes before "10". Non-digit characters such as decimal points, minus, and plus signs</para> | ||
| <para>are not considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as <see cref="M:System.Globalization.CompareInfo.IndexOf(System.String,System.String,System.Globalization.CompareOptions)" /> and <see cref="M:System.Globalization.CompareInfo.IsPrefix(System.String,System.String,System.Globalization.CompareOptions)" />).</para> | ||
| <para>A string comparison that sorts sequences of digits (Unicode general category "Nd") based on their numeric value.</para> | ||
| <para>For example, "2" comes before "10". Non-digit characters such as decimal points, minus, and plus signs aren't considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as <see cref="M:System.Globalization.CompareInfo.IndexOf(System.String,System.String,System.Globalization.CompareOptions)" /> and <see cref="M:System.Globalization.CompareInfo.IsPrefix(System.String,System.String,System.Globalization.CompareOptions)" />).</para> |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation guidelines, contractions should be used for a conversational tone. The text "aren't" is correct, but this sentence should end with a period.
Add documentation for new API introduced in dotnet/runtime#109861