Skip to content

feat - Support 'Ignore Case' in TryParseFast #128

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tiantian0531
Copy link

According to #121, the source generator code was modified to support the use of string.Compare as expected by the user.

Generator result:
image

Source code:
image

Unit test:
image

BenchMark result:
image

@EngRajabi EngRajabi requested a review from Copilot April 15, 2025 10:34
Copy link

@Copilot 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.

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

Comments suppressed due to low confidence (2)

test/Console.Test.Benchmark/Program.cs:168

  • [nitpick] The method name 'Parse_CaseInsensitive_Ordinal' suggests a case-insensitive parse, but using StringComparison.Ordinal is case-sensitive. Consider renaming the method or adjusting the comparison parameter for clarity.
UserTypeEnumExtensions.TryParseFast("men", out _, StringComparison.Ordinal);

Supernova.Enum.Generators/EnumSourceGenerator.cs:452

  • [nitpick] The parameter name 'states' is unclear in this context; consider renaming it to 'input' or 'value' to better reflect its purpose.
public static bool {SourceGeneratorHelper.ExtensionMethodNameTryParse}(string states, out {symbol.FullName()} result,StringComparison comparisonType)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant