-
Notifications
You must be signed in to change notification settings - Fork 57
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
Autocomplete polyvariants #283
Comments
This would indeed be pretty valuable. Requires: The main relevant part is 2. The rest is very similar to other cases of autocomplete. |
Notice because of type inference, the type of the expression switched over might not help. The same feature would provide more consistent value, without gotchas, on ordinary variants. |
This issue can be merged with #253. |
Merged into #253. |
I think this would also be valuable for assignments. Especially in GraphQL, where enums are usually modelled as polyvariants. So, kind of:
But, that particular example is tightly bound to completion on record fields when constructing them too I guess, which is mentioned in this issue: #120 |
Not sure it's related to record fields. The example is, but the general feature does not seem to be. When no type context exists, such as |
Ahh right, got it! Since polyvariants map to strings and ints so nicely now, I think there are a ton of usage of polyvariants for interop etc where a regular variant might actually be more "correct", but a polyvariant is used because it's zero cost. So for all of those cases, this type of feature would be very helpful. |
This would really be a killer feature that'd bring the experience closer to what TS offers.
Basically, what I'm looking for is something like:
Would this type of feature be easy or hard to implement? I understand there's multiple layers to this, like polyvariants with payloads, polyvariants with escaped names, open polyvariants etc. But just the "basic" case of autocompleting possible members of the polyvariant when they're known would be a big help.
The text was updated successfully, but these errors were encountered: