Convert SetModeledMethodsMessage to include multiple modeled methods#2942
Convert SetModeledMethodsMessage to include multiple modeled methods#2942robertbrignull merged 3 commits intomainfrom
Conversation
c569e34 to
c6a9f23
Compare
| libraryVersion?: string; | ||
| methods: Method[]; | ||
| modeledMethods: Record<string, ModeledMethod>; | ||
| modeledMethodsMap: Record<string, ModeledMethod[]>; |
There was a problem hiding this comment.
Is there a specific reason for using modeledMethodsMap here, while we're using modeledMethods everywhere else?
There was a problem hiding this comment.
My intention was to change all instances of things with the type Record<string, ModeledMethod[]> in the model editor webview to modeledMethodsMap, so they're all consistent. That way we aren't calling the data modeledMethods in one component, but then passing it to another component where we call the same data modeledMethodsMap and modeledMethods has a different meaning.
Do you think we should just call it modeledMethods unless we also happen to need objects of type ModeledMethod[] in the same scope?
I didn't spot that my automated renaming had renamed the fields in the type but not when they're used in the component. So we have modeledMethodsMap: modeledMethods when we get the value from the props. I'll fix that because I think that's definitely unhelpful, regardless of the decision above.
There was a problem hiding this comment.
That makes sense, I think the modeledMethodsMap: modeledMethods was just confusing to me.
Converts
SetModeledMethodsMessageto include multiple modeled methods and pushes that change throughout the model editor. This means it's now possible to view multiple methods, though it's not yet possible to edit them and save the changes.This can be tested by manually editing a model file to give multiple modelings for the same method.
Checklist
ready-for-doc-reviewlabel there.