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

Improve parameter type naming for generic types #343

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

Conversation

olegKoshmeliuk
Copy link
Member

🤔 What's changed?

Changed RuntimeBindingType.FullName behavior for generic types.
Before it was simple Type.FullName which is not working good for generic and nullable types.
Now it's using custom logic to provide better value for autocomplete for generic types.

Example new placeholders:
image

⚡️ What's your motivation?

Current behavior :

  • List<string> => System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
  • int? => System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

That is resulting bad autocomplete hints in VS Plugin. (it's using FullName as a Placeholder)
This PR will change autocomplete steps in VS to be more readable.
From placeholder: [0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]]
To placeholder: [List<String>]

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "[vNext]" section of the CHANGELOG, linking to this pull request & included my GitHub handle to the release contributors list.

This text was originally taken from the template of the Cucumber project, then edited by hand. You can modify the template here.

@olegKoshmeliuk
Copy link
Member Author

olegKoshmeliuk commented Dec 6, 2024

@gasparnagy I open for suggestions.
I didn't add tests because I did't find good place.
Based on your suggestions I can create TestClass or Theory test for FullName getter.

@olegKoshmeliuk olegKoshmeliuk force-pushed the fix/binding-type-fullname branch from d21784c to 8c7d28b Compare December 9, 2024 08:30
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