I have a strange scenario now. One of my colleague who was working in v.1 (verison 1)_ and created a project.. He opened up the project in v.2.. Meanwhile v.2 had some concept changes underwent for a ...

This is an auto-generated question from the MPS Slack community: I have a strange scenario now. One of my colleague who was working in v.1 (verison 1)_ and created a project.. He opened up the project in v.2.. Meanwhile v.2 had some concept changes underwent for a particular concept C... i.e C had a new child in v.2... Now the user opened the same model in v1 again.. And he gets a error 'Child does not belong to the concept' -- which is quite understandable... How to programatically fix it?? If I write a quickfix like 'if concept.child is not null -- will this be readable in v1? because the definition of the child itself is not present there isnt it? Please help. What other impact wil it cause?
0
16 comments
It might be fixable through an intention. If you want to fix it programmatically, you can write the code to do so in the newer version and then copy-paste the _generated_ Java code into the older version (it will use classes such as SLinkAdapterById and whatnot, with the right IDs baked in for you).
0
There's not much impact besides error messages, I'd say. MPS nodes are basically like hashmaps on the lowest level.
0
I have written some quickfixes for the concept change in the newer version. But how to copy paste the generated java code?
0
Right click → _Preview Generated Text_ → copy text in the old version: Right click → _Paste as Java Class Content_ or _Paste as Java Statements_
0
This paste option?
0
Right click and preview generatd text generated me a xml? is that right?
0
no, it should have generated Java code
0
right click is on the project model right? I mean the document which shows the error?
0
what do your quick fixes that you've written look like?
0
btw if you want, come to office hours right now and we can take a look together
0
Hi I just noticed ur msg.. Is the office hour over already?
0
yes, unfortunately
0
next session next Wednesday at 14 CEST
0
Oh.. My bad! But again I wrote some quickfixes to temporarily detach that problem causing child. Might solve this issue for the user. I will have to wait and see
0
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
0

Post is closed for comments.