advanced-formula-environment icon indicating copy to clipboard operation
advanced-formula-environment copied to clipboard

Define enum argument with intellisense support

Open NickRedwood opened this issue 3 years ago • 2 comments

Hi, thanks for developing AFE, enjoying using it so far.

An improvement suggestion is the ability to define an enum-typed argument, with the same intellisense support that many built-in functions have. As far as I can tell, this functionality doesn't exist at present.

image

NickRedwood avatar Oct 21 '22 03:10 NickRedwood

Thanks for the suggestion. You are correct to say that we do not have his functionality.

Are the types of enums that you would use the same as the built-in functions, and the requirement is because you are wrapping these functions in a LAMBDA? Or, you would be using your own custom enums?

jack-williams avatar Oct 23 '22 17:10 jack-williams

I was thinking of custom enums. Possible to use strings of course and just return an error if an incorrect string is used, but an enum with intellisense/tooltip would be a more user-friendly experience.

Looking at that example for XLOOKUP, there are three different fields for each option - the number, the name and the tooltip. While it would be nice to be able to define all that, it would require a separate Enum or Type declaration, which I'm not sure is a route you want to go down. A simpler inline solution might also be an option e.g. [match_mode = Exact | ExactOrNextSmaller | ExactOrNextLarger | Wildcard]

... but for now just wanted to lodge this as a potential improvement.

NickRedwood avatar Oct 23 '22 23:10 NickRedwood