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 support for the use of enum arguments in ToString #92

Open
Ephron-WL opened this issue Dec 14, 2022 · 2 comments
Open

Add support for the use of enum arguments in ToString #92

Ephron-WL opened this issue Dec 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Ephron-WL
Copy link

Add support for using enums in ToString in addition to strings. Developers can't remember the available string option values, but could use Intellisense to view and select their desired value.

@Ephron-WL Ephron-WL added the enhancement New feature or request label Dec 14, 2022
@zspitz
Copy link
Owner

zspitz commented Dec 14, 2022

There is an enum at ExpressionTreeToString.BuiltInRenderer.

image

I don't know why Intellisense isn't displaying all the members, though:

image

@Ephron-WL
Copy link
Author

Ah, ok. Yeah, Intellisense won't recognize that parameter definition.

Your approach is definitely creative, but beyond the capability of IDEs to handle. The IDE is scanning the parameter types and when it sees OneOf<,>, it has no clue what a OneOf does or how it should interpret the type parameters defined for it.

You might consider two overloads,:

  • ToString(string, string)
  • ToString(BuiltinRender, Language)

That should solve the issue. It is a nice tool. I searched for a long time before I found it!

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

No branches or pull requests

2 participants