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

support completing in/through inline records in variant payloads #695

Merged
merged 2 commits into from
Jan 14, 2023

Conversation

zth
Copy link
Collaborator

@zth zth commented Jan 13, 2023

No description provided.

@zth zth requested a review from cristianoc January 13, 2023 20:07
@zth zth mentioned this pull request Jan 13, 2023
24 tasks
let extractedType =
match t with
| TypeExpr t -> t |> extractType ~env ~package:full.package
| InlineRecord fields -> Some (TinlineRecord {env; fields})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a wondering why we need a variant called InlineRecord in two places in SharedTypes.
I guess the question can be rephrased here as: do we need TypeExpr and InlineRecord to exist at the same level here? Somehow an inline record is not a self-standing type.
Not sure I have something concrete to suggest, just an open-ended question.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question for sure, and I don't have a clear/good answer either. One extra bit of context is that I intend to add another constructor there as well soon, for handling completing from Type.t (via type annotations for example).

I guess I view this as the "type source" to derive what to complete from, and this was the fastest/easiest way to handle inline records since they have no type expression of their own. And I guess the same will be true for types derived from type annotations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's come back to this eventually. I'll merge now so I can move on to the next thing.

@zth zth merged commit e80f245 into master Jan 14, 2023
@zth zth deleted the completion-inline-record branch January 14, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants