-
Notifications
You must be signed in to change notification settings - Fork 78
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
Allow nodes to be visible in multiple diagrams #1470
Comments
The generic box query is not a workaround, it's the only possible way. This is because of limitations in MPS. |
:-( |
I can try to make it more extensible. |
Alternatively, would is be possible to make the generic box query more flexible to solve some of the problems? |
Just thinking aloud: would it e.g. be possible to let the generic box query refer to the diagram box editor for the parameter node type? This could result in a lot less duplicated editor specification code, because all of the properties are defined in that editor as well. |
I can try to invoke the cell factory for the concept directly, but I don't know how well that will work and what the side effects are. |
Can you allow a reference to the nodes diagram editor from the generic box query, and then copy that, such that it essentially becomes a short way to specify the same as we have today ? |
This would require to reference all editors for all possible subconcepts and break extensibility. |
You are right that this isn't extensible. But, in the current generic box query we need to specify everything explicitly for the specified node type, which cannot be overridden by possible subconcepts. Doesn't this mean that this is non-extensible either? Or am I missing some extensibility option here? |
Yes, both options would break extensibility. That's why I'm trying to find a solution that does not require generic queries. |
The delete action now directly deletes the elements from the MPS model and in the diagram they are removed on the next read sync. This conforms more to the principle of a projectional editor. In some cases elements where accidentally deleted from the model (most of the time caused by an error in the editor definition). This change is supposed to fix that, because elements can now only be removed by an explicit user action. See also #1470
The delete action now directly deletes the elements from the MPS model and in the diagram they are removed on the next read sync. This conforms more to the principle of a projectional editor. In some cases elements where accidentally deleted from the model (most of the time caused by an error in the editor definition). This change is supposed to fix that, because elements can now only be removed by an explicit user action. See also #1470
A node is often visible in multiple diagrams. E.g. when inherited nodes are shown somewhere in an extends hierarchy. Currently you cannot use the nodesQuery to get nodes into more than one diagram, as the nodesQuery used the same ID for one node to store diagram information.
The current workaround is to use a generix box query instead of a nodesQuery because the generic box query allows you to specify the ID yourself, so you can make a unique ID.
However, the generic box query is much more limited, and forces you to specify many details that are done more or less automatically in case of a nodesQuery. One specific example is e.g. that a generic box query forces you to specify one node type only for the result of the query. And then you have to specify properties like the shape, the editor, etc. explicitly. The nodesQuery allows you to just return a set of randon nodes and it will automatically find the editor and shape available.
For a nodesQuery that results in many different node types, I now have to filter the query by type, and use a generic box query for each of these types. This blows up the code of the editor a lot.
Therefore it should be allowed to have a node visible in multiple diagrams without having to use the generic box query.
The text was updated successfully, but these errors were encountered: