-
Notifications
You must be signed in to change notification settings - Fork 193
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
Switch ModeledMethod
to union of types
#3031
Conversation
This allows more disjointed models to be represented more accurately, such as type models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks really good! I like splitting the ModeledMethod
type up so that each sub-type only contains the fields it needs.
I have a few small comments asking for clarification or small improvements, but the overall idea and changes look great.
extensions/ql-vscode/src/view/model-editor/ModelKindDropdown.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(Has some conflicts in imports, but they didn't seem hard to fix)
This switches the
ModeledMethod
type from 1 type containing all fields to a union of multiple types where each type accurately represents which fields are present for a specific model. This allows more disjointed models to be represented more accurately, such as type models. For type models, havinginput
,output
, etc. doesn't make sense. It instead has fields liketype1
,type2
andpath
. I don't think adding these properties to every modeled method makes sense, so this is a solution which allows us to represent both models.This is a very large changeset, but I don't think splitting it up would be helpful (I don't really see how). A lot of the changes are changes to method names or removing unnecessary properties.
Checklist
ready-for-doc-review
label there.