ExpressionTreeToString icon indicating copy to clipboard operation
ExpressionTreeToString copied to clipboard

Add support for the use of enum arguments in ToString

Open Ephron-WL opened this issue 2 years ago • 2 comments

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 avatar Dec 14 '22 18:12 Ephron-WL

There is an enum at ExpressionTreeToString.BuiltInRenderer.

image

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

image

zspitz avatar Dec 14 '22 20:12 zspitz

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!

Ephron-WL avatar Dec 14 '22 21:12 Ephron-WL