You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a follow-up (not in this PR), I think we should also place the enums with their values into the module object returned by loadFile. That way the developer gets code completion support and it will match the string enum typescript type declarations of the future (future type safety).
We do the same for structs in the Python port and it works quite well there.
In terms of user experience: it's good to get an error that "Ap" is not a valid value for the enum "Direction", but it would be even better if the diagnosis would include the valid options. That way it's easy to spot typos and figure out how to correct them. The Rust compiler does a great job at that. Another option would be to compute the Levenshtein distance and suggest the nearest match.
As a follow-up (not in this PR), I think we should also place the enums with their values into the module object returned by loadFile. That way the developer gets code completion support and it will match the string enum typescript type declarations of the future (future type safety).
We do the same for structs in the Python port and it works quite well there.
In terms of user experience: it's good to get an error that "Ap" is not a valid value for the enum "Direction", but it would be even better if the diagnosis would include the valid options. That way it's easy to spot typos and figure out how to correct them. The Rust compiler does a great job at that. Another option would be to compute the Levenshtein distance and suggest the nearest match.
Originally posted by @tronical in #6421 (review)
The text was updated successfully, but these errors were encountered: